open-vm-tools-10.0.7-3227872/aclocal.m40000644000000000000000000010076712660700525015526 0ustar rootroot# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # This file 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. m4_if(m4_PACKAGE_VERSION, [2.61],, [m4_fatal([this file was generated for autoconf 2.61. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file 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. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [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_$1_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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` 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=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 Free Software Foundation, Inc. # # This file 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. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [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 AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [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. AC_MSG_CHECKING([for style of include used by $am_make]) 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 AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl 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= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file 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. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file 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. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # 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". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # 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. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file 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. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) m4_include([m4/ltversion.m4]) m4_include([m4/lt~obsolete.m4]) m4_include([m4/vmtools.m4]) open-vm-tools-10.0.7-3227872/AUTHORS0000644000000000000000000000004112660700525014716 0ustar rootrootThe VMware Guest Components Team open-vm-tools-10.0.7-3227872/autom4te.cache/0000755000000000000000000000000012660700531016454 5ustar rootrootopen-vm-tools-10.0.7-3227872/autom4te.cache/requests0000644000000000000000000002773112660700531020264 0ustar rootroot# This file was generated. # It contains the lists of macros which have been traced. # It can be safely removed. @request = ( bless( [ '0', 1, [ '/usr/local/share/autoconf' ], [ '/usr/local/share/autoconf/autoconf/autoconf.m4f', '/usr/local/share/aclocal-1.10/amversion.m4', '/usr/local/share/aclocal-1.10/auxdir.m4', '/usr/local/share/aclocal-1.10/cond.m4', '/usr/local/share/aclocal-1.10/depend.m4', '/usr/local/share/aclocal-1.10/depout.m4', '/usr/local/share/aclocal-1.10/init.m4', '/usr/local/share/aclocal-1.10/install-sh.m4', '/usr/local/share/aclocal-1.10/lead-dot.m4', '/usr/local/share/aclocal-1.10/make.m4', '/usr/local/share/aclocal-1.10/minuso.m4', '/usr/local/share/aclocal-1.10/missing.m4', '/usr/local/share/aclocal-1.10/mkdirp.m4', '/usr/local/share/aclocal-1.10/options.m4', '/usr/local/share/aclocal-1.10/runlog.m4', '/usr/local/share/aclocal-1.10/sanity.m4', '/usr/local/share/aclocal-1.10/strip.m4', '/usr/local/share/aclocal-1.10/substnot.m4', '/usr/local/share/aclocal-1.10/tar.m4', 'm4/libtool.m4', 'm4/ltoptions.m4', 'm4/ltsugar.m4', 'm4/ltversion.m4', 'm4/lt~obsolete.m4', 'm4/vmtools.m4', 'configure.ac' ], { 'AM_ENABLE_STATIC' => 1, 'AC_LIBTOOL_LANG_RC_CONFIG' => 1, '_LT_AC_SHELL_INIT' => 1, 'AC_DEFUN' => 1, 'AC_PROG_LIBTOOL' => 1, '_LT_AC_LANG_CXX_CONFIG' => 1, 'AM_PROG_MKDIR_P' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'AM_MISSING_PROG' => 1, 'AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH' => 1, '_LT_AC_LANG_C_CONFIG' => 1, 'AM_PROG_INSTALL_STRIP' => 1, '_m4_warn' => 1, 'AC_VMW_CHECK_LIB' => 1, 'AC_LIBTOOL_OBJDIR' => 1, 'AM_SANITY_CHECK' => 1, 'LTOBSOLETE_VERSION' => 1, 'AC_LIBTOOL_LANG_GCJ_CONFIG' => 1, 'AC_LIBTOOL_PROG_COMPILER_PIC' => 1, 'LT_LIB_M' => 1, '_LT_AC_CHECK_DLFCN' => 1, 'AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE' => 1, 'LTSUGAR_VERSION' => 1, '_LT_PROG_LTMAIN' => 1, '_AM_PROG_TAR' => 1, 'AC_LIBTOOL_GCJ' => 1, '_LT_WITH_SYSROOT' => 1, 'AC_LIBTOOL_CONFIG' => 1, '_LT_AC_LANG_F77' => 1, '_AM_SUBST_NOTMAKE' => 1, '_AM_AUTOCONF_VERSION' => 1, 'AM_DISABLE_SHARED' => 1, '_LT_PROG_ECHO_BACKSLASH' => 1, '_LT_AC_LANG_CXX' => 1, 'AM_PROG_LIBTOOL' => 1, 'AM_PROG_LD' => 1, '_LT_AC_FILE_LTDLL_C' => 1, 'AU_DEFUN' => 1, 'AC_PROG_NM' => 1, 'AC_LIBTOOL_DLOPEN' => 1, 'AC_PROG_LD' => 1, 'AC_PROG_LD_GNU' => 1, 'AC_ENABLE_FAST_INSTALL' => 1, 'AC_LIBTOOL_FC' => 1, '_AM_SET_OPTION' => 1, 'AC_LTDL_PREOPEN' => 1, '_LT_LINKER_BOILERPLATE' => 1, '_LT_PREPARE_SED_QUOTE_VARS' => 1, 'AC_LIBTOOL_LANG_CXX_CONFIG' => 1, 'AC_LIBTOOL_PROG_CC_C_O' => 1, 'LT_SUPPORTED_TAG' => 1, 'AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'LT_PROG_RC' => 1, 'AC_DEFUN_ONCE' => 1, '_LT_AC_LANG_GCJ' => 1, 'AC_VMW_CHECK_LIBXX' => 1, 'AC_LTDL_OBJDIR' => 1, '_LT_PATH_TOOL_PREFIX' => 1, 'AC_LIBTOOL_RC' => 1, 'AC_DISABLE_FAST_INSTALL' => 1, '_LT_AC_PROG_ECHO_BACKSLASH' => 1, 'include' => 1, '_LT_AC_SYS_LIBPATH_AIX' => 1, '_LT_AC_TRY_DLOPEN_SELF' => 1, 'LT_AC_PROG_SED' => 1, 'AM_ENABLE_SHARED' => 1, '_LT_AC_LANG_GCJ_CONFIG' => 1, 'AC_ENABLE_SHARED' => 1, '_LT_REQUIRED_DARWIN_CHECKS' => 1, 'AC_ENABLE_STATIC' => 1, 'AC_LIBTOOL_SYS_HARD_LINK_LOCKS' => 1, 'AM_PROG_CC_C_O' => 1, '_LT_AC_TAGVAR' => 1, 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, 'AM_CONDITIONAL' => 1, '_LT_PROG_CXX' => 1, '_LT_PROG_F77' => 1, 'LTVERSION_VERSION' => 1, 'm4_include' => 1, 'AC_VMW_LIB_ERROR' => 1, 'AM_PROG_INSTALL_SH' => 1, 'AC_PROG_EGREP' => 1, 'AC_PATH_MAGIC' => 1, '_AC_AM_CONFIG_HEADER_HOOK' => 1, 'AM_MAKE_INCLUDE' => 1, '_LT_AC_TAGCONFIG' => 1, 'LT_CMD_MAX_LEN' => 1, 'm4_pattern_forbid' => 1, '_LT_LINKER_OPTION' => 1, 'AC_LIBTOOL_COMPILER_OPTION' => 1, 'AC_DISABLE_SHARED' => 1, '_LT_COMPILER_BOILERPLATE' => 1, 'AC_LIBTOOL_WIN32_DLL' => 1, 'AC_LIBTOOL_SETUP' => 1, 'AC_PROG_LD_RELOAD_FLAG' => 1, 'AM_MISSING_HAS_RUN' => 1, 'LT_LANG' => 1, 'LT_OUTPUT' => 1, 'AC_LIBTOOL_DLOPEN_SELF' => 1, 'AC_LIBTOOL_PROG_LD_SHLIBS' => 1, 'AC_VMW_CHECK_X11_LIB' => 1, 'AC_LIBTOOL_LINKER_OPTION' => 1, 'LT_AC_PROG_RC' => 1, 'AC_LIBTOOL_CXX' => 1, 'LT_INIT' => 1, 'LT_SYS_DLOPEN_SELF' => 1, 'LT_AC_PROG_GCJ' => 1, '_LT_AC_PROG_CXXCPP' => 1, 'AM_DEP_TRACK' => 1, 'AM_DISABLE_STATIC' => 1, '_AC_PROG_LIBTOOL' => 1, '_AM_IF_OPTION' => 1, 'AC_PATH_TOOL_PREFIX' => 1, 'm4_pattern_allow' => 1, 'AC_LIBTOOL_F77' => 1, 'AM_SET_LEADING_DOT' => 1, '_LT_PROG_FC' => 1, 'LT_AC_PROG_EGREP' => 1, '_AM_DEPENDENCIES' => 1, 'AC_LIBTOOL_LANG_C_CONFIG' => 1, 'LTOPTIONS_VERSION' => 1, '_LT_AC_SYS_COMPILER' => 1, 'AM_PROG_NM' => 1, 'AC_DEPLIBS_CHECK_METHOD' => 1, 'AM_SET_CURRENT_AUTOMAKE_VERSION' => 1, 'AC_LTDL_ENABLE_INSTALL' => 1, 'AC_LIBTOOL_SYS_DYNAMIC_LINKER' => 1, 'LT_PROG_GCJ' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_DISABLE_STATIC' => 1, 'LT_PATH_NM' => 1, '_LT_AC_LOCK' => 1, '_LT_AC_LANG_RC_CONFIG' => 1, 'LT_PROG_GO' => 1, 'AC_LIBTOOL_POSTDEP_PREDEP' => 1, 'AM_AUX_DIR_EXPAND' => 1, 'AC_LIBTOOL_PROG_COMPILER_NO_RTTI' => 1, '_LT_AC_LANG_F77_CONFIG' => 1, '_AM_SET_OPTIONS' => 1, '_LT_COMPILER_OPTION' => 1, 'AM_RUN_LOG' => 1, '_AM_OUTPUT_DEPENDENCY_COMMANDS' => 1, 'AC_VMW_DEFAULT_FLAGS' => 1, 'AC_LIBTOOL_SYS_OLD_ARCHIVE' => 1, 'AC_LIBTOOL_PICMODE' => 1, 'LT_PATH_LD' => 1, 'AC_CHECK_LIBM' => 1, 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, '_AM_MANGLE_OPTION' => 1, 'AC_LIBTOOL_SYS_MAX_CMD_LEN' => 1, 'AM_SET_DEPDIR' => 1, '_LT_CC_BASENAME' => 1 } ], 'Autom4te::Request' ), bless( [ '1', 1, [ '/usr/local/share/autoconf' ], [ '/usr/local/share/autoconf/autoconf/autoconf.m4f', 'aclocal.m4', 'configure.ac' ], { 'AM_PROG_F77_C_O' => 1, '_LT_AC_TAGCONFIG' => 1, 'AC_INIT' => 1, 'm4_pattern_forbid' => 1, 'AC_CANONICAL_TARGET' => 1, 'AC_CONFIG_LIBOBJ_DIR' => 1, 'AC_SUBST' => 1, 'AC_CANONICAL_HOST' => 1, 'AC_FC_SRCEXT' => 1, 'AC_PROG_LIBTOOL' => 1, 'AM_INIT_AUTOMAKE' => 1, 'AC_CONFIG_SUBDIRS' => 1, 'AM_AUTOMAKE_VERSION' => 1, 'LT_CONFIG_LTDL_DIR' => 1, 'AC_REQUIRE_AUX_FILE' => 1, 'AC_CONFIG_LINKS' => 1, 'LT_SUPPORTED_TAG' => 1, 'm4_sinclude' => 1, 'AM_MAINTAINER_MODE' => 1, 'AM_GNU_GETTEXT_INTL_SUBDIR' => 1, '_m4_warn' => 1, 'AM_PROG_CXX_C_O' => 1, 'AM_ENABLE_MULTILIB' => 1, 'AC_CONFIG_FILES' => 1, 'LT_INIT' => 1, 'include' => 1, 'AM_GNU_GETTEXT' => 1, 'AC_LIBSOURCE' => 1, 'AM_PROG_FC_C_O' => 1, 'AC_CANONICAL_BUILD' => 1, 'AC_FC_FREEFORM' => 1, 'AH_OUTPUT' => 1, 'AC_CONFIG_AUX_DIR' => 1, '_AM_SUBST_NOTMAKE' => 1, 'AM_PROG_CC_C_O' => 1, 'm4_pattern_allow' => 1, 'sinclude' => 1, 'AM_CONDITIONAL' => 1, 'AC_CANONICAL_SYSTEM' => 1, 'AC_CONFIG_HEADERS' => 1, 'AC_DEFINE_TRACE_LITERAL' => 1, 'm4_include' => 1, 'AC_SUBST_TRACE' => 1 } ], 'Autom4te::Request' ) ); open-vm-tools-10.0.7-3227872/autom4te.cache/output.10000644000000000000000000421035112660700531020104 0ustar rootroot@%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 10.0.7. @%:@ @%:@ Report bugs to . @%:@ @%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @%:@ 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ( test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } ( test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" SHELL=${CONFIG_SHELL-/bin/sh} exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIB@&t@OBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' PACKAGE_VERSION='10.0.7' PACKAGE_STRING='open-vm-tools 10.0.7' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef 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 datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar 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 CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE SED LN_S LIBTOOL GREP EGREP FGREP LD DUMPBIN ac_ct_DUMPBIN NM OBJDUMP DLLTOOL AR ac_ct_AR RANLIB MANIFEST_TOOL DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 CXXCPP HAVE_PKG_CONFIG XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS ac_vmw_lib_cfg MSPACK_CPPFLAGS MSPACK_LIBS GLIB2_CPPFLAGS GLIB2_LIBS GMODULE_CPPFLAGS GMODULE_LIBS GOBJECT_CPPFLAGS GOBJECT_LIBS GTHREAD_CPPFLAGS GTHREAD_LIBS have_genmarshal FUSE_CPPFLAGS FUSE_LIBS PAM_CPPFLAGS PAM_LIBS SSL_CPPFLAGS SSL_LIBS XERCES_CPPFLAGS XERCES_LIBS XMLSECURITY_CPPFLAGS XMLSECURITY_LIBS CUNIT_CPPFLAGS CUNIT_LIBS GTK_CPPFLAGS GTK_LIBS GTKMM_CPPFLAGS GTKMM_LIBS PROCPS_CPPFLAGS PROCPS_LIBS DNET_CPPFLAGS DNET_LIBS have_cxx ICU_CPPFLAGS ICU_LIBS RPCGEN have_doxygen DOT HAVE_DOT MSCGEN MSCGEN_DIR BUILD_HGFSMOUNTER_TRUE BUILD_HGFSMOUNTER_FALSE LINUX_TRUE LINUX_FALSE SOLARIS_TRUE SOLARIS_FALSE FREEBSD_TRUE FREEBSD_FALSE FREEBSD_CUSTOM_SYSDIR_TRUE FREEBSD_CUSTOM_SYSDIR_FALSE THIRTY_TWO_BIT_USERSPACE_TRUE THIRTY_TWO_BIT_USERSPACE_FALSE HAVE_X11_TRUE HAVE_X11_FALSE HAVE_ICU_TRUE HAVE_ICU_FALSE WITH_KERNEL_MODULES_TRUE WITH_KERNEL_MODULES_FALSE HAVE_XSM_TRUE HAVE_XSM_FALSE HAVE_XCOMPOSITE_TRUE HAVE_XCOMPOSITE_FALSE ENABLE_TESTS_TRUE ENABLE_TESTS_FALSE WITH_ROOT_PRIVILEGES_TRUE WITH_ROOT_PRIVILEGES_FALSE HAVE_DNET_TRUE HAVE_DNET_FALSE HAVE_DOXYGEN_TRUE HAVE_DOXYGEN_FALSE HAVE_FUSE_TRUE HAVE_FUSE_FALSE HAVE_GNU_LD_TRUE HAVE_GNU_LD_FALSE HAVE_GTKMM_TRUE HAVE_GTKMM_FALSE HAVE_PAM_TRUE HAVE_PAM_FALSE USE_SLASH_PROC_TRUE USE_SLASH_PROC_FALSE USE_PRINTF_WRAPPERS_TRUE USE_PRINTF_WRAPPERS_FALSE ENABLE_DEPLOYPKG_TRUE ENABLE_DEPLOYPKG_FALSE ENABLE_GRABBITMQPROXY_TRUE ENABLE_GRABBITMQPROXY_FALSE ENABLE_VGAUTH_TRUE ENABLE_VGAUTH_FALSE HAVE_VSOCK_TRUE HAVE_VSOCK_FALSE HGFS_LIBS TOOLS_VERSION TARGET_OS KERNEL_RELEASE LINUXINCLUDE MODULES_OS MODULES_DIR MODULES COMMON_XLIBS XSM_LIBS XCOMPOSITE_LIBS PAM_PREFIX PLUGIN_CPPFLAGS PLUGIN_LDFLAGS VMTOOLS_CPPFLAGS VMTOOLS_LIBS RPCGENFLAGS XDR_LIBS TEST_PLUGIN_INSTALLDIR COMMON_PLUGIN_INSTALLDIR VMSVC_PLUGIN_INSTALLDIR VMUSR_PLUGIN_INSTALLDIR SYSDIR INSTVMSG RPCGEN_WRAPPER LIB_AUTH_CPPFLAGS LIB_IMPERSONATE_CPPFLAGS LIB_USER_CPPFLAGS LIBVMTOOLS_LIBADD VIX_LIBADD VGAUTH_LIBADD LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP XMKMF' # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$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 ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -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'` 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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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'` 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; }; } 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 directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 open-vm-tools 10.0.7 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root @<:@DATAROOTDIR/doc/open-vm-tools@:>@ --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _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 X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of open-vm-tools 10.0.7:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-multimon disables multimon, enabled by default --disable-docs disables generation of API documentation; by default, docs are built if doxygen is available. --disable-tests disable compilation of test code. --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) --disable-deploypkg do not build deploypkg plugin. --disable-grabbitmqproxy do not build grabbitmqproxy plugin. --disable-vgauth do not build vgauth. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-root-privileges does not perform any operations that require root privileges --without-kernel-modules does not compile or install the kernel modules --with-kernel-release specifies the kernel release you want to build against --with-linuxdir specifies the Linux directory you want to use --without-gtk2 compiles without Gtk 2.0 --without-gtkmm compiles without Gtkmm, sigc++, and related libs --with-pic@<:@=PKGS@:>@ try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-x use the X Window System --without-pam compiles without PAM support. --without-ssl compiles without openssl support (disables grabbitmqproxy and vgauth). --without-xmlsecurity compiles without xml-security-c support (disables vgauth). --without-xerces compiles without xerces support (disables vgauth). --with-pam-prefix specifies where pam files go. Default is $(sysconfdir) --without-procps compiles without libproc (disables support for meminfo) --without-dnet compiles without libdnet (disables support for nicinfo) --without-icu disables support for ICU 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective 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 XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF open-vm-tools configure 10.0.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by open-vm-tools $as_me 10.0.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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 IFS=$as_save_IFS } >&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_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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 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, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------------- @%:@@%:@ @%:@@%:@ File substitutions. @%:@@%:@ @%:@@%:@ ------------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file 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 $ac_precious_vars; 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 # In order to make this configure script auto-detect situations where # people have a 32-bit userland running with a 64-bit kernel, we try to ask # the compiler (assumedly gcc) for its default Target:. # We have to set up $TEST_CC manually, since AC_PROG_CC hasn't yet been run (and can't be until AC_CANONICAL_HOST & AC_CANONICAL_BUILD are run) # The purpose of all this is to set up $host_alias/$build_alias in a more # intelligent way than config.guess currently does. TEST_CC="$CC_FOR_BUILD" test -z "$TEST_CC" && TEST_CC="$HOST_CC" test -z "$TEST_CC" && TEST_CC="$CC" if test -n "$TEST_CC" -a -z "$host_alias"; then host_alias="`$TEST_CC -dumpmachine`" if test -z "$build_alias" -a -n "$host_alias"; then build_alias="$host_alias" fi fi unset TEST_CC # checkvm/checkvm.c has no special significance - we just need to pass in a file that # helps autoconf verify that it really has found the source tree. # Keep the top-level directory tidy by putting auxiliary build tools and local # macros in separate subdirectories. 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 # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { 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 if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac # Quote the regular expressions case "$host_cpu" in i[3456]86) userSpaceBitness="32" ;; x86_64) userSpaceBitness="64" ;; *) { { echo "$as_me:$LINENO: error: Unknown architecture." >&5 echo "$as_me: error: Unknown architecture." >&2;} { (exit 1); exit 1; }; } ;; esac # Operational arguments. # Check whether --with-root-privileges was given. if test "${with_root_privileges+set}" = set; then withval=$with_root_privileges; else with_root_privileges=yes fi # Kernel arguments. # The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible # to getOsVersion() # Check whether --with-kernel-modules was given. if test "${with_kernel_modules+set}" = set; then withval=$with_kernel_modules; else with_kernel_modules=yes fi # Check whether --with-kernel-release was given. if test "${with_kernel_release+set}" = set; then withval=$with_kernel_release; KERNEL_RELEASE="$withval" else KERNEL_RELEASE=`uname -r` fi # Check whether --with-linuxdir was given. if test "${with_linuxdir+set}" = set; then withval=$with_linuxdir; LINUXDIR="$withval" else LINUXDIR=/lib/modules/$KERNEL_RELEASE fi # Turn the uname output into something we can run comparisons on. getOsVersion() { major_version="`echo $KERNEL_RELEASE | cut -f1 -d. | cut -f1 -d-`" minor_version="`echo $KERNEL_RELEASE | cut -f2 -d. | cut -f1 -d-`" micro_version="`echo $KERNEL_RELEASE | cut -f3 -d. | cut -f1 -d-`" printf '%02d%02d%03d' $major_version $minor_version $micro_version } case "$host_os" in linux*) os="linux" ;; freebsd*) os="freebsd" ;; kfreebsd*-gnu) os="kfreebsd-gnu" ;; solaris*) os="solaris" ;; *) { echo "$as_me:$LINENO: WARNING: This is an untested and unsupported Operating System. Proceed at your own peril." >&5 echo "$as_me: WARNING: This is an untested and unsupported Operating System. Proceed at your own peril." >&2;} ;; esac osVersion="`getOsVersion`" if test "$with_kernel_modules" = "yes"; then case "$os" in linux) if test "$osVersion" -lt 206009; then { { echo "$as_me:$LINENO: error: Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers." >&5 echo "$as_me: error: Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers." >&2;} { (exit 1); exit 1; }; } fi if test ! -d "$LINUXDIR/kernel/"; then { { echo "$as_me:$LINENO: error: $LINUXDIR/kernel does not exist" >&5 echo "$as_me: error: $LINUXDIR/kernel does not exist" >&2;} { (exit 1); exit 1; }; } fi LINUXINCLUDE="$LINUXDIR/build/include" if test ! -d "$LINUXINCLUDE"; then { { echo "$as_me:$LINENO: error: Can't find include dir under $LINUXDIR" >&5 echo "$as_me: error: Can't find include dir under $LINUXDIR" >&2;} { (exit 1); exit 1; }; } fi ;; freebsd) freebsd_sysdir=/usr/src/sys if test -n "$SYSDIR"; then freebsd_sysdir="$SYSDIR" fi if test ! -f "$freebsd_sysdir/conf/kmod.mk"; then { { echo "$as_me:$LINENO: error: FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules." >&5 echo "$as_me: error: FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules." >&2;} { (exit 1); exit 1; }; } fi ;; esac fi # Arguments for disabling individual open-vm-tools features or libraries. # Check whether --enable-multimon was given. if test "${enable_multimon+set}" = set; then enableval=$enable_multimon; enable_multimon="$enableval" else enable_multimon="yes" fi # Check whether --with-gtk2 was given. if test "${with_gtk2+set}" = set; then withval=$with_gtk2; with_gtk2="$withval" else with_gtk2="yes" fi # Check whether --with-gtkmm was given. if test "${with_gtkmm+set}" = set; then withval=$with_gtkmm; with_gtkmm="$withval" else with_gtkmm="yes" fi # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then enableval=$enable_docs; enable_docs="$enableval" else enable_docs="yes" fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then enableval=$enable_tests; enable_tests="$enableval" else enable_tests="auto" fi am__api_version='1.10' # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 -f 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 { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if 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 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='open-vm-tools' VERSION='10.0.7' 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-"\$(SHELL) $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(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 -' ### ### Constants ### # These need to be declared after initialization. # Some of our macro call-sites require changes to # CPPFLAGS/CFLAGS/LDFLAGS. In such places, we save the original value # of CPPFLAGS/CFLAGS/LDFLAGS before the macro call and restore it when # the call is done. We must perform this save at each macro site, # because CPPFLAGS/CFLAGS/LDFLAGS may change over the course of # configuration. # # CPPFLAGS is intended for preprocessor options (-D and -I mainly) # CFLAGS is intended for compiler options (-O, -f, -W, and so forth) CPPFLAGS="$CPPFLAGS -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS" ### ### Programs ### # C preprocessor and compiler. 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 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then 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 # Check that 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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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_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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 # C++ compiler. Note that unlike AC_PROG_CC, this call does not trigger an # error if no C++ compiler was found; it'll just set the variable CXX to 'g++'. ac_ext=cpp 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 -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag 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 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 # This allows features like per-target compiler flags. I.e., you can compile # one copy of the same sources twice with different flags. (See lib/guestApp # for an example.) if test "x$CC" != xcc; then { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_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. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { 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; } cat >>confdefs.h <<\_ACEOF @%:@define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # Needed for the various install and uninstall hooks. # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 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 "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { 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 for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } # Needed for creating the archives in lib/ and the shared libraries. case `pwd` in *\ * | *\ *) { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. 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 delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { echo "$as_me:$LINENO: checking how to print strings" >&5 echo $ECHO_N "checking how to print strings... $ECHO_C" >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { echo "$as_me:$LINENO: result: printf" >&5 echo "${ECHO_T}printf" >&6; } ;; print*) { echo "$as_me:$LINENO: result: print -r" >&5 echo "${ECHO_T}print -r" >&6; } ;; *) { echo "$as_me:$LINENO: result: cat" >&5 echo "${ECHO_T}cat" >&6; } ;; esac { 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 "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_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_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for fgrep" >&5 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else # Extract the first word of "fgrep" to use in msg output if test -z "$FGREP"; then set dummy fgrep; ac_prog_name=$2 if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS fi FGREP="$ac_cv_path_FGREP" if test -z "$FGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-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 BSD- or MS-compatible name lister (nm)" >&5 echo $ECHO_N "checking for BSD- or MS-compatible name lister (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 : ${lt_cv_path_NM=no} fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 echo "${ECHO_T}$DUMPBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } if test "${lt_cv_nm_interface+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 echo "${ECHO_T}$lt_cv_nm_interface" >&6; } # 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* | cegcc*) # 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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` fi ;; 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 max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { echo "$as_me:$LINENO: result: $xsi_shell" >&5 echo "${ECHO_T}$xsi_shell" >&6; } { echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { echo "$as_me:$LINENO: result: $lt_shell_append" >&5 echo "${ECHO_T}$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { echo "$as_me:$LINENO: checking how to convert $build file names to $host format" >&5 echo $ECHO_N "checking how to convert $build file names to $host format... $ECHO_C" >&6; } if test "${lt_cv_to_host_file_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { echo "$as_me:$LINENO: result: $lt_cv_to_host_file_cmd" >&5 echo "${ECHO_T}$lt_cv_to_host_file_cmd" >&6; } { echo "$as_me:$LINENO: checking how to convert $build file names to toolchain format" >&5 echo $ECHO_N "checking how to convert $build file names to toolchain format... $ECHO_C" >&6; } if test "${lt_cv_to_tool_file_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { echo "$as_me:$LINENO: result: $lt_cv_to_tool_file_cmd" >&5 echo "${ECHO_T}$lt_cv_to_tool_file_cmd" >&6; } { 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 cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 echo "${ECHO_T}$OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize 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 aix[4-9]*) 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', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | 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 ;; haiku*) 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])(-bit)?( [LM]SB)? 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 ;; interix[3-9]*) # 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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=pass_all ;; 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 ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 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 ;; tpf*) 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_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 echo "${ECHO_T}$DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { echo "$as_me:$LINENO: checking how to associate runtime and link libraries" >&5 echo $ECHO_N "checking how to associate runtime and link libraries... $ECHO_C" >&6; } if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 echo "${ECHO_T}$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { echo "$as_me:$LINENO: checking for archiver @FILE support" >&5 echo $ECHO_N "checking for archiver @FILE support... $ECHO_C" >&6; } if test "${lt_cv_ar_at_file+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ar_at_file=no 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { (eval echo "$as_me:$LINENO: \"$lt_ar_try\"") >&5 (eval $lt_ar_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { (eval echo "$as_me:$LINENO: \"$lt_ar_try\"") >&5 (eval $lt_ar_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $lt_cv_ar_at_file" >&5 echo "${ECHO_T}$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' 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 \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 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]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # 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 # Try without a prefix underscore, 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. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF 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 # 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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 -rf 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { echo "$as_me:$LINENO: checking for sysroot" >&5 echo $ECHO_N "checking for sysroot... $ECHO_C" >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { echo "$as_me:$LINENO: result: ${with_sysroot}" >&5 echo "${ECHO_T}${with_sysroot}" >&6; } { { echo "$as_me:$LINENO: error: The sysroot must be an absolute path." >&5 echo "$as_me: error: The sysroot must be an absolute path." >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: result: ${lt_sysroot:-no}" >&5 echo "${ECHO_T}${lt_sysroot:-no}" >&6; } # Check whether --enable-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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 ;; *-*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*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { echo "$as_me:$LINENO: result: $MANIFEST_TOOL" >&5 echo "${ECHO_T}$MANIFEST_TOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_MANIFEST_TOOL" >&5 echo "${ECHO_T}$ac_ct_MANIFEST_TOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { echo "$as_me:$LINENO: checking if $MANIFEST_TOOL is a manifest tool" >&5 echo $ECHO_N "checking if $MANIFEST_TOOL is a manifest tool... $ECHO_C" >&6; } if test "${lt_cv_path_mainfest_tool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_path_mainfest_tool" >&5 echo "${ECHO_T}$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 echo "${ECHO_T}$DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { echo "$as_me:$LINENO: result: $NMEDIT" >&5 echo "${ECHO_T}$NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { echo "$as_me:$LINENO: result: $LIPO" >&5 echo "${ECHO_T}$LIPO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 echo "${ECHO_T}$ac_ct_LIPO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { echo "$as_me:$LINENO: result: $OTOOL" >&5 echo "${ECHO_T}$OTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 echo "${ECHO_T}$ac_ct_OTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { echo "$as_me:$LINENO: result: $OTOOL64" >&5 echo "${ECHO_T}$OTOOL64" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 echo "${ECHO_T}$ac_ct_OTOOL64" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_ld_exported_symbols_list=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } { echo "$as_me:$LINENO: checking for -force_load linker flag" >&5 echo $ECHO_N "checking for -force_load linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_force_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { echo "$as_me:$LINENO: result: $lt_cv_ld_force_load" >&5 echo "${ECHO_T}$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac { 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-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 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 --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-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 # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST 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 cat >>confdefs.h <<_ACEOF @%:@define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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 # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file 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 <<_LT_EOF 1>&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 _LT_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 <<_LT_EOF 1>&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 _LT_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 # Use C for the default configuration in the libtool script 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;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # 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 the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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 echo "$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 -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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= 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # 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 ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; 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 ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) 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 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@&t@ -DPIC" ;; esac { 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 "${lt_cv_prog_compiler_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # 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_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works=yes fi fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_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 # # 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_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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; } { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # 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_|_GLOBAL__F[ID]_.*' # 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. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = 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>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [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 aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; 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* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' 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 ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 <<_LT_EOF 1>&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. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 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 ;; 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ;; aix[4-9]*) 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 # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) 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_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' 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 : 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 link_all_deplibs=no 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 export_dynamic_flag_spec='${wl}-bexpall' # 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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath_+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ 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 func_echo_all "${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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath_+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ 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' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper 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 `func_echo_all "$deplibs" | $SED '\''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' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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* | dragonfly*) archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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 && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${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 hardcode_direct_absolute=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 && test "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${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' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { echo "$as_me:$LINENO: checking if $CC understands -b" >&5 echo $ECHO_N "checking if $CC understands -b... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler__b+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5 echo "${ECHO_T}$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${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 ;; 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_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { echo "$as_me:$LINENO: checking whether the $host_os linker accepts -exported_symbol" >&5 echo $ECHO_N "checking whether the $host_os linker accepts -exported_symbol... $ECHO_C" >&6; } if test "${lt_cv_irix_exported_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_irix_exported_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_irix_exported_symbol" >&5 echo "${ECHO_T}$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) 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 ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes 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 else ld_shlibs=no 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) 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' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac 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 and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; 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* | sco3.2v5.0.[024]*) 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='${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,$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 ;; 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 if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # 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; } if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $RM conftest* echo "$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 lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi 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" 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 # correct to gnu/linux during the next big refactor 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' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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}${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`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then lt_cv_shlibpath_overrides_runpath=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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-existent 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_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 || test "$inherit_rpath" = yes; 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 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* | cegcc*) 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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="-ldld" 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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="-ldld" 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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_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 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" old_striplib="$STRIP -S" { 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 # 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 ;; aix[4-9]*) 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; } 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" 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=cpp 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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=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 else _lt_caught_CXX_error=yes fi ac_ext=cpp 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= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # 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 echo "$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 echo "$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 -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS 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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when 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 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 $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -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 -v "^Configured with:" | $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 ;; aix[4-9]*) 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].*|aix[5-9]*) 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_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' 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 : 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 export_dynamic_flag_spec_CXX='${wl}-bexpall' # 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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath__CXX+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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 func_echo_all "${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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath__CXX+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi 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* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' 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 ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then 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${_lt_dsymutil}" archive_expsym_cmds_CXX="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no 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 ;; freebsd2.*) # 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* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; 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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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*) ;; *) 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_direct_absolute_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; func_echo_all "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${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 ;; interix[3-9]*) 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" && func_echo_all "-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 $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) 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; func_echo_all "$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* | ecpc* ) # 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* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols 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' ;; esac 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; func_echo_all \"$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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 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='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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' ;; esac ;; 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::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes 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=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | 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. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) 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" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) 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" && func_echo_all "-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' ;; esac 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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac 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 -v "^Configured with:" | $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* | sunCC*) # 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 compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # 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 $pic_flag -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 $pic_flag -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 -v "^Configured with:" | $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 -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac 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. 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='${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,$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' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) 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 ;; 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" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # 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= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac 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 # 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 for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${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 fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # 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= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # 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. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries 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= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # 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 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # 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_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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' ;; 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* | 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* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # 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' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; 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* | sunCC*) # 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 ;; 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 ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac 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@&t@ -DPIC" ;; esac { 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 "${lt_cv_prog_compiler_pic_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # 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_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX@&t@ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works_CXX=yes fi fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_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 # # 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_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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; } { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # 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 # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". 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") || (\$ 2 == "W")) && (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* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) 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 with_gnu_ld_CXX=$with_gnu_ld # # 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; } if test "${lt_cv_archive_cmds_need_lc_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $RM conftest* echo "$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 lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_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* fi { echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; 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" 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 # correct to gnu/linux during the next big refactor 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' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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}${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`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then lt_cv_shlibpath_overrides_runpath=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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-existent 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_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 || test "$inherit_rpath_CXX" = yes; 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 fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test "$_lt_caught_CXX_error" != 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 ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "$ac_cv_prog_AR" = false; then { { echo "$as_me:$LINENO: error: The 'ar' utility was not found. Please put ar on the path." >&5 echo "$as_me: error: The 'ar' utility was not found. Please put ar on the path." >&2;} { (exit 1); exit 1; }; } fi # We use pkg-config to set up the cflags and libs for gtk. # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; 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_HAVE_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$HAVE_PKG_CONFIG"; then ac_cv_prog_HAVE_PKG_CONFIG="$HAVE_PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_HAVE_PKG_CONFIG="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_PKG_CONFIG" && ac_cv_prog_HAVE_PKG_CONFIG="no" fi fi HAVE_PKG_CONFIG=$ac_cv_prog_HAVE_PKG_CONFIG if test -n "$HAVE_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $HAVE_PKG_CONFIG" >&5 echo "${ECHO_T}$HAVE_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$GCC" != "yes"; then { { echo "$as_me:$LINENO: error: Only GCC is currently supported. Please put gcc in the path." >&5 echo "$as_me: error: Only GCC is currently supported. Please put gcc in the path." >&2;} { (exit 1); exit 1; }; } fi ### ### Libraries ### { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" 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 () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF @%:@define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi # # Check for libintl.h. When configuring using "--without-x", /usr/local/include # may not be added to the include path, so code that use glib's i18n functions # would fail to compile because it can't find libintl.h. # if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 libintl.h presence" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then : else have_libintl=no fi if test "$have_libintl" = "no"; then unset ac_cv_header_libintl_h CPPFLAGS="$CPPFLAGS -I/usr/local/include" if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 libintl.h presence" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then : else { { echo "$as_me:$LINENO: error: libintl.h not found. Make sure you have the gettext headers installed." >&5 echo "$as_me: error: libintl.h not found. Make sure you have the gettext headers installed." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-deploypkg was given. if test "${enable_deploypkg+set}" = set; then enableval=$enable_deploypkg; else enable_deploypkg=yes fi if test "$enable_deploypkg" = "yes"; then if test -z "mspack"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "MSPACK"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_MSPACK_CPPFLAGS}" || test -n "${CUSTOM_MSPACK_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_MSPACK_LIBS} -lmspack" if test -n "mspack.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_MSPACK_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_mspack_h+set}" = set; then { echo "$as_me:$LINENO: checking for mspack.h" >&5 echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 echo "${ECHO_T}$ac_cv_header_mspack_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking mspack.h usability" >&5 echo $ECHO_N "checking mspack.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 mspack.h presence" >&5 echo $ECHO_N "checking mspack.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: mspack.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: mspack.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: mspack.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: mspack.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: mspack.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: mspack.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for mspack.h" >&5 echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_mspack_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 echo "${ECHO_T}$ac_cv_header_mspack_h" >&6; } fi if test $ac_cv_header_mspack_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_mspack_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lmspack" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lmspack... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmspack $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then MSPACK_CPPFLAGS="${CUSTOM_MSPACK_CPPFLAGS}" MSPACK_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "libmspack"; then if test -n "0.0.20040308alpha"; then { echo "$as_me:$LINENO: checking for libmspack >= 0.0.20040308alpha (via pkg-config)" >&5 echo $ECHO_N "checking for libmspack >= 0.0.20040308alpha (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libmspack >= 0.0.20040308alpha'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for libmspack (via pkg-config)" >&5 echo $ECHO_N "checking for libmspack (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libmspack'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags libmspack`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs libmspack`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } MSPACK_CPPFLAGS="$ac_vmw_cppflags" MSPACK_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then MSPACK_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" MSPACK_LIBS="`$ac_vmw_lib_cfg --ldflags`" else MSPACK_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" MSPACK_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: mspack >= 0.0.20040308alpha is required." >&5 echo "$as_me: error: mspack >= 0.0.20040308alpha is required." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-grabbitmqproxy was given. if test "${enable_grabbitmqproxy+set}" = set; then enableval=$enable_grabbitmqproxy; else enable_grabbitmqproxy=yes fi # # Check for glib 2.6.14 or greater. # if test -z "glib-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GLIB2"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GLIB2_CPPFLAGS}" || test -n "${CUSTOM_GLIB2_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GLIB2_LIBS} -lglib-2.0" if test -n "glib.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GLIB2_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_glib_h+set}" = set; then { echo "$as_me:$LINENO: checking for glib.h" >&5 echo $ECHO_N "checking for glib.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking glib.h usability" >&5 echo $ECHO_N "checking glib.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 glib.h presence" >&5 echo $ECHO_N "checking glib.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: glib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: glib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: glib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: glib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: glib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: glib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: glib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: glib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: glib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: glib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for glib.h" >&5 echo $ECHO_N "checking for glib.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_glib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_h" >&6; } fi if test $ac_cv_header_glib_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "g_key_file_new"; then ac_vmw_function=g_key_file_new else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_glib-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lglib-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lglib-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lglib-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GLIB2_CPPFLAGS="${CUSTOM_GLIB2_CPPFLAGS}" GLIB2_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "glib-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for glib-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for glib-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'glib-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for glib-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for glib-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'glib-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags glib-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs glib-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GLIB2_CPPFLAGS="$ac_vmw_cppflags" GLIB2_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GLIB2_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GLIB2_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GLIB2_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GLIB2_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: glib2 >= 2.14.0 is required." >&5 echo "$as_me: error: glib2 >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gmodule-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GMODULE"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GMODULE_CPPFLAGS}" || test -n "${CUSTOM_GMODULE_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GMODULE_LIBS} -lgmodule-2.0" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GMODULE_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gmodule-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgmodule-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgmodule-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgmodule-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GMODULE_CPPFLAGS="${CUSTOM_GMODULE_CPPFLAGS}" GMODULE_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gmodule-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gmodule-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gmodule-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gmodule-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gmodule-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gmodule-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gmodule-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gmodule-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gmodule-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GMODULE_CPPFLAGS="$ac_vmw_cppflags" GMODULE_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GMODULE_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GMODULE_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GMODULE_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GMODULE_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: gmodule >= 2.14.0 is required." >&5 echo "$as_me: error: gmodule >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gobject-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GOBJECT"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GOBJECT_CPPFLAGS}" || test -n "${CUSTOM_GOBJECT_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GOBJECT_LIBS} -lgobject-2.0" if test -n "glib-object.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GOBJECT_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_glib_object_h+set}" = set; then { echo "$as_me:$LINENO: checking for glib-object.h" >&5 echo $ECHO_N "checking for glib-object.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_object_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_object_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_object_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking glib-object.h usability" >&5 echo $ECHO_N "checking glib-object.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 glib-object.h presence" >&5 echo $ECHO_N "checking glib-object.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: glib-object.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: glib-object.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: glib-object.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: glib-object.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: glib-object.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: glib-object.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: glib-object.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: glib-object.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: glib-object.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: glib-object.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for glib-object.h" >&5 echo $ECHO_N "checking for glib-object.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_object_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_glib_object_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_object_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_object_h" >&6; } fi if test $ac_cv_header_glib_object_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gobject-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgobject-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgobject-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgobject-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GOBJECT_CPPFLAGS="${CUSTOM_GOBJECT_CPPFLAGS}" GOBJECT_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gobject-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gobject-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gobject-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gobject-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gobject-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gobject-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gobject-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gobject-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gobject-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GOBJECT_CPPFLAGS="$ac_vmw_cppflags" GOBJECT_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GOBJECT_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GOBJECT_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GOBJECT_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GOBJECT_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: gobject >= 2.14.0 is required." >&5 echo "$as_me: error: gobject >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gthread-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTHREAD"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTHREAD_CPPFLAGS}" || test -n "${CUSTOM_GTHREAD_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTHREAD_LIBS} -lgthread-2.0" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTHREAD_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gthread-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgthread-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgthread-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgthread-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTHREAD_CPPFLAGS="${CUSTOM_GTHREAD_CPPFLAGS}" GTHREAD_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gthread-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gthread-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gthread-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gthread-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gthread-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gthread-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gthread-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gthread-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gthread-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTHREAD_CPPFLAGS="$ac_vmw_cppflags" GTHREAD_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTHREAD_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTHREAD_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTHREAD_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTHREAD_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: glib >= 2.14.0 is required." >&5 echo "$as_me: error: glib >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "glib-genmarshal", so it can be a program name with args. set dummy glib-genmarshal; 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_have_genmarshal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_genmarshal"; then ac_cv_prog_have_genmarshal="$have_genmarshal" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_genmarshal="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_genmarshal" && ac_cv_prog_have_genmarshal="no" fi fi have_genmarshal=$ac_cv_prog_have_genmarshal if test -n "$have_genmarshal"; then { echo "$as_me:$LINENO: result: $have_genmarshal" >&5 echo "${ECHO_T}$have_genmarshal" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$have_genmarshal" != "yes"; then { { echo "$as_me:$LINENO: error: glib-genmarshal is required; make sure it's available in your path." >&5 echo "$as_me: error: glib-genmarshal is required; make sure it's available in your path." >&2;} { (exit 1); exit 1; }; } fi # # Check for fuse. # if test -z "fuse"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "FUSE"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_FUSE_CPPFLAGS}" || test -n "${CUSTOM_FUSE_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_FUSE_LIBS} -lfuse" if test -n "fuse.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_FUSE_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_fuse_h+set}" = set; then { echo "$as_me:$LINENO: checking for fuse.h" >&5 echo $ECHO_N "checking for fuse.h... $ECHO_C" >&6; } if test "${ac_cv_header_fuse_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_fuse_h" >&5 echo "${ECHO_T}$ac_cv_header_fuse_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking fuse.h usability" >&5 echo $ECHO_N "checking fuse.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 fuse.h presence" >&5 echo $ECHO_N "checking fuse.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: fuse.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: fuse.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: fuse.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: fuse.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: fuse.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: fuse.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: fuse.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: fuse.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: fuse.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: fuse.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for fuse.h" >&5 echo $ECHO_N "checking for fuse.h... $ECHO_C" >&6; } if test "${ac_cv_header_fuse_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_fuse_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_fuse_h" >&5 echo "${ECHO_T}$ac_cv_header_fuse_h" >&6; } fi if test $ac_cv_header_fuse_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "fuse_main"; then ac_vmw_function=fuse_main else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_fuse_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lfuse" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lfuse... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then FUSE_CPPFLAGS="${CUSTOM_FUSE_CPPFLAGS}" FUSE_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "fuse"; then if test -n ""; then { echo "$as_me:$LINENO: checking for fuse >= (via pkg-config)" >&5 echo $ECHO_N "checking for fuse >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'fuse >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for fuse (via pkg-config)" >&5 echo $ECHO_N "checking for fuse (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'fuse'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags fuse`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs fuse`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } FUSE_CPPFLAGS="$ac_vmw_cppflags" FUSE_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then FUSE_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" FUSE_LIBS="`$ac_vmw_lib_cfg --ldflags`" else FUSE_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" FUSE_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_fuse=yes else true have_fuse=no; { echo "$as_me:$LINENO: WARNING: Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled." >&5 echo "$as_me: WARNING: Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled." >&2;} fi # # Check for PAM. # # Check whether --with-pam was given. if test "${with_pam+set}" = set; then withval=$with_pam; else with_pam=yes fi if test "$with_pam" = "yes"; then if test -z "$CUSTOM_PAM_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_PAM_CPPFLAGS="-I/usr/local/include" else CUSTOM_PAM_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_PAM_CPPFLAGS="${CUSTOM_PAM_CPPFLAGS}/" fi fi if test -z "pam"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PAM"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PAM_CPPFLAGS}" || test -n "${CUSTOM_PAM_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PAM_LIBS} -lpam" if test -n "security/pam_appl.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PAM_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_security_pam_appl_h+set}" = set; then { echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 echo $ECHO_N "checking security/pam_appl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 security/pam_appl.h presence" >&5 echo $ECHO_N "checking security/pam_appl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: security/pam_appl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_security_pam_appl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6; } fi if test $ac_cv_header_security_pam_appl_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "pam_start"; then ac_vmw_function=pam_start else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_pam_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lpam" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lpam... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PAM_CPPFLAGS="${CUSTOM_PAM_CPPFLAGS}" PAM_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PAM_CPPFLAGS="$ac_vmw_cppflags" PAM_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PAM_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PAM_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PAM_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PAM_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true PAM_CPPFLAGS="$PAM_CPPFLAGS -DUSE_PAM" else true feature="" if test -z "$feature"; then feature="PAM" fi { { echo "$as_me:$LINENO: error: Cannot find PAM library. Please configure without $feature (using --without-pam), or install the PAM libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find PAM library. Please configure without $feature (using --without-pam), or install the PAM libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-vgauth was given. if test "${enable_vgauth+set}" = set; then enableval=$enable_vgauth; else enable_vgauth=yes fi # # Check for openssl, xerces-c and xml-security-c # # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then withval=$with_ssl; enable_grabbitmqproxy=no enable_vgauth=no else with_ssl=yes fi # Check whether --with-xmlsecurity was given. if test "${with_xmlsecurity+set}" = set; then withval=$with_xmlsecurity; enable_vgauth=no else with_xmlsecurity=yes fi # Check whether --with-xerces was given. if test "${with_xerces+set}" = set; then withval=$with_xerces; enable_vgauth=no else with_xerces=yes fi if test "$enable_vgauth" = "yes" -o "$enable_grabbitmqproxy" = "yes"; then if test -z "$CUSTOM_SSL_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_SSL_CPPFLAGS="-I/usr/local/include" else CUSTOM_SSL_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_SSL_CPPFLAGS="${CUSTOM_SSL_CPPFLAGS}/" fi fi if test -z "ssl"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "SSL"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_SSL_CPPFLAGS}" || test -n "${CUSTOM_SSL_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_SSL_LIBS} -lssl" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_SSL_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_ssl_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lssl" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lssl... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then SSL_CPPFLAGS="${CUSTOM_SSL_CPPFLAGS}" SSL_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SSL_CPPFLAGS="$ac_vmw_cppflags" SSL_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then SSL_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" SSL_LIBS="`$ac_vmw_lib_cfg --ldflags`" else SSL_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" SSL_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="SSL" fi { { echo "$as_me:$LINENO: error: Cannot find SSL library. Please configure without $feature (using --without-ssl), or install the SSL libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find SSL library. Please configure without $feature (using --without-ssl), or install the SSL libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi if test "$enable_vgauth" = "yes"; then CPPFLAGS="$CPPFLAGS -DUSE_VGAUTH" if test -z "$CUSTOM_XERCES_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_XERCES_CPPFLAGS="-I/usr/local/include" else CUSTOM_XERCES_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_XERCES_CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS}/" fi fi if test -z "xerces-c"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "XERCES"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_XERCES_CPPFLAGS}" || test -n "${CUSTOM_XERCES_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_XERCES_LIBS} -lxerces-c" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_xerces-c_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lxerces-c" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lxerces-c... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxerces-c $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then XERCES_CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS}" XERCES_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } XERCES_CPPFLAGS="$ac_vmw_cppflags" XERCES_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then XERCES_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" XERCES_LIBS="`$ac_vmw_lib_cfg --ldflags`" else XERCES_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" XERCES_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="XERCES" fi { { echo "$as_me:$LINENO: error: Cannot find XERCES library. Please configure without $feature (using --without-xerces-c), or install the XERCES libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find XERCES library. Please configure without $feature (using --without-xerces-c), or install the XERCES libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi if test -z "$CUSTOM_XMLSECURITY_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_XMLSECURITY_CPPFLAGS="-I/usr/local/include" else CUSTOM_XMLSECURITY_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_XMLSECURITY_CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS}/" fi fi if test -z "xml-security-c"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "XMLSECURITY"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_XMLSECURITY_CPPFLAGS}" || test -n "${CUSTOM_XMLSECURITY_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_XMLSECURITY_LIBS} -lxml-security-c" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_xml-security-c_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lxml-security-c" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lxml-security-c... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxml-security-c $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then XMLSECURITY_CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS}" XMLSECURITY_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } XMLSECURITY_CPPFLAGS="$ac_vmw_cppflags" XMLSECURITY_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then XMLSECURITY_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" XMLSECURITY_LIBS="`$ac_vmw_lib_cfg --ldflags`" else XMLSECURITY_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" XMLSECURITY_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="XMLSECURITY" fi { { echo "$as_me:$LINENO: error: Cannot find XMLSECURITY library. Please configure without $feature (using --without-xml-security-c), or install the XMLSECURITY libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find XMLSECURITY library. Please configure without $feature (using --without-xml-security-c), or install the XMLSECURITY libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # # Check for CUnit and disable test code if not available. # if test "$enable_tests" = "auto" -o "$enable_tests" = "yes"; then if test -z "$CUSTOM_CUNIT_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_CUNIT_CPPFLAGS="-I/usr/local/include" else CUSTOM_CUNIT_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_CUNIT_CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS}/" fi fi if test -z "cunit"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "CUNIT"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_CUNIT_CPPFLAGS}" || test -n "${CUSTOM_CUNIT_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_CUNIT_LIBS} -lcunit" if test -n "CUnit/CUnit.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then { echo "$as_me:$LINENO: checking for CUnit/CUnit.h" >&5 echo $ECHO_N "checking for CUnit/CUnit.h... $ECHO_C" >&6; } if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_CUnit_CUnit_h" >&5 echo "${ECHO_T}$ac_cv_header_CUnit_CUnit_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking CUnit/CUnit.h usability" >&5 echo $ECHO_N "checking CUnit/CUnit.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 CUnit/CUnit.h presence" >&5 echo $ECHO_N "checking CUnit/CUnit.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: CUnit/CUnit.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for CUnit/CUnit.h" >&5 echo $ECHO_N "checking for CUnit/CUnit.h... $ECHO_C" >&6; } if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_CUnit_CUnit_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_CUnit_CUnit_h" >&5 echo "${ECHO_T}$ac_cv_header_CUnit_CUnit_h" >&6; } fi if test $ac_cv_header_CUnit_CUnit_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "CU_initialize_registry"; then ac_vmw_function=CU_initialize_registry else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_cunit_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lcunit" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lcunit... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcunit $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then CUNIT_CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS}" CUNIT_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } CUNIT_CPPFLAGS="$ac_vmw_cppflags" CUNIT_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then CUNIT_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" CUNIT_LIBS="`$ac_vmw_lib_cfg --ldflags`" else CUNIT_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" CUNIT_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_cunit=yes else true have_cunit=no fi if test "$have_cunit" = "no"; then if test "$enable_tests" = "yes"; then feature="" if test -z "$feature"; then feature="CUNIT" fi { { echo "$as_me:$LINENO: error: Cannot find CUNIT library. Please configure without $feature (using --without-cunit), or install the CUNIT libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find CUNIT library. Please configure without $feature (using --without-cunit), or install the CUNIT libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: CUnit not found, tests won't be compiled." >&5 echo "$as_me: WARNING: CUnit not found, tests won't be compiled." >&2;} fi fi fi # If the user explicitly disables X11, then don't try to detect the X-related libraries if test "$have_x" = "disabled"; then enable_multimon="no" elif test "$have_x" != "yes"; then { { echo "$as_me:$LINENO: error: The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s)." >&5 echo "$as_me: error: The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s)." >&2;} { (exit 1); exit 1; }; } else CPPFLAGS="$CPPFLAGS $X_CFLAGS" COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" { echo "$as_me:$LINENO: checking for XeviQueryVersion in -lXext" >&5 echo $ECHO_N "checking for XeviQueryVersion in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XeviQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XeviQueryVersion (); int main () { return XeviQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XeviQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XeviQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XeviQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XeviQueryVersion" >&6; } if test $ac_cv_lib_Xext_XeviQueryVersion = yes; then COMMON_XLIBS="-lXext $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s)." >&5 echo "$as_me: error: libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for X11/extensions/extutil.h" >&5 echo $ECHO_N "checking for X11/extensions/extutil.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_extensions_extutil_h+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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_X11_extensions_extutil_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_X11_extensions_extutil_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_extutil_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_extensions_extutil_h" >&6; } if test $ac_cv_header_X11_extensions_extutil_h = yes; then : else { { echo "$as_me:$LINENO: error: X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x)." >&5 echo "$as_me: error: X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x)." >&2;} { (exit 1); exit 1; }; } fi if test "$enable_multimon" != "no"; then { echo "$as_me:$LINENO: checking for XineramaQueryVersion in -lXinerama" >&5 echo $ECHO_N "checking for XineramaQueryVersion in -lXinerama... $ECHO_C" >&6; } if test "${ac_cv_lib_Xinerama_XineramaQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XineramaQueryVersion (); int main () { return XineramaQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xinerama_XineramaQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xinerama_XineramaQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryVersion" >&6; } if test $ac_cv_lib_Xinerama_XineramaQueryVersion = yes; then COMMON_XLIBS="-lXinerama $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s)." >&5 echo "$as_me: error: libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: checking for XOpenDevice in -lXi" >&5 echo $ECHO_N "checking for XOpenDevice in -lXi... $ECHO_C" >&6; } if test "${ac_cv_lib_Xi_XOpenDevice+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXi $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDevice (); int main () { return XOpenDevice (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xi_XOpenDevice=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xi_XOpenDevice=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xi_XOpenDevice" >&5 echo "${ECHO_T}$ac_cv_lib_Xi_XOpenDevice" >&6; } if test $ac_cv_lib_Xi_XOpenDevice = yes; then COMMON_XLIBS="-lXi $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s)." >&5 echo "$as_me: error: libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 echo $ECHO_N "checking for XRenderQueryVersion in -lXrender... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderQueryVersion (); int main () { return XRenderQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrender_XRenderQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrender_XRenderQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryVersion" >&6; } if test $ac_cv_lib_Xrender_XRenderQueryVersion = yes; then COMMON_XLIBS="-lXrender $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s)." >&5 echo "$as_me: error: libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XRRQueryVersion in -lXrandr" >&5 echo $ECHO_N "checking for XRRQueryVersion in -lXrandr... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrandr_XRRQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRRQueryVersion (); int main () { return XRRQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrandr_XRRQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrandr_XRRQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRQueryVersion" >&6; } if test $ac_cv_lib_Xrandr_XRRQueryVersion = yes; then COMMON_XLIBS="-lXrandr $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s)." >&5 echo "$as_me: error: libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XTestQueryExtension in -lXtst" >&5 echo $ECHO_N "checking for XTestQueryExtension in -lXtst... $ECHO_C" >&6; } if test "${ac_cv_lib_Xtst_XTestQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXtst $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XTestQueryExtension (); int main () { return XTestQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xtst_XTestQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xtst_XTestQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xtst_XTestQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xtst_XTestQueryExtension" >&6; } if test $ac_cv_lib_Xtst_XTestQueryExtension = yes; then COMMON_XLIBS="-lXtst $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s)." >&5 echo "$as_me: error: libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5 echo $ECHO_N "checking for SmcOpenConnection in -lSM... $ECHO_C" >&6; } if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSM $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SmcOpenConnection (); int main () { return SmcOpenConnection (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_SM_SmcOpenConnection=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_SM_SmcOpenConnection=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_SM_SmcOpenConnection" >&5 echo "${ECHO_T}$ac_cv_lib_SM_SmcOpenConnection" >&6; } if test $ac_cv_lib_SM_SmcOpenConnection = yes; then XSM_LIBS="-lSM -lICE" && have_xsm_lib="yes" else -lICE fi for ac_header in X11/SM/SMlib.h X11/ICE/ICElib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 have_xsm_header="yes" fi done if test "$have_xsm_lib" = "yes" -a "$have_xsm_header" = "yes"; then have_xsm="yes" fi { echo "$as_me:$LINENO: checking for XCompositeQueryExtension in -lXcomposite" >&5 echo $ECHO_N "checking for XCompositeQueryExtension in -lXcomposite... $ECHO_C" >&6; } if test "${ac_cv_lib_Xcomposite_XCompositeQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXcomposite $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XCompositeQueryExtension (); int main () { return XCompositeQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xcomposite_XCompositeQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xcomposite_XCompositeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&6; } if test $ac_cv_lib_Xcomposite_XCompositeQueryExtension = yes; then XCOMPOSITE_LIBS="-lXcomposite" else have_xcomposite="no" fi for ac_header in X11/extensions/Xcomposite.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 else have_xcomposite="no" fi done if test "$have_xcomposite" != "no"; then have_xcomposite="yes" fi # Check whether we have gtk+ 2.0. if test "$with_gtk2" != "no"; then # gdk_display_get_default_group (added in gtk+ 2.4.0) is function currently # needed by vmware-user. if test -z "gtk-x11-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTK"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTK_CPPFLAGS}" || test -n "${CUSTOM_GTK_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTK_LIBS} -lgtk-x11-2.0" if test -n "gtk/gtk.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTK_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_gtk_gtk_h+set}" = set; then { echo "$as_me:$LINENO: checking for gtk/gtk.h" >&5 echo $ECHO_N "checking for gtk/gtk.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtk_gtk_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtk_gtk_h" >&5 echo "${ECHO_T}$ac_cv_header_gtk_gtk_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gtk/gtk.h usability" >&5 echo $ECHO_N "checking gtk/gtk.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 gtk/gtk.h presence" >&5 echo $ECHO_N "checking gtk/gtk.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gtk/gtk.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gtk/gtk.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gtk/gtk.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gtk/gtk.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gtk/gtk.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gtk/gtk.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gtk/gtk.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gtk/gtk.h" >&5 echo $ECHO_N "checking for gtk/gtk.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtk_gtk_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gtk_gtk_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtk_gtk_h" >&5 echo "${ECHO_T}$ac_cv_header_gtk_gtk_h" >&6; } fi if test $ac_cv_header_gtk_gtk_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "gdk_display_get_default_group"; then ac_vmw_function=gdk_display_get_default_group else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gtk-x11-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgtk-x11-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgtk-x11-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtk-x11-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTK_CPPFLAGS="${CUSTOM_GTK_CPPFLAGS}" GTK_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gtk+-2.0"; then if test -n "2.4.0"; then { echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtk+-2.0 >= 2.4.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtk+-2.0 >= 2.4.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gtk+-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtk+-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtk+-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gtk+-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gtk+-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTK_CPPFLAGS="$ac_vmw_cppflags" GTK_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTK_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTK_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTK_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTK_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" else true { { echo "$as_me:$LINENO: error: Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package." >&5 echo "$as_me: error: Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package." >&2;} { (exit 1); exit 1; }; } fi fi # # Check for gtkmm 2.4.0 or greater. # if test "$with_gtkmm" != "no"; then CUSTOM_GTKMM_CPPFLAGS="$CUSTOM_GTKMM_CPPFLAGS $GTK_CPPFLAGS" ac_ext=cpp 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 -z "gtkmm-2.4"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTKMM"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTKMM_CPPFLAGS}" || test -n "${CUSTOM_GTKMM_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTKMM_LIBS} -lgtkmm-2.4" if test -n "gtkmm.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTKMM_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_gtkmm_h+set}" = set; then { echo "$as_me:$LINENO: checking for gtkmm.h" >&5 echo $ECHO_N "checking for gtkmm.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtkmm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtkmm_h" >&5 echo "${ECHO_T}$ac_cv_header_gtkmm_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gtkmm.h usability" >&5 echo $ECHO_N "checking gtkmm.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 gtkmm.h presence" >&5 echo $ECHO_N "checking gtkmm.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: gtkmm.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gtkmm.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gtkmm.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gtkmm.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gtkmm.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gtkmm.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gtkmm.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gtkmm.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gtkmm.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gtkmm.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gtkmm.h" >&5 echo $ECHO_N "checking for gtkmm.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtkmm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gtkmm_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtkmm_h" >&5 echo "${ECHO_T}$ac_cv_header_gtkmm_h" >&6; } fi if test $ac_cv_header_gtkmm_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gtkmm-2.4_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgtkmm-2.4" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgtkmm-2.4... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtkmm-2.4 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTKMM_CPPFLAGS="${CUSTOM_GTKMM_CPPFLAGS}" GTKMM_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gtkmm-2.4"; then if test -n "2.4.0"; then { echo "$as_me:$LINENO: checking for gtkmm-2.4 >= 2.4.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtkmm-2.4 >= 2.4.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtkmm-2.4 >= 2.4.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gtkmm-2.4 (via pkg-config)" >&5 echo $ECHO_N "checking for gtkmm-2.4 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtkmm-2.4'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gtkmm-2.4`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gtkmm-2.4`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTKMM_CPPFLAGS="$ac_vmw_cppflags" GTKMM_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTKMM_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTKMM_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTKMM_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTKMM_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM" else true { { echo "$as_me:$LINENO: error: gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm." >&5 echo "$as_me: error: gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm." >&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 fi fi # End of checks for X libraries { echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6; } if test "${ac_cv_lib_crypt_crypt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6; } if test $ac_cv_lib_crypt_crypt = yes; then HAVE_CRYPT="yes" else { { echo "$as_me:$LINENO: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&5 echo "$as_me: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&2;} { (exit 1); exit 1; }; } fi for ac_func in dlopen 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 VIX_LIBADD="$VIX_LIBADD -ldl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -ldl" VGAUTH_LIBADD="$VGAUTH_LIBADD -ldl" else { { echo "$as_me:$LINENO: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&5 echo "$as_me: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&2;} { (exit 1); exit 1; }; } fi fi done for ac_func in ecvt 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 for ac_func in fcvt 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 if test "$os" = "freebsd" -a "$osVersion" -ge 600000; then { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lthr" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lthr... $ECHO_C" >&6; } if test "${ac_cv_lib_thr_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthr $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_thr_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thr_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_thr_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_thr_pthread_mutex_init" >&6; } if test $ac_cv_lib_thr_pthread_mutex_init = yes; then THREAD_LIB=-lthr else { { echo "$as_me:$LINENO: error: Unable to locate required threading library libthr." >&5 echo "$as_me: error: Unable to locate required threading library libthr." >&2;} { (exit 1); exit 1; }; } fi else { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then THREAD_LIB=-lpthread else { { echo "$as_me:$LINENO: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&5 echo "$as_me: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # PAM prefix # Check whether --with-pam-prefix was given. if test "${with_pam_prefix+set}" = set; then withval=$with_pam_prefix; PAM_PREFIX="$withval" else PAM_PREFIX='$(sysconfdir)' fi if test "$os" = "linux"; then # Check whether --with-procps was given. if test "${with_procps+set}" = set; then withval=$with_procps; else with_procps=yes fi else with_procps="no" fi if test "$with_procps" = "yes"; then have_procps=no if test -z "$CUSTOM_PROCPS_NAME" && test -z "$CUSTOM_PROCPS_LIBS"; then # See if we have procps-ng (that finally supports pkg-config). if test -z "procps-ng"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lprocps-ng" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_procps-ng_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lprocps-ng" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lprocps-ng... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lprocps-ng $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "libprocps"; then if test -n ""; then { echo "$as_me:$LINENO: checking for libprocps >= (via pkg-config)" >&5 echo $ECHO_N "checking for libprocps >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libprocps >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for libprocps (via pkg-config)" >&5 echo $ECHO_N "checking for libprocps (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libprocps'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags libprocps`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs libprocps`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then # Let's see if there is an older procps version, one that does not # support pkg-config. if test -z "$CUSTOM_PROCPS_NAME"; then CUSTOM_PROCPS_NAME=proc fi # XXX: no pkg-config and no procps-config means we need to # hard-code a sensible default. if test -z "$CUSTOM_PROCPS_LIBS"; then CUSTOM_PROCPS_LIBS="-L/lib" fi # Some distros provide libproc-${version}.so only, others provide the # libproc.so symlink. Try both to see what sticks (but only try the 3.2.7 # and 3.2.8 versions - adding every possible version here would be a mess). # # Users can help by providing CUSTOM_PROCPS_NAME / CUSTOM_PROCPS_LIBS if # necessary. if test -z "$CUSTOM_PROCPS_NAME"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -l$CUSTOM_PROCPS_NAME" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_$CUSTOM_PROCPS_NAME''_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -l$CUSTOM_PROCPS_NAME" >&5 echo $ECHO_N "checking for $ac_vmw_function in -l$CUSTOM_PROCPS_NAME... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$CUSTOM_PROCPS_NAME $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then if test -z "proc-3.2.8"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lproc-3.2.8" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_proc-3.2.8_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lproc-3.2.8" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lproc-3.2.8... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproc-3.2.8 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then if test -z "proc-3.2.7"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lproc-3.2.7" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_proc-3.2.7_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lproc-3.2.7" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lproc-3.2.7... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproc-3.2.7 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&5 echo "$as_me: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&2;} { (exit 1); exit 1; }; } fi fi fi if test "$with_procps" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_PROCPS 1 _ACEOF fi # Check whether --with-dnet was given. if test "${with_dnet+set}" = set; then withval=$with_dnet; else with_dnet=yes fi have_dnet="no" if test "$with_dnet" = "yes"; then # On Debian, dnet is installed via the libdumbnet package. We need to # detect this so that our source files include dumbnet.h instead of # dnet.h, which is part of a different package altogether. if test -z "dumbnet"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "DNET"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_DNET_CPPFLAGS}" || test -n "${CUSTOM_DNET_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_DNET_LIBS} -ldumbnet" if test -n "dumbnet.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_DNET_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_dumbnet_h+set}" = set; then { echo "$as_me:$LINENO: checking for dumbnet.h" >&5 echo $ECHO_N "checking for dumbnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dumbnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dumbnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dumbnet_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dumbnet.h usability" >&5 echo $ECHO_N "checking dumbnet.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 dumbnet.h presence" >&5 echo $ECHO_N "checking dumbnet.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: dumbnet.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dumbnet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dumbnet.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dumbnet.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dumbnet.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dumbnet.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dumbnet.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dumbnet.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dumbnet.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dumbnet.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for dumbnet.h" >&5 echo $ECHO_N "checking for dumbnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dumbnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dumbnet_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dumbnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dumbnet_h" >&6; } fi if test $ac_cv_header_dumbnet_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "intf_open"; then ac_vmw_function=intf_open else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_dumbnet_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -ldumbnet" >&5 echo $ECHO_N "checking for $ac_vmw_function in -ldumbnet... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldumbnet $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then DNET_CPPFLAGS="${CUSTOM_DNET_CPPFLAGS}" DNET_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DNET_CPPFLAGS="$ac_vmw_cppflags" DNET_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "dumbnet-config"; then # Extract the first word of "dumbnet-config", so it can be a program name with args. set dummy dumbnet-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" DNET_LIBS="`$ac_vmw_lib_cfg --ldflags`" else DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" DNET_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_dnet="yes"; cat >>confdefs.h <<\_ACEOF @%:@define DNET_IS_DUMBNET 1 _ACEOF else true fi if test $have_dnet = "no"; then if test -z "dnet"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "DNET"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_DNET_CPPFLAGS}" || test -n "${CUSTOM_DNET_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_DNET_LIBS} -ldnet" if test -n "dnet.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_DNET_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_dnet_h+set}" = set; then { echo "$as_me:$LINENO: checking for dnet.h" >&5 echo $ECHO_N "checking for dnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dnet_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dnet.h usability" >&5 echo $ECHO_N "checking dnet.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 dnet.h presence" >&5 echo $ECHO_N "checking dnet.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: dnet.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dnet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dnet.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dnet.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dnet.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dnet.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dnet.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dnet.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dnet.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dnet.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for dnet.h" >&5 echo $ECHO_N "checking for dnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dnet_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dnet_h" >&6; } fi if test $ac_cv_header_dnet_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "intf_open"; then ac_vmw_function=intf_open else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_dnet_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -ldnet" >&5 echo $ECHO_N "checking for $ac_vmw_function in -ldnet... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then DNET_CPPFLAGS="${CUSTOM_DNET_CPPFLAGS}" DNET_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DNET_CPPFLAGS="$ac_vmw_cppflags" DNET_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "dnet-config"; then # Extract the first word of "dnet-config", so it can be a program name with args. set dummy dnet-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" DNET_LIBS="`$ac_vmw_lib_cfg --ldflags`" else DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" DNET_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_dnet="yes" else true fi fi if test $have_dnet = "no"; then { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&5 echo "$as_me: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&2;} { (exit 1); exit 1; }; } fi fi if test "$with_dnet" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_DNET 1 _ACEOF fi # Check whether --with-icu was given. if test "${with_icu+set}" = set; then withval=$with_icu; else with_icu=yes fi if test "$have_x" = "yes" -o "$with_icu" = "yes"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$CXX", so it can be a program name with args. set dummy ${ac_tool_prefix}$CXX; 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_have_cxx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_cxx"; then ac_cv_prog_have_cxx="$have_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_cxx="${ac_tool_prefix}$CXX" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi have_cxx=$ac_cv_prog_have_cxx if test -n "$have_cxx"; then { echo "$as_me:$LINENO: result: $have_cxx" >&5 echo "${ECHO_T}$have_cxx" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_have_cxx"; then ac_ct_have_cxx=$have_cxx # Extract the first word of "$CXX", so it can be a program name with args. set dummy $CXX; 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_have_cxx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_have_cxx"; then ac_cv_prog_ac_ct_have_cxx="$ac_ct_have_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_have_cxx="$CXX" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_have_cxx=$ac_cv_prog_ac_ct_have_cxx if test -n "$ac_ct_have_cxx"; then { echo "$as_me:$LINENO: result: $ac_ct_have_cxx" >&5 echo "${ECHO_T}$ac_ct_have_cxx" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_have_cxx" = x; then have_cxx="no" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac have_cxx=$ac_ct_have_cxx fi else have_cxx="$ac_cv_prog_have_cxx" fi if test "$have_cxx" = "no"; then { { echo "$as_me:$LINENO: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu)." >&5 echo "$as_me: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu)." >&2;} { (exit 1); exit 1; }; } fi fi if test "$with_icu" = "yes"; then ac_ext=cpp 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 -z "icuuc"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "ICU"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_ICU_CPPFLAGS}" || test -n "${CUSTOM_ICU_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_ICU_LIBS} -licuuc" if test -n "unicode/utf.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_ICU_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_unicode_utf_h+set}" = set; then { echo "$as_me:$LINENO: checking for unicode/utf.h" >&5 echo $ECHO_N "checking for unicode/utf.h... $ECHO_C" >&6; } if test "${ac_cv_header_unicode_utf_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_unicode_utf_h" >&5 echo "${ECHO_T}$ac_cv_header_unicode_utf_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking unicode/utf.h usability" >&5 echo $ECHO_N "checking unicode/utf.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 unicode/utf.h presence" >&5 echo $ECHO_N "checking unicode/utf.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: unicode/utf.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: unicode/utf.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: unicode/utf.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: unicode/utf.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: unicode/utf.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: unicode/utf.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: unicode/utf.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: unicode/utf.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: unicode/utf.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: unicode/utf.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for unicode/utf.h" >&5 echo $ECHO_N "checking for unicode/utf.h... $ECHO_C" >&6; } if test "${ac_cv_header_unicode_utf_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_unicode_utf_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_unicode_utf_h" >&5 echo "${ECHO_T}$ac_cv_header_unicode_utf_h" >&6; } fi if test $ac_cv_header_unicode_utf_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_icuuc_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -licuuc" >&5 echo $ECHO_N "checking for $ac_vmw_function in -licuuc... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-licuuc $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then ICU_CPPFLAGS="${CUSTOM_ICU_CPPFLAGS}" ICU_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } ICU_CPPFLAGS="$ac_vmw_cppflags" ICU_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "icu-config"; then # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then ICU_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" ICU_LIBS="`$ac_vmw_lib_cfg --ldflags`" else ICU_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" ICU_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU" else true { { echo "$as_me:$LINENO: error: ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 echo "$as_me: error: ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&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 # Check whether we have ICU >= 3.8. ac_ext=cpp 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 for ucasemap_utf8ToTitle in ICU" >&5 echo $ECHO_N "checking for ucasemap_utf8ToTitle in ICU... $ECHO_C" >&6; } ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" 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 () { (void) &ucasemap_utf8ToTitle; return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$ORIGINAL_CPPFLAGS" 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 # Easier to give all modules the ICU defines/includes... CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" else CPPFLAGS="$CPPFLAGS -DNO_ICU" fi # Extract the first word of "rpcgen", so it can be a program name with args. set dummy rpcgen; 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_path_RPCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RPCGEN in [\\/]* | ?:[\\/]*) ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RPCGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RPCGEN" && ac_cv_path_RPCGEN=" { { echo "$as_me:$LINENO: error: rpcgen not found. Please install the libc devel package." >&5 echo "$as_me: error: rpcgen not found. Please install the libc devel package." >&2;} { (exit 1); exit 1; }; } " ;; esac fi RPCGEN=$ac_cv_path_RPCGEN if test -n "$RPCGEN"; then { echo "$as_me:$LINENO: result: $RPCGEN" >&5 echo "${ECHO_T}$RPCGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ### ### Headers ### for ac_header in crypt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/io.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 # Required to make the sys/user.h check work correctly on FreeBSD for ac_header in sys/sysinfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/user.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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ #ifdef HAVE_SYS_PARAM_H # include #endif @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 sys/vfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in syslimits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in unwind.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 if test "${ac_cv_header_wchar_h+set}" = set; then { echo "$as_me:$LINENO: checking for wchar.h" >&5 echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking wchar.h usability" >&5 echo $ECHO_N "checking wchar.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 wchar.h presence" >&5 echo $ECHO_N "checking wchar.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for wchar.h" >&5 echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } fi if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H="yes" else HAVE_WCHAR_H="no" fi if test "$os" = "linux"; then # Make sure kernel-headers package is installed. if test "${ac_cv_header_linux_unistd_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/unistd.h" >&5 echo $ECHO_N "checking for linux/unistd.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_unistd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_unistd_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_unistd_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/unistd.h usability" >&5 echo $ECHO_N "checking linux/unistd.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 linux/unistd.h presence" >&5 echo $ECHO_N "checking linux/unistd.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: linux/unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/unistd.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/unistd.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/unistd.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/unistd.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/unistd.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/unistd.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/unistd.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/unistd.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for linux/unistd.h" >&5 echo $ECHO_N "checking for linux/unistd.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_unistd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_unistd_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_unistd_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_unistd_h" >&6; } fi if test $ac_cv_header_linux_unistd_h = yes; then : else { { echo "$as_me:$LINENO: error: linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package." >&5 echo "$as_me: error: linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package." >&2;} { (exit 1); exit 1; }; } fi fi if test "$enable_multimon" != "no"; then { echo "$as_me:$LINENO: checking for X11/extensions/panoramiXproto.h" >&5 echo $ECHO_N "checking for X11/extensions/panoramiXproto.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_extensions_panoramiXproto_h+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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_X11_extensions_panoramiXproto_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_X11_extensions_panoramiXproto_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_panoramiXproto_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_extensions_panoramiXproto_h" >&6; } if test $ac_cv_header_X11_extensions_panoramiXproto_h = yes; then : else { { echo "$as_me:$LINENO: error: panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s)." >&5 echo "$as_me: error: panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi bsdPrintfWrappers=no if test "$os" = "linux"; then { echo "$as_me:$LINENO: checking for ecvt in -lc" >&5 echo $ECHO_N "checking for ecvt in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_ecvt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ecvt (); int main () { return ecvt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_ecvt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_ecvt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_ecvt" >&5 echo "${ECHO_T}$ac_cv_lib_c_ecvt" >&6; } if test $ac_cv_lib_c_ecvt = yes; then bsdPrintfWrappers=yes fi fi ### ### Typdefs, structs, and compiler quarks. ### { echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+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 #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } { echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+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 typedef _Bool ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_STDBOOL_H 1 _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 cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 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 inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_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. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_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. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define off_t long int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_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. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_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. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_rdev+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 int main () { static struct stat ac_aggr; if (ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+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 int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @%:@define TIME_WITH_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+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 int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @%:@define TM_IN_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking for working volatile" >&5 echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } if test "${ac_cv_c_volatile+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 () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_volatile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 echo "${ECHO_T}$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then cat >>confdefs.h <<\_ACEOF @%:@define volatile _ACEOF fi ### ### Specific features and OS/arch flags / actions ### ### General flags / actions CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Werror" # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' # in Xlib.h on OpenSolaris. # Glib2 keep changing mutex APIs so we also need to disable 'deprecated' # warnings for now (-Wno-deprecated-declarations). for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations; do { echo "$as_me:$LINENO: checking for GCC flag $TEST_CFLAG" >&5 echo $ECHO_N "checking for GCC flag $TEST_CFLAG... $ECHO_C" >&6; } ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" NEW_CFLAG="" 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; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then NEW_CFLAG=" $TEST_CFLAG" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG" done CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS" CPPFLAGS="$CPPFLAGS" # -fvisibility is used by "core service" plugins, but not required. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" { echo "$as_me:$LINENO: checking for GCC flag -fvisibility" >&5 echo $ECHO_N "checking for GCC flag -fvisibility... $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. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then PLUGIN_CPPFLAGS="-fvisibility=hidden -DGCC_EXPLICIT_EXPORT"; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS" # Detect "unused-but-set-variable" gcc warning and disable it. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-but-set-variable" { echo "$as_me:$LINENO: checking for GCC flag -Wno-unused-but-set-variable" >&5 echo $ECHO_N "checking for GCC flag -Wno-unused-but-set-variable... $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. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ORIGINAL_CFLAGS="$ORIGINAL_CFLAGS -Wno-unused-but-set-variable"; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS" BUILDDIR="`pwd`" INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" BLD_INCLUDE_DIR="$BUILDDIR/lib/include" CPPFLAGS="-I$INCLUDE_DIR -I$BLD_INCLUDE_DIR $CPPFLAGS" ### ### Documentation. ### if test "$enable_docs" = "yes"; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_have_doxygen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_doxygen"; then ac_cv_prog_have_doxygen="$have_doxygen" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_doxygen="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_doxygen" && ac_cv_prog_have_doxygen="no" fi fi have_doxygen=$ac_cv_prog_have_doxygen if test -n "$have_doxygen"; then { echo "$as_me:$LINENO: result: $have_doxygen" >&5 echo "${ECHO_T}$have_doxygen" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$have_doxygen" = "no"; then { echo "$as_me:$LINENO: WARNING: doxygen not found; API documentation will not be generated." >&5 echo "$as_me: WARNING: doxygen not found; API documentation will not be generated." >&2;} else # Extract the first word of "dot", so it can be a program name with args. set dummy dot; 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_path_DOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then { echo "$as_me:$LINENO: result: $DOT" >&5 echo "${ECHO_T}$DOT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$DOT" = ""; then HAVE_DOT=NO else DOT=`dirname $DOT` HAVE_DOT=YES fi # Extract the first word of "mscgen", so it can be a program name with args. set dummy mscgen; 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_path_MSCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSCGEN in [\\/]* | ?:[\\/]*) ac_cv_path_MSCGEN="$MSCGEN" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSCGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MSCGEN" && ac_cv_path_MSCGEN="no" ;; esac fi MSCGEN=$ac_cv_path_MSCGEN if test -n "$MSCGEN"; then { echo "$as_me:$LINENO: result: $MSCGEN" >&5 echo "${ECHO_T}$MSCGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$MSCGEN" != "no"; then MSCGEN_DIR="`dirname $MSCGEN`" else MSCGEN_DIR= fi fi fi ### ### OS/arch-specific flags / actions ### MODULES="" MODULES_OS="$os" TARGET_OS="$os" MODULES_DIR="" buildHgfsmounter=no if test "$os" = "linux"; then MODULES_DIR="$LINUXDIR/kernel/" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE" CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrt" # vmxnet is not supported for kernels 3.3.0 and newer if test "$osVersion" -lt 303000; then MODULES="$MODULES vmxnet" fi # See if we need vmhgfs module. Starting with 4.0.0 we use FUSE if test "$osVersion" -lt 400000; then MODULES="$MODULES vmhgfs" fi # See if we need vmci and vsock modules. Starting with 3.9 they made # their way into mainline kernel. if test "$osVersion" -lt 309000; then MODULES="$MODULES vmci vsock" fi if test "$osVersion" -lt 300000; then MODULES="$MODULES vmblock vmsync" fi buildHgfsmounter=yes fi if test "$os" = "freebsd" || test "$os" = "kfreebsd-gnu"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm" MODULES_DIR="/boot/modules" if test "$osVersion" -ge 302000; then MODULES="$MODULES vmmemctl" fi if test "$osVersion" -ge 409000; then MODULES="$MODULES vmxnet" fi if test "$osVersion" -ge 600000; then MODULES="$MODULES vmblock" fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building FreeBSD kernel modules. Make sure you use " echo " 'make' to build open-vm-tools, and not GNU make ('gmake'). " echo "****************************************************************" fi fi if test "$os" = "solaris"; then LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lsocket" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lnsl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lresolv" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrpcsvc" # Setup defines to identify the OS version. if test "$osVersion" -eq 509000; then CPPFLAGS="$CPPFLAGS -DSOL9" fi if test "$osVersion" -eq 510000; then CPPFLAGS="$CPPFLAGS -DSOL10" fi if test "$osVersion" -eq 511000; then CPPFLAGS="$CPPFLAGS -DSOL11" fi MODULES="$MODULES vmxnet vmmemctl" # HGFS and vmblock need Solaris 10 at least. if test "$osVersion" -ge 510000; then MODULES="$MODULES vmhgfs vmblock" fi # vmxnet3 is built on Solaris 10 / 11 only if GLDv3 is installed. if test "$osVersion" -gt 510000; then if test "${ac_cv_header_sys_mac_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/mac.h usability" >&5 echo $ECHO_N "checking sys/mac.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 sys/mac.h presence" >&5 echo $ECHO_N "checking sys/mac.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: sys/mac.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/mac.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/mac.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/mac.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/mac.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/mac.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/mac.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/mac.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/mac.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mac.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mac_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } fi if test $ac_cv_header_sys_mac_h = yes; then MODULES="$MODULES vmxnet3" else { echo "$as_me:$LINENO: WARNING: GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled." >&5 echo "$as_me: WARNING: GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled." >&2;} fi fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building Solaris kernel modules. Make sure you use " echo " GNU make to build open-vm-tools. " echo "****************************************************************" fi fi if test "$buildHgfsmounter" = "yes"; then BUILD_HGFSMOUNTER_TRUE= BUILD_HGFSMOUNTER_FALSE='#' else BUILD_HGFSMOUNTER_TRUE='#' BUILD_HGFSMOUNTER_FALSE= fi if test "$os" = "linux"; then LINUX_TRUE= LINUX_FALSE='#' else LINUX_TRUE='#' LINUX_FALSE= fi if test "$os" = "solaris"; then SOLARIS_TRUE= SOLARIS_FALSE='#' else SOLARIS_TRUE='#' SOLARIS_FALSE= fi if test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu"; then FREEBSD_TRUE= FREEBSD_FALSE='#' else FREEBSD_TRUE='#' FREEBSD_FALSE= fi if test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR"; then FREEBSD_CUSTOM_SYSDIR_TRUE= FREEBSD_CUSTOM_SYSDIR_FALSE='#' else FREEBSD_CUSTOM_SYSDIR_TRUE='#' FREEBSD_CUSTOM_SYSDIR_FALSE= fi if test "$userSpaceBitness" = "32"; then THIRTY_TWO_BIT_USERSPACE_TRUE= THIRTY_TWO_BIT_USERSPACE_FALSE='#' else THIRTY_TWO_BIT_USERSPACE_TRUE='#' THIRTY_TWO_BIT_USERSPACE_FALSE= fi if test "$have_x" = "yes"; then HAVE_X11_TRUE= HAVE_X11_FALSE='#' else HAVE_X11_TRUE='#' HAVE_X11_FALSE= fi if test "$with_icu" = "yes"; then HAVE_ICU_TRUE= HAVE_ICU_FALSE='#' else HAVE_ICU_TRUE='#' HAVE_ICU_FALSE= fi if test "$with_kernel_modules" = "yes"; then WITH_KERNEL_MODULES_TRUE= WITH_KERNEL_MODULES_FALSE='#' else WITH_KERNEL_MODULES_TRUE='#' WITH_KERNEL_MODULES_FALSE= fi if test "$have_xsm" = "yes"; then HAVE_XSM_TRUE= HAVE_XSM_FALSE='#' else HAVE_XSM_TRUE='#' HAVE_XSM_FALSE= fi if test "$have_xcomposite" = "yes"; then HAVE_XCOMPOSITE_TRUE= HAVE_XCOMPOSITE_FALSE='#' else HAVE_XCOMPOSITE_TRUE='#' HAVE_XCOMPOSITE_FALSE= fi if test "$have_cunit" = "yes"; then ENABLE_TESTS_TRUE= ENABLE_TESTS_FALSE='#' else ENABLE_TESTS_TRUE='#' ENABLE_TESTS_FALSE= fi if test "$with_root_privileges" = "yes"; then WITH_ROOT_PRIVILEGES_TRUE= WITH_ROOT_PRIVILEGES_FALSE='#' else WITH_ROOT_PRIVILEGES_TRUE='#' WITH_ROOT_PRIVILEGES_FALSE= fi if test "$have_dnet" = "yes"; then HAVE_DNET_TRUE= HAVE_DNET_FALSE='#' else HAVE_DNET_TRUE='#' HAVE_DNET_FALSE= fi if test "$have_doxygen" = "yes"; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' else HAVE_DOXYGEN_TRUE='#' HAVE_DOXYGEN_FALSE= fi if test "$have_fuse" = "yes"; then HAVE_FUSE_TRUE= HAVE_FUSE_FALSE='#' else HAVE_FUSE_TRUE='#' HAVE_FUSE_FALSE= fi if test "$with_gnu_ld" = "yes"; then HAVE_GNU_LD_TRUE= HAVE_GNU_LD_FALSE='#' else HAVE_GNU_LD_TRUE='#' HAVE_GNU_LD_FALSE= fi if test "$have_x" = "yes" -a "$with_gtkmm" = "yes"; then HAVE_GTKMM_TRUE= HAVE_GTKMM_FALSE='#' else HAVE_GTKMM_TRUE='#' HAVE_GTKMM_FALSE= fi if test "$with_pam" = "yes"; then HAVE_PAM_TRUE= HAVE_PAM_FALSE='#' else HAVE_PAM_TRUE='#' HAVE_PAM_FALSE= fi if test "$os" = "linux"; then USE_SLASH_PROC_TRUE= USE_SLASH_PROC_FALSE='#' else USE_SLASH_PROC_TRUE='#' USE_SLASH_PROC_FALSE= fi if test "$bsdPrintfWrappers" = "yes"; then USE_PRINTF_WRAPPERS_TRUE= USE_PRINTF_WRAPPERS_FALSE='#' else USE_PRINTF_WRAPPERS_TRUE='#' USE_PRINTF_WRAPPERS_FALSE= fi if test "$enable_deploypkg" = "yes"; then ENABLE_DEPLOYPKG_TRUE= ENABLE_DEPLOYPKG_FALSE='#' else ENABLE_DEPLOYPKG_TRUE='#' ENABLE_DEPLOYPKG_FALSE= fi if test "$enable_grabbitmqproxy" = "yes"; then ENABLE_GRABBITMQPROXY_TRUE= ENABLE_GRABBITMQPROXY_FALSE='#' else ENABLE_GRABBITMQPROXY_TRUE='#' ENABLE_GRABBITMQPROXY_FALSE= fi if test "$enable_vgauth" = "yes"; then ENABLE_VGAUTH_TRUE= ENABLE_VGAUTH_FALSE='#' else ENABLE_VGAUTH_TRUE='#' ENABLE_VGAUTH_FALSE= fi if test "$os" = "linux"; then HAVE_VSOCK_TRUE= HAVE_VSOCK_FALSE='#' else HAVE_VSOCK_TRUE='#' HAVE_VSOCK_FALSE= fi if test "$have_xsm" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_XSM 1 _ACEOF fi if test "$have_xcomposite" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_XCOMPOSITE 1 _ACEOF fi ### Feature-specific flags / actions # Combine where possible # If control reaches this point and multimon is still enabled, then we know # all of the tests for required components have passed and it's safe to allow # multimon. Otherwise, it should be disabled. if test "$enable_multimon" = "no"; then # XXX: For consistency, change this to ENABLE_MULTIMON. This will require # some additional code cleanup. cat >>confdefs.h <<\_ACEOF @%:@define NO_MULTIMON 1 _ACEOF fi LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS $PAM_CPPFLAGS" if test "$HAVE_CRYPT" = "yes"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lcrypt" VIX_LIBADD="$VIX_LIBADD -lcrypt" fi LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $THREAD_LIB" VIX_LIBADD="$VIX_LIBADD $THREAD_LIB" ### Core Services definitions. HGFS_LIBS="$BUILDDIR/libhgfs/libhgfs.la" VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS" VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS" PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS" PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -shared -module -avoid-version" # In Solaris, the XDR-related functions are not in libc like in Linux and # FreeBSD, so binaries need to be linked to some extra libraries. XDR_LIBS= if test "$os" = "solaris"; then XDR_LIBS="-lnsl -lrpcsvc" fi # Installation directories for core services plugins. TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common VMSVC_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmsvc VMUSR_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmusr # General definitions INSTVMSG='$(SHELL) $(top_srcdir)/scripts/build/instvmsg.sh' RPCGEN_WRAPPER='$(SHELL) $(top_builddir)/scripts/build/rpcgen_wrapper.sh' ### General substs if test "$os" = "freebsd" -a -n "$SYSDIR"; then # If SYSDIR is not defined, AC_SUBST expands to nothing, so we need something # inside this block. true fi ### Lib substs ### Program substs ### ### Create the Makefiles ### ac_config_files="$ac_config_files Makefile lib/Makefile lib/appUtil/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/asyncsocket/Makefile lib/sslDirect/Makefile lib/pollGtk/Makefile lib/poll/Makefile lib/dataMap/Makefile lib/hashMap/Makefile lib/dict/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/glibUtils/Makefile lib/guestApp/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsHelper/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/hgfsUri/Makefile lib/impersonate/Makefile lib/lock/Makefile lib/message/Makefile lib/misc/Makefile lib/netUtil/Makefile lib/nicInfo/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/procMgr/Makefile lib/rpcChannel/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcVmx/Makefile lib/slashProc/Makefile lib/string/Makefile lib/stubs/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/unicode/Makefile lib/user/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile lib/xdg/Makefile services/Makefile services/vmtoolsd/Makefile services/plugins/Makefile services/plugins/desktopEvents/Makefile services/plugins/dndcp/Makefile services/plugins/grabbitmqProxy/Makefile services/plugins/guestInfo/Makefile services/plugins/hgfsServer/Makefile services/plugins/powerOps/Makefile services/plugins/resolutionSet/Makefile services/plugins/timeSync/Makefile services/plugins/vix/Makefile services/plugins/vmbackup/Makefile services/plugins/deployPkg/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile rpctool/Makefile namespacetool/Makefile guestproxycerttool/Makefile vgauth/Makefile vgauth/lib/Makefile vgauth/cli/Makefile vgauth/service/Makefile libguestlib/Makefile libguestlib/vmguestlib.pc libDeployPkg/Makefile libDeployPkg/libDeployPkg.pc libhgfs/Makefile libvmtools/Makefile xferlogs/Makefile modules/Makefile vmblock-fuse/Makefile vmhgfs-fuse/Makefile vmblockmounter/Makefile tests/Makefile tests/vmrpcdbg/Makefile tests/testDebug/Makefile tests/testPlugin/Makefile tests/testVmblock/Makefile docs/Makefile docs/api/Makefile scripts/Makefile scripts/build/rpcgen_wrapper.sh" ### ### Output ### 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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 "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs 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__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 "${BUILD_HGFSMOUNTER_TRUE}" && test -z "${BUILD_HGFSMOUNTER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_HGFSMOUNTER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_HGFSMOUNTER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SOLARIS_TRUE}" && test -z "${SOLARIS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREEBSD_TRUE}" && test -z "${FREEBSD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREEBSD_CUSTOM_SYSDIR_TRUE}" && test -z "${FREEBSD_CUSTOM_SYSDIR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREEBSD_CUSTOM_SYSDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREEBSD_CUSTOM_SYSDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${THIRTY_TWO_BIT_USERSPACE_TRUE}" && test -z "${THIRTY_TWO_BIT_USERSPACE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"THIRTY_TWO_BIT_USERSPACE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"THIRTY_TWO_BIT_USERSPACE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_X11_TRUE}" && test -z "${HAVE_X11_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_ICU_TRUE}" && test -z "${HAVE_ICU_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_ICU\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_ICU\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_KERNEL_MODULES_TRUE}" && test -z "${WITH_KERNEL_MODULES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_KERNEL_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_KERNEL_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XSM_TRUE}" && test -z "${HAVE_XSM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XSM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_XSM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XCOMPOSITE_TRUE}" && test -z "${HAVE_XCOMPOSITE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XCOMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_XCOMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_ROOT_PRIVILEGES_TRUE}" && test -z "${WITH_ROOT_PRIVILEGES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_ROOT_PRIVILEGES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_ROOT_PRIVILEGES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DNET_TRUE}" && test -z "${HAVE_DNET_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_DNET\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_DNET\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_FUSE_TRUE}" && test -z "${HAVE_FUSE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GNU_LD_TRUE}" && test -z "${HAVE_GNU_LD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GTKMM_TRUE}" && test -z "${HAVE_GTKMM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTKMM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GTKMM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_PAM_TRUE}" && test -z "${HAVE_PAM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SLASH_PROC_TRUE}" && test -z "${USE_SLASH_PROC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SLASH_PROC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SLASH_PROC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PRINTF_WRAPPERS_TRUE}" && test -z "${USE_PRINTF_WRAPPERS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PRINTF_WRAPPERS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PRINTF_WRAPPERS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_DEPLOYPKG_TRUE}" && test -z "${ENABLE_DEPLOYPKG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DEPLOYPKG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_DEPLOYPKG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_GRABBITMQPROXY_TRUE}" && test -z "${ENABLE_GRABBITMQPROXY_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_GRABBITMQPROXY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_GRABBITMQPROXY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_VGAUTH_TRUE}" && test -z "${ENABLE_VGAUTH_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_VGAUTH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_VGAUTH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_VSOCK_TRUE}" && test -z "${HAVE_VSOCK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_VSOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_VSOCK\" 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by open-vm-tools $as_me 10.0.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF 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 and configuration settings, 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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ open-vm-tools config.status 10.0.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _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 ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { 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" ac_need_defaults=false ;; 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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/appUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/appUtil/Makefile" ;; "lib/auth/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auth/Makefile" ;; "lib/backdoor/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/Makefile" ;; "lib/asyncsocket/Makefile") CONFIG_FILES="$CONFIG_FILES lib/asyncsocket/Makefile" ;; "lib/sslDirect/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sslDirect/Makefile" ;; "lib/pollGtk/Makefile") CONFIG_FILES="$CONFIG_FILES lib/pollGtk/Makefile" ;; "lib/poll/Makefile") CONFIG_FILES="$CONFIG_FILES lib/poll/Makefile" ;; "lib/dataMap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dataMap/Makefile" ;; "lib/hashMap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hashMap/Makefile" ;; "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; "lib/glibUtils/Makefile") CONFIG_FILES="$CONFIG_FILES lib/glibUtils/Makefile" ;; "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; "lib/guestRpc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestRpc/Makefile" ;; "lib/hgfs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfs/Makefile" ;; "lib/hgfsBd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsBd/Makefile" ;; "lib/hgfsHelper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsHelper/Makefile" ;; "lib/hgfsServer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServer/Makefile" ;; "lib/hgfsServerManagerGuest/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServerManagerGuest/Makefile" ;; "lib/hgfsServerPolicyGuest/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServerPolicyGuest/Makefile" ;; "lib/hgfsUri/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsUri/Makefile" ;; "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; "lib/lock/Makefile") CONFIG_FILES="$CONFIG_FILES lib/lock/Makefile" ;; "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; "lib/nicInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/nicInfo/Makefile" ;; "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; "lib/rpcChannel/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcChannel/Makefile" ;; "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; "lib/slashProc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/slashProc/Makefile" ;; "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; "lib/vmCheck/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmCheck/Makefile" ;; "lib/vmSignal/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmSignal/Makefile" ;; "lib/wiper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/wiper/Makefile" ;; "lib/xdg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xdg/Makefile" ;; "services/Makefile") CONFIG_FILES="$CONFIG_FILES services/Makefile" ;; "services/vmtoolsd/Makefile") CONFIG_FILES="$CONFIG_FILES services/vmtoolsd/Makefile" ;; "services/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/Makefile" ;; "services/plugins/desktopEvents/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/desktopEvents/Makefile" ;; "services/plugins/dndcp/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/dndcp/Makefile" ;; "services/plugins/grabbitmqProxy/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/grabbitmqProxy/Makefile" ;; "services/plugins/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/guestInfo/Makefile" ;; "services/plugins/hgfsServer/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/hgfsServer/Makefile" ;; "services/plugins/powerOps/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/powerOps/Makefile" ;; "services/plugins/resolutionSet/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/resolutionSet/Makefile" ;; "services/plugins/timeSync/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/timeSync/Makefile" ;; "services/plugins/vix/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/vix/Makefile" ;; "services/plugins/vmbackup/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/vmbackup/Makefile" ;; "services/plugins/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/deployPkg/Makefile" ;; "vmware-user-suid-wrapper/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user-suid-wrapper/Makefile" ;; "toolbox/Makefile") CONFIG_FILES="$CONFIG_FILES toolbox/Makefile" ;; "hgfsclient/Makefile") CONFIG_FILES="$CONFIG_FILES hgfsclient/Makefile" ;; "hgfsmounter/Makefile") CONFIG_FILES="$CONFIG_FILES hgfsmounter/Makefile" ;; "checkvm/Makefile") CONFIG_FILES="$CONFIG_FILES checkvm/Makefile" ;; "rpctool/Makefile") CONFIG_FILES="$CONFIG_FILES rpctool/Makefile" ;; "namespacetool/Makefile") CONFIG_FILES="$CONFIG_FILES namespacetool/Makefile" ;; "guestproxycerttool/Makefile") CONFIG_FILES="$CONFIG_FILES guestproxycerttool/Makefile" ;; "vgauth/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/Makefile" ;; "vgauth/lib/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/lib/Makefile" ;; "vgauth/cli/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/cli/Makefile" ;; "vgauth/service/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/service/Makefile" ;; "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; "libguestlib/vmguestlib.pc") CONFIG_FILES="$CONFIG_FILES libguestlib/vmguestlib.pc" ;; "libDeployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES libDeployPkg/Makefile" ;; "libDeployPkg/libDeployPkg.pc") CONFIG_FILES="$CONFIG_FILES libDeployPkg/libDeployPkg.pc" ;; "libhgfs/Makefile") CONFIG_FILES="$CONFIG_FILES libhgfs/Makefile" ;; "libvmtools/Makefile") CONFIG_FILES="$CONFIG_FILES libvmtools/Makefile" ;; "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "vmblock-fuse/Makefile") CONFIG_FILES="$CONFIG_FILES vmblock-fuse/Makefile" ;; "vmhgfs-fuse/Makefile") CONFIG_FILES="$CONFIG_FILES vmhgfs-fuse/Makefile" ;; "vmblockmounter/Makefile") CONFIG_FILES="$CONFIG_FILES vmblockmounter/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/vmrpcdbg/Makefile") CONFIG_FILES="$CONFIG_FILES tests/vmrpcdbg/Makefile" ;; "tests/testDebug/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testDebug/Makefile" ;; "tests/testPlugin/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testPlugin/Makefile" ;; "tests/testVmblock/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testVmblock/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/api/Makefile") CONFIG_FILES="$CONFIG_FILES docs/api/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/build/rpcgen_wrapper.sh") CONFIG_FILES="$CONFIG_FILES scripts/build/rpcgen_wrapper.sh" ;; *) { { 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_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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for 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 _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim SED!$SED$ac_delim LN_S!$LN_S$ac_delim LIBTOOL!$LIBTOOL$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim FGREP!$FGREP$ac_delim LD!$LD$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF DUMPBIN!$DUMPBIN$ac_delim ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim NM!$NM$ac_delim OBJDUMP!$OBJDUMP$ac_delim DLLTOOL!$DLLTOOL$ac_delim AR!$AR$ac_delim ac_ct_AR!$ac_ct_AR$ac_delim RANLIB!$RANLIB$ac_delim MANIFEST_TOOL!$MANIFEST_TOOL$ac_delim DSYMUTIL!$DSYMUTIL$ac_delim NMEDIT!$NMEDIT$ac_delim LIPO!$LIPO$ac_delim OTOOL!$OTOOL$ac_delim OTOOL64!$OTOOL64$ac_delim CXXCPP!$CXXCPP$ac_delim HAVE_PKG_CONFIG!$HAVE_PKG_CONFIG$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim ac_vmw_lib_cfg!$ac_vmw_lib_cfg$ac_delim MSPACK_CPPFLAGS!$MSPACK_CPPFLAGS$ac_delim MSPACK_LIBS!$MSPACK_LIBS$ac_delim GLIB2_CPPFLAGS!$GLIB2_CPPFLAGS$ac_delim GLIB2_LIBS!$GLIB2_LIBS$ac_delim GMODULE_CPPFLAGS!$GMODULE_CPPFLAGS$ac_delim GMODULE_LIBS!$GMODULE_LIBS$ac_delim GOBJECT_CPPFLAGS!$GOBJECT_CPPFLAGS$ac_delim GOBJECT_LIBS!$GOBJECT_LIBS$ac_delim GTHREAD_CPPFLAGS!$GTHREAD_CPPFLAGS$ac_delim GTHREAD_LIBS!$GTHREAD_LIBS$ac_delim have_genmarshal!$have_genmarshal$ac_delim FUSE_CPPFLAGS!$FUSE_CPPFLAGS$ac_delim FUSE_LIBS!$FUSE_LIBS$ac_delim PAM_CPPFLAGS!$PAM_CPPFLAGS$ac_delim PAM_LIBS!$PAM_LIBS$ac_delim SSL_CPPFLAGS!$SSL_CPPFLAGS$ac_delim SSL_LIBS!$SSL_LIBS$ac_delim XERCES_CPPFLAGS!$XERCES_CPPFLAGS$ac_delim XERCES_LIBS!$XERCES_LIBS$ac_delim XMLSECURITY_CPPFLAGS!$XMLSECURITY_CPPFLAGS$ac_delim XMLSECURITY_LIBS!$XMLSECURITY_LIBS$ac_delim CUNIT_CPPFLAGS!$CUNIT_CPPFLAGS$ac_delim CUNIT_LIBS!$CUNIT_LIBS$ac_delim GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim GTK_LIBS!$GTK_LIBS$ac_delim GTKMM_CPPFLAGS!$GTKMM_CPPFLAGS$ac_delim GTKMM_LIBS!$GTKMM_LIBS$ac_delim PROCPS_CPPFLAGS!$PROCPS_CPPFLAGS$ac_delim PROCPS_LIBS!$PROCPS_LIBS$ac_delim DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim DNET_LIBS!$DNET_LIBS$ac_delim have_cxx!$have_cxx$ac_delim ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim ICU_LIBS!$ICU_LIBS$ac_delim RPCGEN!$RPCGEN$ac_delim have_doxygen!$have_doxygen$ac_delim DOT!$DOT$ac_delim HAVE_DOT!$HAVE_DOT$ac_delim MSCGEN!$MSCGEN$ac_delim MSCGEN_DIR!$MSCGEN_DIR$ac_delim BUILD_HGFSMOUNTER_TRUE!$BUILD_HGFSMOUNTER_TRUE$ac_delim BUILD_HGFSMOUNTER_FALSE!$BUILD_HGFSMOUNTER_FALSE$ac_delim LINUX_TRUE!$LINUX_TRUE$ac_delim LINUX_FALSE!$LINUX_FALSE$ac_delim SOLARIS_TRUE!$SOLARIS_TRUE$ac_delim SOLARIS_FALSE!$SOLARIS_FALSE$ac_delim FREEBSD_TRUE!$FREEBSD_TRUE$ac_delim FREEBSD_FALSE!$FREEBSD_FALSE$ac_delim FREEBSD_CUSTOM_SYSDIR_TRUE!$FREEBSD_CUSTOM_SYSDIR_TRUE$ac_delim FREEBSD_CUSTOM_SYSDIR_FALSE!$FREEBSD_CUSTOM_SYSDIR_FALSE$ac_delim THIRTY_TWO_BIT_USERSPACE_TRUE!$THIRTY_TWO_BIT_USERSPACE_TRUE$ac_delim THIRTY_TWO_BIT_USERSPACE_FALSE!$THIRTY_TWO_BIT_USERSPACE_FALSE$ac_delim HAVE_X11_TRUE!$HAVE_X11_TRUE$ac_delim HAVE_X11_FALSE!$HAVE_X11_FALSE$ac_delim HAVE_ICU_TRUE!$HAVE_ICU_TRUE$ac_delim HAVE_ICU_FALSE!$HAVE_ICU_FALSE$ac_delim WITH_KERNEL_MODULES_TRUE!$WITH_KERNEL_MODULES_TRUE$ac_delim WITH_KERNEL_MODULES_FALSE!$WITH_KERNEL_MODULES_FALSE$ac_delim HAVE_XSM_TRUE!$HAVE_XSM_TRUE$ac_delim HAVE_XSM_FALSE!$HAVE_XSM_FALSE$ac_delim HAVE_XCOMPOSITE_TRUE!$HAVE_XCOMPOSITE_TRUE$ac_delim HAVE_XCOMPOSITE_FALSE!$HAVE_XCOMPOSITE_FALSE$ac_delim ENABLE_TESTS_TRUE!$ENABLE_TESTS_TRUE$ac_delim ENABLE_TESTS_FALSE!$ENABLE_TESTS_FALSE$ac_delim WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim HAVE_DNET_TRUE!$HAVE_DNET_TRUE$ac_delim HAVE_DNET_FALSE!$HAVE_DNET_FALSE$ac_delim HAVE_DOXYGEN_TRUE!$HAVE_DOXYGEN_TRUE$ac_delim HAVE_DOXYGEN_FALSE!$HAVE_DOXYGEN_FALSE$ac_delim HAVE_FUSE_TRUE!$HAVE_FUSE_TRUE$ac_delim HAVE_FUSE_FALSE!$HAVE_FUSE_FALSE$ac_delim HAVE_GNU_LD_TRUE!$HAVE_GNU_LD_TRUE$ac_delim HAVE_GNU_LD_FALSE!$HAVE_GNU_LD_FALSE$ac_delim HAVE_GTKMM_TRUE!$HAVE_GTKMM_TRUE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF HAVE_GTKMM_FALSE!$HAVE_GTKMM_FALSE$ac_delim HAVE_PAM_TRUE!$HAVE_PAM_TRUE$ac_delim HAVE_PAM_FALSE!$HAVE_PAM_FALSE$ac_delim USE_SLASH_PROC_TRUE!$USE_SLASH_PROC_TRUE$ac_delim USE_SLASH_PROC_FALSE!$USE_SLASH_PROC_FALSE$ac_delim USE_PRINTF_WRAPPERS_TRUE!$USE_PRINTF_WRAPPERS_TRUE$ac_delim USE_PRINTF_WRAPPERS_FALSE!$USE_PRINTF_WRAPPERS_FALSE$ac_delim ENABLE_DEPLOYPKG_TRUE!$ENABLE_DEPLOYPKG_TRUE$ac_delim ENABLE_DEPLOYPKG_FALSE!$ENABLE_DEPLOYPKG_FALSE$ac_delim ENABLE_GRABBITMQPROXY_TRUE!$ENABLE_GRABBITMQPROXY_TRUE$ac_delim ENABLE_GRABBITMQPROXY_FALSE!$ENABLE_GRABBITMQPROXY_FALSE$ac_delim ENABLE_VGAUTH_TRUE!$ENABLE_VGAUTH_TRUE$ac_delim ENABLE_VGAUTH_FALSE!$ENABLE_VGAUTH_FALSE$ac_delim HAVE_VSOCK_TRUE!$HAVE_VSOCK_TRUE$ac_delim HAVE_VSOCK_FALSE!$HAVE_VSOCK_FALSE$ac_delim HGFS_LIBS!$HGFS_LIBS$ac_delim TOOLS_VERSION!$TOOLS_VERSION$ac_delim TARGET_OS!$TARGET_OS$ac_delim KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim LINUXINCLUDE!$LINUXINCLUDE$ac_delim MODULES_OS!$MODULES_OS$ac_delim MODULES_DIR!$MODULES_DIR$ac_delim MODULES!$MODULES$ac_delim COMMON_XLIBS!$COMMON_XLIBS$ac_delim XSM_LIBS!$XSM_LIBS$ac_delim XCOMPOSITE_LIBS!$XCOMPOSITE_LIBS$ac_delim PAM_PREFIX!$PAM_PREFIX$ac_delim PLUGIN_CPPFLAGS!$PLUGIN_CPPFLAGS$ac_delim PLUGIN_LDFLAGS!$PLUGIN_LDFLAGS$ac_delim VMTOOLS_CPPFLAGS!$VMTOOLS_CPPFLAGS$ac_delim VMTOOLS_LIBS!$VMTOOLS_LIBS$ac_delim RPCGENFLAGS!$RPCGENFLAGS$ac_delim XDR_LIBS!$XDR_LIBS$ac_delim TEST_PLUGIN_INSTALLDIR!$TEST_PLUGIN_INSTALLDIR$ac_delim COMMON_PLUGIN_INSTALLDIR!$COMMON_PLUGIN_INSTALLDIR$ac_delim VMSVC_PLUGIN_INSTALLDIR!$VMSVC_PLUGIN_INSTALLDIR$ac_delim VMUSR_PLUGIN_INSTALLDIR!$VMUSR_PLUGIN_INSTALLDIR$ac_delim SYSDIR!$SYSDIR$ac_delim INSTVMSG!$INSTVMSG$ac_delim RPCGEN_WRAPPER!$RPCGEN_WRAPPER$ac_delim LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim LIBVMTOOLS_LIBADD!$LIBVMTOOLS_LIBADD$ac_delim VIX_LIBADD!$VIX_LIBADD$ac_delim VGAUTH_LIBADD!$VGAUTH_LIBADD$ac_delim LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 48; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # 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. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $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'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? 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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $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=`$as_dirname -- "$file" || $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'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "libtool":C) # 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 cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # 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 # 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//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # 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 # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # 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 # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # 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 # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # 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 # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # 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 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # 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 a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # 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 # 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 DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # 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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # 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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_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 _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # 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) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { echo "$as_me:$LINENO: WARNING: Unable to substitute extended shell functions in $ofile" >&5 echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # 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 a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # 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 # 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 DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag { (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 open-vm-tools-10.0.7-3227872/autom4te.cache/traces.00000644000000000000000000032345012660700531020025 0ustar rootrootm4trace:/usr/local/share/aclocal-1.10/amversion.m4:14: -1- AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) m4trace:/usr/local/share/aclocal-1.10/amversion.m4:33: -1- AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) m4trace:/usr/local/share/aclocal-1.10/auxdir.m4:47: -1- AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) m4trace:/usr/local/share/aclocal-1.10/cond.m4:15: -1- AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) m4trace:/usr/local/share/aclocal-1.10/depend.m4:28: -1- AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [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_$1_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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) m4trace:/usr/local/share/aclocal-1.10/depend.m4:139: -1- AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) m4trace:/usr/local/share/aclocal-1.10/depend.m4:147: -1- AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) m4trace:/usr/local/share/aclocal-1.10/depout.m4:14: -1- AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` 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=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ]) m4trace:/usr/local/share/aclocal-1.10/depout.m4:64: -1- AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) m4trace:/usr/local/share/aclocal-1.10/init.m4:26: -1- AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) m4trace:/usr/local/share/aclocal-1.10/init.m4:113: -1- AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) m4trace:/usr/local/share/aclocal-1.10/install-sh.m4:11: -1- AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) m4trace:/usr/local/share/aclocal-1.10/lead-dot.m4:12: -1- AC_DEFUN([AM_SET_LEADING_DOT], [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 AC_SUBST([am__leading_dot])]) m4trace:/usr/local/share/aclocal-1.10/make.m4:14: -1- AC_DEFUN([AM_MAKE_INCLUDE], [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. AC_MSG_CHECKING([for style of include used by $am_make]) 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 AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) m4trace:/usr/local/share/aclocal-1.10/minuso.m4:14: -1- AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) m4trace:/usr/local/share/aclocal-1.10/missing.m4:14: -1- AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) m4trace:/usr/local/share/aclocal-1.10/missing.m4:24: -1- AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl 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= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) m4trace:/usr/local/share/aclocal-1.10/mkdirp.m4:11: -1- AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) m4trace:/usr/local/share/aclocal-1.10/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) m4trace:/usr/local/share/aclocal-1.10/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) m4trace:/usr/local/share/aclocal-1.10/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) m4trace:/usr/local/share/aclocal-1.10/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) m4trace:/usr/local/share/aclocal-1.10/runlog.m4:12: -1- AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) m4trace:/usr/local/share/aclocal-1.10/sanity.m4:14: -1- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # 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". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) m4trace:/usr/local/share/aclocal-1.10/strip.m4:17: -1- AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # 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. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) m4trace:/usr/local/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) m4trace:/usr/local/share/aclocal-1.10/tar.m4:24: -1- AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) m4trace:m4/libtool.m4:69: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ]) m4trace:m4/libtool.m4:107: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:m4/libtool.m4:107: -1- AC_DEFUN([AC_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:m4/libtool.m4:108: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:m4/libtool.m4:108: -1- AC_DEFUN([AM_PROG_LIBTOOL], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_LIBTOOL' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) m4trace:m4/libtool.m4:609: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -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 Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ]) m4trace:m4/libtool.m4:790: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) m4trace:m4/libtool.m4:801: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ]) m4trace:m4/libtool.m4:893: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) m4trace:m4/libtool.m4:893: -1- AC_DEFUN([AC_LIBTOOL_CXX], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_CXX' is obsolete. You should run autoupdate.])dnl LT_LANG(C++)]) m4trace:m4/libtool.m4:894: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) m4trace:m4/libtool.m4:894: -1- AC_DEFUN([AC_LIBTOOL_F77], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_F77' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran 77)]) m4trace:m4/libtool.m4:895: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) m4trace:m4/libtool.m4:895: -1- AC_DEFUN([AC_LIBTOOL_FC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_FC' is obsolete. You should run autoupdate.])dnl LT_LANG(Fortran)]) m4trace:m4/libtool.m4:896: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) m4trace:m4/libtool.m4:896: -1- AC_DEFUN([AC_LIBTOOL_GCJ], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_GCJ' is obsolete. You should run autoupdate.])dnl LT_LANG(Java)]) m4trace:m4/libtool.m4:897: -1- AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) m4trace:m4/libtool.m4:897: -1- AC_DEFUN([AC_LIBTOOL_RC], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_RC' is obsolete. You should run autoupdate.])dnl LT_LANG(Windows Resource)]) m4trace:m4/libtool.m4:1225: -1- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) m4trace:m4/libtool.m4:1502: -1- AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # 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:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD 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 "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ]) m4trace:m4/libtool.m4:1544: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) m4trace:m4/libtool.m4:1544: -1- AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_COMPILER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) m4trace:m4/libtool.m4:1553: -1- AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$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>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ]) m4trace:m4/libtool.m4:1588: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) m4trace:m4/libtool.m4:1588: -1- AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_LINKER_OPTION' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) m4trace:m4/libtool.m4:1595: -1- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl 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* | cegcc*) # 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ]) m4trace:m4/libtool.m4:1733: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) m4trace:m4/libtool.m4:1733: -1- AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_SYS_MAX_CMD_LEN' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) m4trace:m4/libtool.m4:1844: -1- AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl 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* | cegcc*) 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 AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; 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" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) 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 _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ]) m4trace:m4/libtool.m4:1961: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) m4trace:m4/libtool.m4:1961: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN_SELF' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) m4trace:m4/libtool.m4:2942: -1- AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [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 dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" 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 <<_LT_EOF 1>&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 _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ]) m4trace:m4/libtool.m4:3004: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) m4trace:m4/libtool.m4:3004: -1- AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_DIAGNOSE([obsolete], [The macro `AC_PATH_TOOL_PREFIX' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) m4trace:m4/libtool.m4:3027: -1- AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) 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 AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [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 &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 : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ]) m4trace:m4/libtool.m4:3501: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:m4/libtool.m4:3501: -1- AC_DEFUN([AM_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AM_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:m4/libtool.m4:3502: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:m4/libtool.m4:3502: -1- AC_DEFUN([AC_PROG_NM], [AC_DIAGNOSE([obsolete], [The macro `AC_PROG_NM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) m4trace:m4/libtool.m4:3572: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ]) m4trace:m4/libtool.m4:3591: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) m4trace:m4/libtool.m4:3591: -1- AC_DEFUN([AC_CHECK_LIBM], [AC_DIAGNOSE([obsolete], [The macro `AC_CHECK_LIBM' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) m4trace:m4/libtool.m4:7641: -1- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) m4trace:m4/libtool.m4:7650: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) m4trace:m4/libtool.m4:7650: -1- AC_DEFUN([LT_AC_PROG_GCJ], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_GCJ' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) m4trace:m4/libtool.m4:7657: -1- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) m4trace:m4/libtool.m4:7664: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) m4trace:m4/libtool.m4:7669: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) m4trace:m4/libtool.m4:7669: -1- AC_DEFUN([LT_AC_PROG_RC], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_RC' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) m4trace:m4/libtool.m4:7789: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:m4/libtool.m4:7789: -1- AC_DEFUN([LT_AC_PROG_SED], [AC_DIAGNOSE([obsolete], [The macro `LT_AC_PROG_SED' is obsolete. You should run autoupdate.])dnl m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) m4trace:m4/ltoptions.m4:14: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) m4trace:m4/ltoptions.m4:111: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:111: -1- AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_DLOPEN' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:146: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:146: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. You should run autoupdate.])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:195: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) m4trace:m4/ltoptions.m4:199: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) m4trace:m4/ltoptions.m4:203: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) m4trace:m4/ltoptions.m4:203: -1- AC_DEFUN([AM_ENABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_ENABLE_SHARED($@)]) m4trace:m4/ltoptions.m4:204: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) m4trace:m4/ltoptions.m4:204: -1- AC_DEFUN([AM_DISABLE_SHARED], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_SHARED' is obsolete. You should run autoupdate.])dnl AC_DISABLE_SHARED($@)]) m4trace:m4/ltoptions.m4:249: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) m4trace:m4/ltoptions.m4:253: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) m4trace:m4/ltoptions.m4:257: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) m4trace:m4/ltoptions.m4:257: -1- AC_DEFUN([AM_ENABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_ENABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_ENABLE_STATIC($@)]) m4trace:m4/ltoptions.m4:258: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) m4trace:m4/ltoptions.m4:258: -1- AC_DEFUN([AM_DISABLE_STATIC], [AC_DIAGNOSE([obsolete], [The macro `AM_DISABLE_STATIC' is obsolete. You should run autoupdate.])dnl AC_DISABLE_STATIC($@)]) m4trace:m4/ltoptions.m4:303: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:303: -1- AC_DEFUN([AC_ENABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_ENABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:310: -1- AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:310: -1- AC_DEFUN([AC_DISABLE_FAST_INSTALL], [AC_DIAGNOSE([obsolete], [The macro `AC_DISABLE_FAST_INSTALL' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:358: -1- AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltoptions.m4:358: -1- AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_PICMODE' is obsolete. You should run autoupdate.])dnl _LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) m4trace:m4/ltsugar.m4:13: -1- AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) m4trace:m4/ltversion.m4:18: -1- AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) m4trace:m4/lt~obsolete.m4:36: -1- AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4trace:m4/lt~obsolete.m4:40: -1- AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH]) m4trace:m4/lt~obsolete.m4:41: -1- AC_DEFUN([_LT_AC_SHELL_INIT]) m4trace:m4/lt~obsolete.m4:42: -1- AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX]) m4trace:m4/lt~obsolete.m4:44: -1- AC_DEFUN([_LT_AC_TAGVAR]) m4trace:m4/lt~obsolete.m4:45: -1- AC_DEFUN([AC_LTDL_ENABLE_INSTALL]) m4trace:m4/lt~obsolete.m4:46: -1- AC_DEFUN([AC_LTDL_PREOPEN]) m4trace:m4/lt~obsolete.m4:47: -1- AC_DEFUN([_LT_AC_SYS_COMPILER]) m4trace:m4/lt~obsolete.m4:48: -1- AC_DEFUN([_LT_AC_LOCK]) m4trace:m4/lt~obsolete.m4:49: -1- AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE]) m4trace:m4/lt~obsolete.m4:50: -1- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF]) m4trace:m4/lt~obsolete.m4:51: -1- AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O]) m4trace:m4/lt~obsolete.m4:52: -1- AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS]) m4trace:m4/lt~obsolete.m4:53: -1- AC_DEFUN([AC_LIBTOOL_OBJDIR]) m4trace:m4/lt~obsolete.m4:54: -1- AC_DEFUN([AC_LTDL_OBJDIR]) m4trace:m4/lt~obsolete.m4:55: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH]) m4trace:m4/lt~obsolete.m4:56: -1- AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP]) m4trace:m4/lt~obsolete.m4:57: -1- AC_DEFUN([AC_PATH_MAGIC]) m4trace:m4/lt~obsolete.m4:58: -1- AC_DEFUN([AC_PROG_LD_GNU]) m4trace:m4/lt~obsolete.m4:59: -1- AC_DEFUN([AC_PROG_LD_RELOAD_FLAG]) m4trace:m4/lt~obsolete.m4:60: -1- AC_DEFUN([AC_DEPLIBS_CHECK_METHOD]) m4trace:m4/lt~obsolete.m4:61: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI]) m4trace:m4/lt~obsolete.m4:62: -1- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) m4trace:m4/lt~obsolete.m4:63: -1- AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC]) m4trace:m4/lt~obsolete.m4:64: -1- AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS]) m4trace:m4/lt~obsolete.m4:65: -1- AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP]) m4trace:m4/lt~obsolete.m4:66: -1- AC_DEFUN([LT_AC_PROG_EGREP]) m4trace:m4/lt~obsolete.m4:71: -1- AC_DEFUN([_AC_PROG_LIBTOOL]) m4trace:m4/lt~obsolete.m4:72: -1- AC_DEFUN([AC_LIBTOOL_SETUP]) m4trace:m4/lt~obsolete.m4:73: -1- AC_DEFUN([_LT_AC_CHECK_DLFCN]) m4trace:m4/lt~obsolete.m4:74: -1- AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER]) m4trace:m4/lt~obsolete.m4:75: -1- AC_DEFUN([_LT_AC_TAGCONFIG]) m4trace:m4/lt~obsolete.m4:77: -1- AC_DEFUN([_LT_AC_LANG_CXX]) m4trace:m4/lt~obsolete.m4:78: -1- AC_DEFUN([_LT_AC_LANG_F77]) m4trace:m4/lt~obsolete.m4:79: -1- AC_DEFUN([_LT_AC_LANG_GCJ]) m4trace:m4/lt~obsolete.m4:80: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) m4trace:m4/lt~obsolete.m4:81: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) m4trace:m4/lt~obsolete.m4:82: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) m4trace:m4/lt~obsolete.m4:83: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) m4trace:m4/lt~obsolete.m4:84: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) m4trace:m4/lt~obsolete.m4:85: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) m4trace:m4/lt~obsolete.m4:86: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) m4trace:m4/lt~obsolete.m4:87: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) m4trace:m4/lt~obsolete.m4:88: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) m4trace:m4/lt~obsolete.m4:89: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) m4trace:m4/lt~obsolete.m4:90: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) m4trace:m4/lt~obsolete.m4:91: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) m4trace:m4/lt~obsolete.m4:93: -1- AC_DEFUN([_LT_AC_PROG_CXXCPP]) m4trace:m4/lt~obsolete.m4:96: -1- AC_DEFUN([_LT_PROG_F77]) m4trace:m4/lt~obsolete.m4:97: -1- AC_DEFUN([_LT_PROG_FC]) m4trace:m4/lt~obsolete.m4:98: -1- AC_DEFUN([_LT_PROG_CXX]) m4trace:m4/vmtools.m4:53: -1- AC_DEFUN([AC_VMW_CHECK_LIB], [ AC_REQUIRE([AC_CHECK_LIB]) dnl AC_REQUIRE([AC_CHECK_HEADER]) dnl if test -z "$1"; then AC_MSG_ERROR(['library' parameter is required.']) fi if test -z "$2"; then AC_MSG_ERROR(['lvar' parameter is required.']) fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_$2_CPPFLAGS}" || test -n "${CUSTOM_$2_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_$2_LIBS} -l$1" if test -n "$6"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_$2_CPPFLAGS} $CPPFLAGS" AC_CHECK_HEADER([$6], [ac_vmw_have_lib_header=1]) CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "$7"; then ac_vmw_function=$7 else ac_vmw_function=strlen fi AC_CHECK_LIB( [$1], [$ac_vmw_function], [ac_vmw_have_lib_func=1], [], [$ac_vmw_custom_libs]) fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then $2_CPPFLAGS="${CUSTOM_$2_CPPFLAGS}" $2_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "$3"; then if test -n "$5"; then AC_MSG_CHECKING([for $3 >= $5 (via pkg-config)]) if pkg-config --exists '$3 >= $5'; then ac_vmw_have_lib=1 fi else AC_MSG_CHECKING([for $3 (via pkg-config)]) if pkg-config --exists '$3'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags $3`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs $3`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then AC_MSG_RESULT([yes]) $2_CPPFLAGS="$ac_vmw_cppflags" $2_LIBS="$ac_vmw_libs" else AC_MSG_RESULT([no]) fi else AC_MSG_RESULT([no]) fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "$4"; then AC_PATH_PROG([ac_vmw_lib_cfg], [$4], [no]) if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then $2_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" $2_LIBS="`$ac_vmw_lib_cfg --ldflags`" else $2_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" $2_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then AC_SUBST([$2_CPPFLAGS]) AC_SUBST([$2_LIBS]) true $8 else true $9 fi ]) m4trace:m4/vmtools.m4:205: -1- AC_DEFUN([AC_VMW_CHECK_LIBXX], [ AC_REQUIRE([AC_VMW_CHECK_LIB]) AC_LANG_PUSH([C++]) AC_VMW_CHECK_LIB([$1], [$2], [$3], [$4], [$5], [$6], [$7], [$8], [$9]) AC_LANG_POP([C++]) ]) m4trace:m4/vmtools.m4:227: -1- AC_DEFUN([AC_VMW_CHECK_X11_LIB], [ have_header=1 if test -n "$2"; then AC_CHECK_HEADER( [X11/extensions/scrnsaver.h], [], [ have_header=0; $4 ], []) fi if test $have_header = 1; then AC_CHECK_LIB( [$1], [$3], [COMMON_XLIBS="-l$1 $COMMON_XLIBS"], [$4], [$COMMON_XLIBS]) fi ]) m4trace:m4/vmtools.m4:260: -1- AC_DEFUN([AC_VMW_LIB_ERROR], [ feature="$3" if test -z "$feature"; then feature="$1" fi AC_MSG_ERROR([Cannot find $1 library. Please configure without $feature (using --without-$2), or install the $1 libraries and devel package(s).]) ]) m4trace:m4/vmtools.m4:279: -1- AC_DEFUN([AC_VMW_DEFAULT_FLAGS], [ if test -z "$CUSTOM_$1_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_$1_CPPFLAGS="-I/usr/local/include" else CUSTOM_$1_CPPFLAGS="-I/usr/include" fi if test -n "$2"; then CUSTOM_$1_CPPFLAGS="${CUSTOM_$1_CPPFLAGS}/$2" fi fi ]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:43: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:43: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:43: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^prefix$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^bindir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^datadir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^includedir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^docdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^infodir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^psdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^libdir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^localedir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^mandir$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.ac:43: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host_cpu$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host_vendor$]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host_os$]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:213: -1- AM_INIT_AUTOMAKE m4trace:configure.ac:213: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:213: -1- AM_SET_CURRENT_AUTOMAKE_VERSION m4trace:configure.ac:213: -1- AM_AUTOMAKE_VERSION([1.10]) m4trace:configure.ac:213: -1- _AM_AUTOCONF_VERSION([2.61]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__isrc$]) m4trace:configure.ac:213: -1- _AM_SUBST_NOTMAKE([am__isrc]) m4trace:configure.ac:213: -1- m4_pattern_allow([^CYGPATH_W$]) m4trace:configure.ac:213: -1- _AM_SET_OPTIONS([]) m4trace:configure.ac:213: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from... /usr/local/share/aclocal-1.10/options.m4:25: _AM_SET_OPTIONS is expanded from... /usr/local/share/aclocal-1.10/init.m4:26: AM_INIT_AUTOMAKE is expanded from... configure.ac:213: the top level]) m4trace:configure.ac:213: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:213: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])]) m4trace:configure.ac:213: -2- _AM_MANGLE_OPTION([no-define]) m4trace:configure.ac:213: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:213: -1- AM_SANITY_CHECK m4trace:configure.ac:213: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) m4trace:configure.ac:213: -1- AM_MISSING_HAS_RUN m4trace:configure.ac:213: -1- AM_AUX_DIR_EXPAND m4trace:configure.ac:213: -1- m4_pattern_allow([^ACLOCAL$]) m4trace:configure.ac:213: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AUTOCONF$]) m4trace:configure.ac:213: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AUTOMAKE$]) m4trace:configure.ac:213: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AUTOHEADER$]) m4trace:configure.ac:213: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) m4trace:configure.ac:213: -1- m4_pattern_allow([^MAKEINFO$]) m4trace:configure.ac:213: -1- AM_PROG_INSTALL_SH m4trace:configure.ac:213: -1- m4_pattern_allow([^install_sh$]) m4trace:configure.ac:213: -1- AM_PROG_INSTALL_STRIP m4trace:configure.ac:213: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) m4trace:configure.ac:213: -1- AM_PROG_MKDIR_P m4trace:configure.ac:213: -1- m4_pattern_allow([^mkdir_p$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AWK$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^SET_MAKE$]) m4trace:configure.ac:213: -1- AM_SET_LEADING_DOT m4trace:configure.ac:213: -1- m4_pattern_allow([^am__leading_dot$]) m4trace:configure.ac:213: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) m4trace:configure.ac:213: -2- _AM_MANGLE_OPTION([tar-ustar]) m4trace:configure.ac:213: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) m4trace:configure.ac:213: -2- _AM_MANGLE_OPTION([tar-pax]) m4trace:configure.ac:213: -1- _AM_PROG_TAR([v7]) m4trace:configure.ac:213: -1- AM_MISSING_PROG([AMTAR], [tar]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AMTAR$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__tar$]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__untar$]) m4trace:configure.ac:213: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) m4trace:configure.ac:213: -2- _AM_MANGLE_OPTION([no-dependencies]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^OBJEXT$]) m4trace:configure.ac:236: -1- _AM_DEPENDENCIES([CC]) m4trace:configure.ac:236: -1- AM_SET_DEPDIR m4trace:configure.ac:236: -1- m4_pattern_allow([^DEPDIR$]) m4trace:configure.ac:236: -1- AM_OUTPUT_DEPENDENCY_COMMANDS m4trace:configure.ac:236: -1- AM_MAKE_INCLUDE m4trace:configure.ac:236: -1- m4_pattern_allow([^am__include$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__quote$]) m4trace:configure.ac:236: -1- AM_DEP_TRACK m4trace:configure.ac:236: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) m4trace:configure.ac:236: -1- m4_pattern_allow([^AMDEP_TRUE$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^AMDEP_FALSE$]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:236: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:237: -1- _AM_DEPENDENCIES([CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:237: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:237: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:237: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXX$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXXFLAGS$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXX$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^ac_ct_CXX$]) m4trace:configure.ac:241: -1- _AM_DEPENDENCIES([CXX]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXXDEPMODE$]) m4trace:configure.ac:241: -1- AM_CONDITIONAL([am__fastdepCXX], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:241: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) m4trace:configure.ac:241: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) m4trace:configure.ac:241: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) m4trace:configure.ac:241: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) m4trace:configure.ac:246: -1- AM_PROG_CC_C_O m4trace:configure.ac:246: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) m4trace:configure.ac:249: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:249: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:249: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:250: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:250: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:251: -1- m4_pattern_allow([^LN_S$]) m4trace:configure.ac:255: -1- AC_PROG_LIBTOOL m4trace:configure.ac:255: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.], [m4/libtool.m4:107: AC_PROG_LIBTOOL is expanded from... configure.ac:255: the top level]) m4trace:configure.ac:255: -1- LT_INIT m4trace:configure.ac:255: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) m4trace:configure.ac:255: -1- LTOPTIONS_VERSION m4trace:configure.ac:255: -1- LTSUGAR_VERSION m4trace:configure.ac:255: -1- LTVERSION_VERSION m4trace:configure.ac:255: -1- LTOBSOLETE_VERSION m4trace:configure.ac:255: -1- _LT_PROG_LTMAIN m4trace:configure.ac:255: -1- m4_pattern_allow([^LIBTOOL$]) m4trace:configure.ac:255: -1- _LT_PREPARE_SED_QUOTE_VARS m4trace:configure.ac:255: -1- _LT_PROG_ECHO_BACKSLASH m4trace:configure.ac:255: -1- LT_PATH_LD m4trace:configure.ac:255: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:255: -1- AC_PROG_EGREP m4trace:configure.ac:255: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:255: -1- LT_PATH_NM m4trace:configure.ac:255: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^NM$]) m4trace:configure.ac:255: -1- LT_CMD_MAX_LEN m4trace:configure.ac:255: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^AR$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^RANLIB$]) m4trace:configure.ac:255: -1- _LT_WITH_SYSROOT m4trace:configure.ac:255: -1- m4_pattern_allow([LT_OBJDIR]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LT_OBJDIR$]) m4trace:configure.ac:255: -1- _LT_CC_BASENAME([$compiler]) m4trace:configure.ac:255: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:255: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) m4trace:configure.ac:255: -1- LT_SUPPORTED_TAG([CC]) m4trace:configure.ac:255: -1- _LT_COMPILER_BOILERPLATE m4trace:configure.ac:255: -1- _LT_LINKER_BOILERPLATE m4trace:configure.ac:255: -1- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) m4trace:configure.ac:255: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, ) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, )], [$_LT_TAGVAR(lt_prog_compiler_pic, )@&t@m4_if([],[],[ -DPIC],[m4_if([],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, ) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, )=" $_LT_TAGVAR(lt_prog_compiler_pic, )" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, )= _LT_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) m4trace:configure.ac:255: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, )=]) m4trace:configure.ac:255: -1- m4_pattern_allow([^MANIFEST_TOOL$]) m4trace:configure.ac:255: -1- _LT_REQUIRED_DARWIN_CHECKS m4trace:configure.ac:255: -1- m4_pattern_allow([^DSYMUTIL$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^NMEDIT$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LIPO$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OTOOL$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OTOOL64$]) m4trace:configure.ac:255: -1- _LT_LINKER_OPTION([if $CC understands -b], [lt_cv_prog_compiler__b], [-b], [_LT_TAGVAR(archive_cmds, )='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, )='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags']) m4trace:configure.ac:255: -1- LT_SYS_DLOPEN_SELF m4trace:configure.ac:255: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:255: -1- LT_LANG([CXX]) m4trace:configure.ac:255: -1- LT_SUPPORTED_TAG([CXX]) m4trace:configure.ac:255: -1- m4_pattern_allow([^CXXCPP$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^CXXCPP$]) m4trace:configure.ac:255: -1- _LT_COMPILER_BOILERPLATE m4trace:configure.ac:255: -1- _LT_LINKER_BOILERPLATE m4trace:configure.ac:255: -1- _LT_CC_BASENAME([$compiler]) m4trace:configure.ac:255: -1- LT_PATH_LD m4trace:configure.ac:255: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:255: -1- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, CXX) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, CXX)], [$_LT_TAGVAR(lt_prog_compiler_pic, CXX)@&t@m4_if([CXX],[],[ -DPIC],[m4_if([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, CXX) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, CXX)=" $_LT_TAGVAR(lt_prog_compiler_pic, CXX)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, CXX)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, CXX)=no]) m4trace:configure.ac:255: -1- _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_cv_prog_compiler_static_works_CXX], [$lt_tmp_static_flag], [], [_LT_TAGVAR(lt_prog_compiler_static, CXX)=]) m4trace:configure.ac:261: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) m4trace:configure.ac:275: -1- m4_pattern_allow([^XMKMF$]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_CFLAGS$]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_PRE_LIBS$]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_LIBS$]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) m4trace:configure.ac:302: -1- AC_VMW_CHECK_LIB([mspack], [MSPACK], [libmspack], [], [0.0.20040308alpha], [mspack.h], [], [], [AC_MSG_ERROR([mspack >= 0.0.20040308alpha is required.])]) m4trace:configure.ac:302: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:302: -1- m4_pattern_allow([^MSPACK_CPPFLAGS$]) m4trace:configure.ac:302: -1- m4_pattern_allow([^MSPACK_LIBS$]) m4trace:configure.ac:322: -1- AC_VMW_CHECK_LIB([glib-2.0], [GLIB2], [glib-2.0], [], [2.14.0], [glib.h], [g_key_file_new], [], [AC_MSG_ERROR([glib2 >= 2.14.0 is required.])]) m4trace:configure.ac:322: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:322: -1- m4_pattern_allow([^GLIB2_CPPFLAGS$]) m4trace:configure.ac:322: -1- m4_pattern_allow([^GLIB2_LIBS$]) m4trace:configure.ac:332: -1- AC_VMW_CHECK_LIB([gmodule-2.0], [GMODULE], [gmodule-2.0], [], [2.14.0], [], [], [], [AC_MSG_ERROR([gmodule >= 2.14.0 is required.])]) m4trace:configure.ac:332: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:332: -1- m4_pattern_allow([^GMODULE_CPPFLAGS$]) m4trace:configure.ac:332: -1- m4_pattern_allow([^GMODULE_LIBS$]) m4trace:configure.ac:341: -1- AC_VMW_CHECK_LIB([gobject-2.0], [GOBJECT], [gobject-2.0], [], [2.14.0], [glib-object.h], [], [], [AC_MSG_ERROR([gobject >= 2.14.0 is required.])]) m4trace:configure.ac:341: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:341: -1- m4_pattern_allow([^GOBJECT_CPPFLAGS$]) m4trace:configure.ac:341: -1- m4_pattern_allow([^GOBJECT_LIBS$]) m4trace:configure.ac:350: -1- AC_VMW_CHECK_LIB([gthread-2.0], [GTHREAD], [gthread-2.0], [], [2.14.0], [], [], [], [AC_MSG_ERROR([glib >= 2.14.0 is required.])]) m4trace:configure.ac:350: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:350: -1- m4_pattern_allow([^GTHREAD_CPPFLAGS$]) m4trace:configure.ac:350: -1- m4_pattern_allow([^GTHREAD_LIBS$]) m4trace:configure.ac:359: -1- m4_pattern_allow([^have_genmarshal$]) m4trace:configure.ac:371: -1- AC_VMW_CHECK_LIB([fuse], [FUSE], [fuse], [], [], [fuse.h], [fuse_main], [have_fuse=yes], [have_fuse=no; AC_MSG_WARN([Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled.])]) m4trace:configure.ac:371: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:371: -1- m4_pattern_allow([^FUSE_CPPFLAGS$]) m4trace:configure.ac:371: -1- m4_pattern_allow([^FUSE_LIBS$]) m4trace:configure.ac:392: -1- AC_VMW_DEFAULT_FLAGS([PAM]) m4trace:configure.ac:393: -1- AC_VMW_CHECK_LIB([pam], [PAM], [], [], [], [security/pam_appl.h], [pam_start], [PAM_CPPFLAGS="$PAM_CPPFLAGS -DUSE_PAM"], [AC_VMW_LIB_ERROR([PAM], [pam])]) m4trace:configure.ac:393: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:393: -1- m4_pattern_allow([^PAM_CPPFLAGS$]) m4trace:configure.ac:393: -1- m4_pattern_allow([^PAM_LIBS$]) m4trace:configure.ac:393: -1- AC_VMW_LIB_ERROR([PAM], [pam]) m4trace:configure.ac:435: -1- AC_VMW_DEFAULT_FLAGS([SSL]) m4trace:configure.ac:436: -1- AC_VMW_CHECK_LIB([ssl], [SSL], [], [], [], [], [], [], [AC_VMW_LIB_ERROR([SSL], [ssl])]) m4trace:configure.ac:436: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:436: -1- m4_pattern_allow([^SSL_CPPFLAGS$]) m4trace:configure.ac:436: -1- m4_pattern_allow([^SSL_LIBS$]) m4trace:configure.ac:436: -1- AC_VMW_LIB_ERROR([SSL], [ssl]) m4trace:configure.ac:449: -1- AC_VMW_DEFAULT_FLAGS([XERCES]) m4trace:configure.ac:450: -1- AC_VMW_CHECK_LIB([xerces-c], [XERCES], [], [], [], [], [], [], [AC_VMW_LIB_ERROR([XERCES], [xerces-c])]) m4trace:configure.ac:450: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:450: -1- m4_pattern_allow([^XERCES_CPPFLAGS$]) m4trace:configure.ac:450: -1- m4_pattern_allow([^XERCES_LIBS$]) m4trace:configure.ac:450: -1- AC_VMW_LIB_ERROR([XERCES], [xerces-c]) m4trace:configure.ac:460: -1- AC_VMW_DEFAULT_FLAGS([XMLSECURITY]) m4trace:configure.ac:461: -1- AC_VMW_CHECK_LIB([xml-security-c], [XMLSECURITY], [], [], [], [], [], [], [AC_VMW_LIB_ERROR([XMLSECURITY], [xml-security-c])]) m4trace:configure.ac:461: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:461: -1- m4_pattern_allow([^XMLSECURITY_CPPFLAGS$]) m4trace:configure.ac:461: -1- m4_pattern_allow([^XMLSECURITY_LIBS$]) m4trace:configure.ac:461: -1- AC_VMW_LIB_ERROR([XMLSECURITY], [xml-security-c]) m4trace:configure.ac:476: -1- AC_VMW_DEFAULT_FLAGS([CUNIT]) m4trace:configure.ac:477: -1- AC_VMW_CHECK_LIB([cunit], [CUNIT], [], [], [], [CUnit/CUnit.h], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) m4trace:configure.ac:477: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:477: -1- m4_pattern_allow([^CUNIT_CPPFLAGS$]) m4trace:configure.ac:477: -1- m4_pattern_allow([^CUNIT_LIBS$]) m4trace:configure.ac:488: -1- AC_VMW_LIB_ERROR([CUNIT], [cunit]) m4trace:configure.ac:596: -1- AC_VMW_CHECK_LIB([gtk-x11-2.0], [GTK], [gtk+-2.0], [], [2.4.0], [gtk/gtk.h], [gdk_display_get_default_group], [GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2"], [AC_MSG_ERROR([Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package.])]) m4trace:configure.ac:596: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:596: -1- m4_pattern_allow([^GTK_CPPFLAGS$]) m4trace:configure.ac:596: -1- m4_pattern_allow([^GTK_LIBS$]) m4trace:configure.ac:613: -1- AC_VMW_CHECK_LIBXX([gtkmm-2.4], [GTKMM], [gtkmm-2.4], [], [2.4.0], [gtkmm.h], [], [GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"], [AC_MSG_ERROR([gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm.])]) m4trace:configure.ac:613: -1- AC_VMW_CHECK_LIB([gtkmm-2.4], [GTKMM], [gtkmm-2.4], [], [2.4.0], [gtkmm.h], [], [GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"], [AC_MSG_ERROR([gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm.])]) m4trace:configure.ac:613: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:613: -1- m4_pattern_allow([^GTKMM_CPPFLAGS$]) m4trace:configure.ac:613: -1- m4_pattern_allow([^GTKMM_LIBS$]) m4trace:configure.ac:687: -1- AC_VMW_CHECK_LIB([procps-ng], [PROCPS], [libprocps], [], [], [], [], [ have_procps=yes; ], []) m4trace:configure.ac:687: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:687: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:687: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:719: -1- AC_VMW_CHECK_LIB([$CUSTOM_PROCPS_NAME], [PROCPS], [], [], [], [], [getstat], [ have_procps=yes; ], []) m4trace:configure.ac:719: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:719: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:719: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:733: -1- AC_VMW_CHECK_LIB([proc-3.2.8], [PROCPS], [], [], [], [], [getstat], [ have_procps=yes; ], []) m4trace:configure.ac:733: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:733: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:733: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:747: -1- AC_VMW_CHECK_LIB([proc-3.2.7], [PROCPS], [], [], [], [], [getstat], [], [AC_MSG_ERROR([libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])]) m4trace:configure.ac:747: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:747: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:747: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:760: -1- m4_pattern_allow([^NO_PROCPS$]) m4trace:configure.ac:774: -1- AC_VMW_CHECK_LIB([dumbnet], [DNET], [], [dumbnet-config], [], [dumbnet.h], [intf_open], [have_dnet="yes"; AC_DEFINE([DNET_IS_DUMBNET], 1, [Define to 1 if substituting Debian's libdumbnet for libdnet.])], []) m4trace:configure.ac:774: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:774: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) m4trace:configure.ac:774: -1- m4_pattern_allow([^DNET_LIBS$]) m4trace:configure.ac:774: -1- m4_pattern_allow([^DNET_IS_DUMBNET$]) m4trace:configure.ac:786: -1- AC_VMW_CHECK_LIB([dnet], [DNET], [], [dnet-config], [], [dnet.h], [intf_open], [have_dnet="yes"], []) m4trace:configure.ac:786: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:786: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) m4trace:configure.ac:786: -1- m4_pattern_allow([^DNET_LIBS$]) m4trace:configure.ac:804: -1- m4_pattern_allow([^NO_DNET$]) m4trace:configure.ac:814: -1- m4_pattern_allow([^have_cxx$]) m4trace:configure.ac:821: -1- AC_VMW_CHECK_LIBXX([icuuc], [ICU], [], [icu-config], [], [unicode/utf.h], [], [ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU"], [AC_MSG_ERROR([ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org])]) m4trace:configure.ac:821: -1- AC_VMW_CHECK_LIB([icuuc], [ICU], [], [icu-config], [], [unicode/utf.h], [], [ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU"], [AC_MSG_ERROR([ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org])]) m4trace:configure.ac:821: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:821: -1- m4_pattern_allow([^ICU_CPPFLAGS$]) m4trace:configure.ac:821: -1- m4_pattern_allow([^ICU_LIBS$]) m4trace:configure.ac:835: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:835: the top level]) m4trace:configure.ac:854: -1- m4_pattern_allow([^RPCGEN$]) m4trace:configure.ac:919: -1- m4_pattern_allow([^HAVE__BOOL$]) m4trace:configure.ac:919: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) m4trace:configure.ac:920: -1- m4_pattern_allow([^const$]) m4trace:configure.ac:921: -1- m4_pattern_allow([^uid_t$]) m4trace:configure.ac:921: -1- m4_pattern_allow([^gid_t$]) m4trace:configure.ac:923: -1- m4_pattern_allow([^mode_t$]) m4trace:configure.ac:924: -1- m4_pattern_allow([^off_t$]) m4trace:configure.ac:925: -1- m4_pattern_allow([^pid_t$]) m4trace:configure.ac:926: -1- m4_pattern_allow([^size_t$]) m4trace:configure.ac:927: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) m4trace:configure.ac:928: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) m4trace:configure.ac:929: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) m4trace:configure.ac:930: -1- m4_pattern_allow([^volatile$]) m4trace:configure.ac:950: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:950: the top level]) m4trace:configure.ac:967: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:967: the top level]) m4trace:configure.ac:978: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:978: the top level]) m4trace:configure.ac:997: -1- m4_pattern_allow([^have_doxygen$]) m4trace:configure.ac:1004: -1- m4_pattern_allow([^DOT$]) m4trace:configure.ac:1011: -1- m4_pattern_allow([^DOT$]) m4trace:configure.ac:1012: -1- m4_pattern_allow([^HAVE_DOT$]) m4trace:configure.ac:1014: -1- m4_pattern_allow([^MSCGEN$]) m4trace:configure.ac:1022: -1- m4_pattern_allow([^MSCGEN_DIR$]) m4trace:configure.ac:1132: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) m4trace:configure.ac:1132: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) m4trace:configure.ac:1132: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) m4trace:configure.ac:1132: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) m4trace:configure.ac:1132: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) m4trace:configure.ac:1133: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) m4trace:configure.ac:1133: -1- m4_pattern_allow([^LINUX_TRUE$]) m4trace:configure.ac:1133: -1- m4_pattern_allow([^LINUX_FALSE$]) m4trace:configure.ac:1133: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) m4trace:configure.ac:1133: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) m4trace:configure.ac:1134: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) m4trace:configure.ac:1134: -1- m4_pattern_allow([^SOLARIS_TRUE$]) m4trace:configure.ac:1134: -1- m4_pattern_allow([^SOLARIS_FALSE$]) m4trace:configure.ac:1134: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) m4trace:configure.ac:1134: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) m4trace:configure.ac:1135: -1- AM_CONDITIONAL([FREEBSD], [test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu"]) m4trace:configure.ac:1135: -1- m4_pattern_allow([^FREEBSD_TRUE$]) m4trace:configure.ac:1135: -1- m4_pattern_allow([^FREEBSD_FALSE$]) m4trace:configure.ac:1135: -1- _AM_SUBST_NOTMAKE([FREEBSD_TRUE]) m4trace:configure.ac:1135: -1- _AM_SUBST_NOTMAKE([FREEBSD_FALSE]) m4trace:configure.ac:1136: -1- AM_CONDITIONAL([FREEBSD_CUSTOM_SYSDIR], [test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR"]) m4trace:configure.ac:1136: -1- m4_pattern_allow([^FREEBSD_CUSTOM_SYSDIR_TRUE$]) m4trace:configure.ac:1136: -1- m4_pattern_allow([^FREEBSD_CUSTOM_SYSDIR_FALSE$]) m4trace:configure.ac:1136: -1- _AM_SUBST_NOTMAKE([FREEBSD_CUSTOM_SYSDIR_TRUE]) m4trace:configure.ac:1136: -1- _AM_SUBST_NOTMAKE([FREEBSD_CUSTOM_SYSDIR_FALSE]) m4trace:configure.ac:1138: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) m4trace:configure.ac:1138: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) m4trace:configure.ac:1138: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) m4trace:configure.ac:1138: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) m4trace:configure.ac:1138: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) m4trace:configure.ac:1139: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) m4trace:configure.ac:1139: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) m4trace:configure.ac:1139: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) m4trace:configure.ac:1139: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) m4trace:configure.ac:1139: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) m4trace:configure.ac:1140: -1- AM_CONDITIONAL([HAVE_ICU], [test "$with_icu" = "yes"]) m4trace:configure.ac:1140: -1- m4_pattern_allow([^HAVE_ICU_TRUE$]) m4trace:configure.ac:1140: -1- m4_pattern_allow([^HAVE_ICU_FALSE$]) m4trace:configure.ac:1140: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_TRUE]) m4trace:configure.ac:1140: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_FALSE]) m4trace:configure.ac:1141: -1- AM_CONDITIONAL([WITH_KERNEL_MODULES], [test "$with_kernel_modules" = "yes"]) m4trace:configure.ac:1141: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_TRUE$]) m4trace:configure.ac:1141: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_FALSE$]) m4trace:configure.ac:1141: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_TRUE]) m4trace:configure.ac:1141: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_FALSE]) m4trace:configure.ac:1142: -1- AM_CONDITIONAL([HAVE_XSM], [test "$have_xsm" = "yes"]) m4trace:configure.ac:1142: -1- m4_pattern_allow([^HAVE_XSM_TRUE$]) m4trace:configure.ac:1142: -1- m4_pattern_allow([^HAVE_XSM_FALSE$]) m4trace:configure.ac:1142: -1- _AM_SUBST_NOTMAKE([HAVE_XSM_TRUE]) m4trace:configure.ac:1142: -1- _AM_SUBST_NOTMAKE([HAVE_XSM_FALSE]) m4trace:configure.ac:1143: -1- AM_CONDITIONAL([HAVE_XCOMPOSITE], [test "$have_xcomposite" = "yes"]) m4trace:configure.ac:1143: -1- m4_pattern_allow([^HAVE_XCOMPOSITE_TRUE$]) m4trace:configure.ac:1143: -1- m4_pattern_allow([^HAVE_XCOMPOSITE_FALSE$]) m4trace:configure.ac:1143: -1- _AM_SUBST_NOTMAKE([HAVE_XCOMPOSITE_TRUE]) m4trace:configure.ac:1143: -1- _AM_SUBST_NOTMAKE([HAVE_XCOMPOSITE_FALSE]) m4trace:configure.ac:1144: -1- AM_CONDITIONAL([ENABLE_TESTS], [test "$have_cunit" = "yes"]) m4trace:configure.ac:1144: -1- m4_pattern_allow([^ENABLE_TESTS_TRUE$]) m4trace:configure.ac:1144: -1- m4_pattern_allow([^ENABLE_TESTS_FALSE$]) m4trace:configure.ac:1144: -1- _AM_SUBST_NOTMAKE([ENABLE_TESTS_TRUE]) m4trace:configure.ac:1144: -1- _AM_SUBST_NOTMAKE([ENABLE_TESTS_FALSE]) m4trace:configure.ac:1145: -1- AM_CONDITIONAL([WITH_ROOT_PRIVILEGES], [test "$with_root_privileges" = "yes"]) m4trace:configure.ac:1145: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_TRUE$]) m4trace:configure.ac:1145: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_FALSE$]) m4trace:configure.ac:1145: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_TRUE]) m4trace:configure.ac:1145: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_FALSE]) m4trace:configure.ac:1146: -1- AM_CONDITIONAL([HAVE_DNET], [test "$have_dnet" = "yes"]) m4trace:configure.ac:1146: -1- m4_pattern_allow([^HAVE_DNET_TRUE$]) m4trace:configure.ac:1146: -1- m4_pattern_allow([^HAVE_DNET_FALSE$]) m4trace:configure.ac:1146: -1- _AM_SUBST_NOTMAKE([HAVE_DNET_TRUE]) m4trace:configure.ac:1146: -1- _AM_SUBST_NOTMAKE([HAVE_DNET_FALSE]) m4trace:configure.ac:1147: -1- AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = "yes"]) m4trace:configure.ac:1147: -1- m4_pattern_allow([^HAVE_DOXYGEN_TRUE$]) m4trace:configure.ac:1147: -1- m4_pattern_allow([^HAVE_DOXYGEN_FALSE$]) m4trace:configure.ac:1147: -1- _AM_SUBST_NOTMAKE([HAVE_DOXYGEN_TRUE]) m4trace:configure.ac:1147: -1- _AM_SUBST_NOTMAKE([HAVE_DOXYGEN_FALSE]) m4trace:configure.ac:1148: -1- AM_CONDITIONAL([HAVE_FUSE], [test "$have_fuse" = "yes"]) m4trace:configure.ac:1148: -1- m4_pattern_allow([^HAVE_FUSE_TRUE$]) m4trace:configure.ac:1148: -1- m4_pattern_allow([^HAVE_FUSE_FALSE$]) m4trace:configure.ac:1148: -1- _AM_SUBST_NOTMAKE([HAVE_FUSE_TRUE]) m4trace:configure.ac:1148: -1- _AM_SUBST_NOTMAKE([HAVE_FUSE_FALSE]) m4trace:configure.ac:1149: -1- AM_CONDITIONAL([HAVE_GNU_LD], [test "$with_gnu_ld" = "yes"]) m4trace:configure.ac:1149: -1- m4_pattern_allow([^HAVE_GNU_LD_TRUE$]) m4trace:configure.ac:1149: -1- m4_pattern_allow([^HAVE_GNU_LD_FALSE$]) m4trace:configure.ac:1149: -1- _AM_SUBST_NOTMAKE([HAVE_GNU_LD_TRUE]) m4trace:configure.ac:1149: -1- _AM_SUBST_NOTMAKE([HAVE_GNU_LD_FALSE]) m4trace:configure.ac:1150: -1- AM_CONDITIONAL([HAVE_GTKMM], [test "$have_x" = "yes" -a "$with_gtkmm" = "yes"]) m4trace:configure.ac:1150: -1- m4_pattern_allow([^HAVE_GTKMM_TRUE$]) m4trace:configure.ac:1150: -1- m4_pattern_allow([^HAVE_GTKMM_FALSE$]) m4trace:configure.ac:1150: -1- _AM_SUBST_NOTMAKE([HAVE_GTKMM_TRUE]) m4trace:configure.ac:1150: -1- _AM_SUBST_NOTMAKE([HAVE_GTKMM_FALSE]) m4trace:configure.ac:1151: -1- AM_CONDITIONAL([HAVE_PAM], [test "$with_pam" = "yes"]) m4trace:configure.ac:1151: -1- m4_pattern_allow([^HAVE_PAM_TRUE$]) m4trace:configure.ac:1151: -1- m4_pattern_allow([^HAVE_PAM_FALSE$]) m4trace:configure.ac:1151: -1- _AM_SUBST_NOTMAKE([HAVE_PAM_TRUE]) m4trace:configure.ac:1151: -1- _AM_SUBST_NOTMAKE([HAVE_PAM_FALSE]) m4trace:configure.ac:1152: -1- AM_CONDITIONAL([USE_SLASH_PROC], [test "$os" = "linux"]) m4trace:configure.ac:1152: -1- m4_pattern_allow([^USE_SLASH_PROC_TRUE$]) m4trace:configure.ac:1152: -1- m4_pattern_allow([^USE_SLASH_PROC_FALSE$]) m4trace:configure.ac:1152: -1- _AM_SUBST_NOTMAKE([USE_SLASH_PROC_TRUE]) m4trace:configure.ac:1152: -1- _AM_SUBST_NOTMAKE([USE_SLASH_PROC_FALSE]) m4trace:configure.ac:1153: -1- AM_CONDITIONAL([USE_PRINTF_WRAPPERS], [test "$bsdPrintfWrappers" = "yes"]) m4trace:configure.ac:1153: -1- m4_pattern_allow([^USE_PRINTF_WRAPPERS_TRUE$]) m4trace:configure.ac:1153: -1- m4_pattern_allow([^USE_PRINTF_WRAPPERS_FALSE$]) m4trace:configure.ac:1153: -1- _AM_SUBST_NOTMAKE([USE_PRINTF_WRAPPERS_TRUE]) m4trace:configure.ac:1153: -1- _AM_SUBST_NOTMAKE([USE_PRINTF_WRAPPERS_FALSE]) m4trace:configure.ac:1154: -1- AM_CONDITIONAL([ENABLE_DEPLOYPKG], [test "$enable_deploypkg" = "yes"]) m4trace:configure.ac:1154: -1- m4_pattern_allow([^ENABLE_DEPLOYPKG_TRUE$]) m4trace:configure.ac:1154: -1- m4_pattern_allow([^ENABLE_DEPLOYPKG_FALSE$]) m4trace:configure.ac:1154: -1- _AM_SUBST_NOTMAKE([ENABLE_DEPLOYPKG_TRUE]) m4trace:configure.ac:1154: -1- _AM_SUBST_NOTMAKE([ENABLE_DEPLOYPKG_FALSE]) m4trace:configure.ac:1155: -1- AM_CONDITIONAL([ENABLE_GRABBITMQPROXY], [test "$enable_grabbitmqproxy" = "yes"]) m4trace:configure.ac:1155: -1- m4_pattern_allow([^ENABLE_GRABBITMQPROXY_TRUE$]) m4trace:configure.ac:1155: -1- m4_pattern_allow([^ENABLE_GRABBITMQPROXY_FALSE$]) m4trace:configure.ac:1155: -1- _AM_SUBST_NOTMAKE([ENABLE_GRABBITMQPROXY_TRUE]) m4trace:configure.ac:1155: -1- _AM_SUBST_NOTMAKE([ENABLE_GRABBITMQPROXY_FALSE]) m4trace:configure.ac:1156: -1- AM_CONDITIONAL([ENABLE_VGAUTH], [test "$enable_vgauth" = "yes"]) m4trace:configure.ac:1156: -1- m4_pattern_allow([^ENABLE_VGAUTH_TRUE$]) m4trace:configure.ac:1156: -1- m4_pattern_allow([^ENABLE_VGAUTH_FALSE$]) m4trace:configure.ac:1156: -1- _AM_SUBST_NOTMAKE([ENABLE_VGAUTH_TRUE]) m4trace:configure.ac:1156: -1- _AM_SUBST_NOTMAKE([ENABLE_VGAUTH_FALSE]) m4trace:configure.ac:1157: -1- AM_CONDITIONAL([HAVE_VSOCK], [test "$os" = "linux"]) m4trace:configure.ac:1157: -1- m4_pattern_allow([^HAVE_VSOCK_TRUE$]) m4trace:configure.ac:1157: -1- m4_pattern_allow([^HAVE_VSOCK_FALSE$]) m4trace:configure.ac:1157: -1- _AM_SUBST_NOTMAKE([HAVE_VSOCK_TRUE]) m4trace:configure.ac:1157: -1- _AM_SUBST_NOTMAKE([HAVE_VSOCK_FALSE]) m4trace:configure.ac:1160: -1- m4_pattern_allow([^NO_XSM$]) m4trace:configure.ac:1164: -1- m4_pattern_allow([^NO_XCOMPOSITE$]) m4trace:configure.ac:1176: -1- m4_pattern_allow([^NO_MULTIMON$]) m4trace:configure.ac:1218: -1- m4_pattern_allow([^HGFS_LIBS$]) m4trace:configure.ac:1219: -1- m4_pattern_allow([^TOOLS_VERSION$]) m4trace:configure.ac:1220: -1- m4_pattern_allow([^TARGET_OS$]) m4trace:configure.ac:1221: -1- m4_pattern_allow([^KERNEL_RELEASE$]) m4trace:configure.ac:1222: -1- m4_pattern_allow([^LINUXINCLUDE$]) m4trace:configure.ac:1223: -1- m4_pattern_allow([^MODULES_OS$]) m4trace:configure.ac:1224: -1- m4_pattern_allow([^MODULES_DIR$]) m4trace:configure.ac:1225: -1- m4_pattern_allow([^MODULES$]) m4trace:configure.ac:1226: -1- m4_pattern_allow([^COMMON_XLIBS$]) m4trace:configure.ac:1227: -1- m4_pattern_allow([^XSM_LIBS$]) m4trace:configure.ac:1228: -1- m4_pattern_allow([^XCOMPOSITE_LIBS$]) m4trace:configure.ac:1229: -1- m4_pattern_allow([^PAM_PREFIX$]) m4trace:configure.ac:1230: -1- m4_pattern_allow([^PLUGIN_CPPFLAGS$]) m4trace:configure.ac:1231: -1- m4_pattern_allow([^PLUGIN_LDFLAGS$]) m4trace:configure.ac:1232: -1- m4_pattern_allow([^VMTOOLS_CPPFLAGS$]) m4trace:configure.ac:1233: -1- m4_pattern_allow([^VMTOOLS_LIBS$]) m4trace:configure.ac:1234: -1- m4_pattern_allow([^RPCGENFLAGS$]) m4trace:configure.ac:1235: -1- m4_pattern_allow([^XDR_LIBS$]) m4trace:configure.ac:1236: -1- m4_pattern_allow([^TEST_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1237: -1- m4_pattern_allow([^COMMON_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1238: -1- m4_pattern_allow([^VMSVC_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1239: -1- m4_pattern_allow([^VMUSR_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1244: -1- m4_pattern_allow([^SYSDIR$]) m4trace:configure.ac:1246: -1- m4_pattern_allow([^INSTVMSG$]) m4trace:configure.ac:1247: -1- m4_pattern_allow([^RPCGEN_WRAPPER$]) m4trace:configure.ac:1251: -1- m4_pattern_allow([^LIB_AUTH_CPPFLAGS$]) m4trace:configure.ac:1252: -1- m4_pattern_allow([^LIB_IMPERSONATE_CPPFLAGS$]) m4trace:configure.ac:1253: -1- m4_pattern_allow([^LIB_USER_CPPFLAGS$]) m4trace:configure.ac:1254: -1- m4_pattern_allow([^LIBVMTOOLS_LIBADD$]) m4trace:configure.ac:1258: -1- m4_pattern_allow([^VIX_LIBADD$]) m4trace:configure.ac:1259: -1- m4_pattern_allow([^VGAUTH_LIBADD$]) m4trace:configure.ac:1366: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.ac:1366: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.ac:1366: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS m4trace:configure.ac:1366: -1- _LT_PROG_LTMAIN open-vm-tools-10.0.7-3227872/autom4te.cache/traces.10000644000000000000000000024767412660700531020043 0ustar rootrootm4trace:aclocal.m4:897: -1- m4_include([m4/libtool.m4]) m4trace:aclocal.m4:898: -1- m4_include([m4/ltoptions.m4]) m4trace:aclocal.m4:899: -1- m4_include([m4/ltsugar.m4]) m4trace:aclocal.m4:900: -1- m4_include([m4/ltversion.m4]) m4trace:aclocal.m4:901: -1- m4_include([m4/lt~obsolete.m4]) m4trace:aclocal.m4:902: -1- m4_include([m4/vmtools.m4]) m4trace:configure.ac:43: -1- AC_INIT([open-vm-tools], [10.0.7], [open-vm-tools-devel@lists.sourceforge.net]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^_?A[CHUM]_]) m4trace:configure.ac:43: -1- m4_pattern_forbid([_AC_]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) m4trace:configure.ac:43: -1- m4_pattern_allow([^AS_FLAGS$]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^_?m4_]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^dnl$]) m4trace:configure.ac:43: -1- m4_pattern_forbid([^_?AS_]) m4trace:configure.ac:43: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([SHELL]) m4trace:configure.ac:43: -1- m4_pattern_allow([^SHELL$]) m4trace:configure.ac:43: -1- AC_SUBST([PATH_SEPARATOR]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PATH_SEPARATOR$]) m4trace:configure.ac:43: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([PACKAGE_NAME]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:43: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:43: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:43: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([PACKAGE_STRING]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:43: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:43: -1- AC_SUBST([exec_prefix], [NONE]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([exec_prefix]) m4trace:configure.ac:43: -1- m4_pattern_allow([^exec_prefix$]) m4trace:configure.ac:43: -1- AC_SUBST([prefix], [NONE]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([prefix]) m4trace:configure.ac:43: -1- m4_pattern_allow([^prefix$]) m4trace:configure.ac:43: -1- AC_SUBST([program_transform_name], [s,x,x,]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([program_transform_name]) m4trace:configure.ac:43: -1- m4_pattern_allow([^program_transform_name$]) m4trace:configure.ac:43: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([bindir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^bindir$]) m4trace:configure.ac:43: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([sbindir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^sbindir$]) m4trace:configure.ac:43: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([libexecdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^libexecdir$]) m4trace:configure.ac:43: -1- AC_SUBST([datarootdir], ['${prefix}/share']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([datarootdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^datarootdir$]) m4trace:configure.ac:43: -1- AC_SUBST([datadir], ['${datarootdir}']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([datadir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^datadir$]) m4trace:configure.ac:43: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([sysconfdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^sysconfdir$]) m4trace:configure.ac:43: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([sharedstatedir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^sharedstatedir$]) m4trace:configure.ac:43: -1- AC_SUBST([localstatedir], ['${prefix}/var']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([localstatedir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^localstatedir$]) m4trace:configure.ac:43: -1- AC_SUBST([includedir], ['${prefix}/include']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([includedir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^includedir$]) m4trace:configure.ac:43: -1- AC_SUBST([oldincludedir], ['/usr/include']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([oldincludedir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^oldincludedir$]) m4trace:configure.ac:43: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datarootdir}/doc/${PACKAGE_TARNAME}'], ['${datarootdir}/doc/${PACKAGE}'])]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([docdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^docdir$]) m4trace:configure.ac:43: -1- AC_SUBST([infodir], ['${datarootdir}/info']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([infodir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^infodir$]) m4trace:configure.ac:43: -1- AC_SUBST([htmldir], ['${docdir}']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([htmldir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^htmldir$]) m4trace:configure.ac:43: -1- AC_SUBST([dvidir], ['${docdir}']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([dvidir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^dvidir$]) m4trace:configure.ac:43: -1- AC_SUBST([pdfdir], ['${docdir}']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([pdfdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^pdfdir$]) m4trace:configure.ac:43: -1- AC_SUBST([psdir], ['${docdir}']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([psdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^psdir$]) m4trace:configure.ac:43: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([libdir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^libdir$]) m4trace:configure.ac:43: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([localedir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^localedir$]) m4trace:configure.ac:43: -1- AC_SUBST([mandir], ['${datarootdir}/man']) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([mandir]) m4trace:configure.ac:43: -1- m4_pattern_allow([^mandir$]) m4trace:configure.ac:43: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_NAME$]) m4trace:configure.ac:43: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) m4trace:configure.ac:43: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) m4trace:configure.ac:43: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) m4trace:configure.ac:43: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_VERSION$]) m4trace:configure.ac:43: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) m4trace:configure.ac:43: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_STRING$]) m4trace:configure.ac:43: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) m4trace:configure.ac:43: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) m4trace:configure.ac:43: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) m4trace:configure.ac:43: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) m4trace:configure.ac:43: -1- AC_SUBST([DEFS]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([DEFS]) m4trace:configure.ac:43: -1- m4_pattern_allow([^DEFS$]) m4trace:configure.ac:43: -1- AC_SUBST([ECHO_C]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([ECHO_C]) m4trace:configure.ac:43: -1- m4_pattern_allow([^ECHO_C$]) m4trace:configure.ac:43: -1- AC_SUBST([ECHO_N]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([ECHO_N]) m4trace:configure.ac:43: -1- m4_pattern_allow([^ECHO_N$]) m4trace:configure.ac:43: -1- AC_SUBST([ECHO_T]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([ECHO_T]) m4trace:configure.ac:43: -1- m4_pattern_allow([^ECHO_T$]) m4trace:configure.ac:43: -1- AC_SUBST([LIBS]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:43: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:43: -1- AC_SUBST([build_alias]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([build_alias]) m4trace:configure.ac:43: -1- m4_pattern_allow([^build_alias$]) m4trace:configure.ac:43: -1- AC_SUBST([host_alias]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([host_alias]) m4trace:configure.ac:43: -1- m4_pattern_allow([^host_alias$]) m4trace:configure.ac:43: -1- AC_SUBST([target_alias]) m4trace:configure.ac:43: -1- AC_SUBST_TRACE([target_alias]) m4trace:configure.ac:43: -1- m4_pattern_allow([^target_alias$]) m4trace:configure.ac:71: -1- AC_CONFIG_AUX_DIR([config]) m4trace:configure.ac:74: -1- AC_CANONICAL_HOST m4trace:configure.ac:74: -1- AC_CANONICAL_BUILD m4trace:configure.ac:74: -1- AC_REQUIRE_AUX_FILE([config.sub]) m4trace:configure.ac:74: -1- AC_REQUIRE_AUX_FILE([config.guess]) m4trace:configure.ac:74: -1- AC_SUBST([build], [$ac_cv_build]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([build]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:74: -1- AC_SUBST([build_cpu], [$[1]]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([build_cpu]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:74: -1- AC_SUBST([build_vendor], [$[2]]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([build_vendor]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:74: -1- AC_SUBST([build_os]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([build_os]) m4trace:configure.ac:74: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:74: -1- AC_SUBST([host], [$ac_cv_host]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([host]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host$]) m4trace:configure.ac:74: -1- AC_SUBST([host_cpu], [$[1]]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([host_cpu]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host_cpu$]) m4trace:configure.ac:74: -1- AC_SUBST([host_vendor], [$[2]]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([host_vendor]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host_vendor$]) m4trace:configure.ac:74: -1- AC_SUBST([host_os]) m4trace:configure.ac:74: -1- AC_SUBST_TRACE([host_os]) m4trace:configure.ac:74: -1- m4_pattern_allow([^host_os$]) m4trace:configure.ac:75: -1- AC_CANONICAL_BUILD m4trace:configure.ac:75: -1- AC_REQUIRE_AUX_FILE([config.sub]) m4trace:configure.ac:75: -1- AC_REQUIRE_AUX_FILE([config.guess]) m4trace:configure.ac:75: -1- AC_SUBST([build], [$ac_cv_build]) m4trace:configure.ac:75: -1- AC_SUBST_TRACE([build]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build$]) m4trace:configure.ac:75: -1- AC_SUBST([build_cpu], [$[1]]) m4trace:configure.ac:75: -1- AC_SUBST_TRACE([build_cpu]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build_cpu$]) m4trace:configure.ac:75: -1- AC_SUBST([build_vendor], [$[2]]) m4trace:configure.ac:75: -1- AC_SUBST_TRACE([build_vendor]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build_vendor$]) m4trace:configure.ac:75: -1- AC_SUBST([build_os]) m4trace:configure.ac:75: -1- AC_SUBST_TRACE([build_os]) m4trace:configure.ac:75: -1- m4_pattern_allow([^build_os$]) m4trace:configure.ac:213: -1- AM_INIT_AUTOMAKE m4trace:configure.ac:213: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) m4trace:configure.ac:213: -1- AM_AUTOMAKE_VERSION([1.10]) m4trace:configure.ac:213: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.ac:213: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:213: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:213: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([INSTALL_DATA]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:213: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([am__isrc]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__isrc$]) m4trace:configure.ac:213: -1- _AM_SUBST_NOTMAKE([am__isrc]) m4trace:configure.ac:213: -1- AC_SUBST([CYGPATH_W]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([CYGPATH_W]) m4trace:configure.ac:213: -1- m4_pattern_allow([^CYGPATH_W$]) m4trace:configure.ac:213: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from... aclocal.m4:700: _AM_SET_OPTIONS is expanded from... aclocal.m4:393: AM_INIT_AUTOMAKE is expanded from... configure.ac:213: the top level]) m4trace:configure.ac:213: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([PACKAGE]) m4trace:configure.ac:213: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:213: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([VERSION]) m4trace:configure.ac:213: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:213: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) m4trace:configure.ac:213: -1- m4_pattern_allow([^PACKAGE$]) m4trace:configure.ac:213: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ #undef PACKAGE]) m4trace:configure.ac:213: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) m4trace:configure.ac:213: -1- m4_pattern_allow([^VERSION$]) m4trace:configure.ac:213: -1- AH_OUTPUT([VERSION], [/* Version number of package */ #undef VERSION]) m4trace:configure.ac:213: -1- AC_REQUIRE_AUX_FILE([missing]) m4trace:configure.ac:213: -1- AC_SUBST([ACLOCAL]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([ACLOCAL]) m4trace:configure.ac:213: -1- m4_pattern_allow([^ACLOCAL$]) m4trace:configure.ac:213: -1- AC_SUBST([AUTOCONF]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([AUTOCONF]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AUTOCONF$]) m4trace:configure.ac:213: -1- AC_SUBST([AUTOMAKE]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([AUTOMAKE]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AUTOMAKE$]) m4trace:configure.ac:213: -1- AC_SUBST([AUTOHEADER]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([AUTOHEADER]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AUTOHEADER$]) m4trace:configure.ac:213: -1- AC_SUBST([MAKEINFO]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([MAKEINFO]) m4trace:configure.ac:213: -1- m4_pattern_allow([^MAKEINFO$]) m4trace:configure.ac:213: -1- AC_SUBST([install_sh]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([install_sh]) m4trace:configure.ac:213: -1- m4_pattern_allow([^install_sh$]) m4trace:configure.ac:213: -1- AC_SUBST([STRIP]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([STRIP]) m4trace:configure.ac:213: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:213: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) m4trace:configure.ac:213: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) m4trace:configure.ac:213: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.ac:213: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([mkdir_p]) m4trace:configure.ac:213: -1- m4_pattern_allow([^mkdir_p$]) m4trace:configure.ac:213: -1- AC_SUBST([AWK]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([AWK]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AWK$]) m4trace:configure.ac:213: -1- AC_SUBST([SET_MAKE]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([SET_MAKE]) m4trace:configure.ac:213: -1- m4_pattern_allow([^SET_MAKE$]) m4trace:configure.ac:213: -1- AC_SUBST([am__leading_dot]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([am__leading_dot]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__leading_dot$]) m4trace:configure.ac:213: -1- AC_SUBST([AMTAR]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([AMTAR]) m4trace:configure.ac:213: -1- m4_pattern_allow([^AMTAR$]) m4trace:configure.ac:213: -1- AC_SUBST([am__tar]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([am__tar]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__tar$]) m4trace:configure.ac:213: -1- AC_SUBST([am__untar]) m4trace:configure.ac:213: -1- AC_SUBST_TRACE([am__untar]) m4trace:configure.ac:213: -1- m4_pattern_allow([^am__untar$]) m4trace:configure.ac:236: -1- AC_SUBST([CC]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CFLAGS]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:236: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.ac:236: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:236: -1- AC_SUBST([LIBS]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:236: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:236: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:236: -1- AC_SUBST([CC]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- AC_SUBST([CC]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- AC_SUBST([CC]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- AC_SUBST([CC]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:236: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([ac_ct_CC]) m4trace:configure.ac:236: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:236: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([EXEEXT]) m4trace:configure.ac:236: -1- m4_pattern_allow([^EXEEXT$]) m4trace:configure.ac:236: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([OBJEXT]) m4trace:configure.ac:236: -1- m4_pattern_allow([^OBJEXT$]) m4trace:configure.ac:236: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([DEPDIR]) m4trace:configure.ac:236: -1- m4_pattern_allow([^DEPDIR$]) m4trace:configure.ac:236: -1- AC_SUBST([am__include]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([am__include]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__include$]) m4trace:configure.ac:236: -1- AC_SUBST([am__quote]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([am__quote]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__quote$]) m4trace:configure.ac:236: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) m4trace:configure.ac:236: -1- AC_SUBST([AMDEP_TRUE]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([AMDEP_TRUE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^AMDEP_TRUE$]) m4trace:configure.ac:236: -1- AC_SUBST([AMDEP_FALSE]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([AMDEP_FALSE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^AMDEP_FALSE$]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) m4trace:configure.ac:236: -1- AC_SUBST([AMDEPBACKSLASH]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) m4trace:configure.ac:236: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) m4trace:configure.ac:236: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CCDEPMODE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:236: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:236: -1- AC_SUBST([am__fastdepCC_TRUE]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:236: -1- AC_SUBST([am__fastdepCC_FALSE]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) m4trace:configure.ac:236: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:236: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:236: -1- AC_SUBST([CPP]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CPP]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:236: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:236: -1- AC_SUBST([CPP]) m4trace:configure.ac:236: -1- AC_SUBST_TRACE([CPP]) m4trace:configure.ac:236: -1- m4_pattern_allow([^CPP$]) m4trace:configure.ac:237: -1- AC_SUBST([CC]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- AC_SUBST([CFLAGS]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CFLAGS]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CFLAGS$]) m4trace:configure.ac:237: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.ac:237: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:237: -1- AC_SUBST([LIBS]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:237: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:237: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:237: -1- AC_SUBST([CC]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- AC_SUBST([CC]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- AC_SUBST([CC]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- AC_SUBST([CC]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CC$]) m4trace:configure.ac:237: -1- AC_SUBST([ac_ct_CC]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([ac_ct_CC]) m4trace:configure.ac:237: -1- m4_pattern_allow([^ac_ct_CC$]) m4trace:configure.ac:237: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([CCDEPMODE]) m4trace:configure.ac:237: -1- m4_pattern_allow([^CCDEPMODE$]) m4trace:configure.ac:237: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:237: -1- AC_SUBST([am__fastdepCC_TRUE]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) m4trace:configure.ac:237: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) m4trace:configure.ac:237: -1- AC_SUBST([am__fastdepCC_FALSE]) m4trace:configure.ac:237: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) m4trace:configure.ac:237: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) m4trace:configure.ac:237: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) m4trace:configure.ac:241: -1- AC_SUBST([CXX]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([CXX]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXX$]) m4trace:configure.ac:241: -1- AC_SUBST([CXXFLAGS]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([CXXFLAGS]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXXFLAGS$]) m4trace:configure.ac:241: -1- AC_SUBST([LDFLAGS]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([LDFLAGS]) m4trace:configure.ac:241: -1- m4_pattern_allow([^LDFLAGS$]) m4trace:configure.ac:241: -1- AC_SUBST([LIBS]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([LIBS]) m4trace:configure.ac:241: -1- m4_pattern_allow([^LIBS$]) m4trace:configure.ac:241: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:241: -1- AC_SUBST([CXX]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([CXX]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXX$]) m4trace:configure.ac:241: -1- AC_SUBST([ac_ct_CXX]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([ac_ct_CXX]) m4trace:configure.ac:241: -1- m4_pattern_allow([^ac_ct_CXX$]) m4trace:configure.ac:241: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([CXXDEPMODE]) m4trace:configure.ac:241: -1- m4_pattern_allow([^CXXDEPMODE$]) m4trace:configure.ac:241: -1- AM_CONDITIONAL([am__fastdepCXX], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) m4trace:configure.ac:241: -1- AC_SUBST([am__fastdepCXX_TRUE]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE]) m4trace:configure.ac:241: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) m4trace:configure.ac:241: -1- AC_SUBST([am__fastdepCXX_FALSE]) m4trace:configure.ac:241: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE]) m4trace:configure.ac:241: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) m4trace:configure.ac:241: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) m4trace:configure.ac:241: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) m4trace:configure.ac:246: -1- AM_PROG_CC_C_O m4trace:configure.ac:246: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O]) m4trace:configure.ac:246: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) m4trace:configure.ac:246: -1- AH_OUTPUT([NO_MINUS_C_MINUS_O], [/* Define to 1 if your C compiler doesn\'t accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O]) m4trace:configure.ac:246: -1- AC_REQUIRE_AUX_FILE([compile]) m4trace:configure.ac:249: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.ac:249: -1- AC_SUBST([INSTALL_PROGRAM]) m4trace:configure.ac:249: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) m4trace:configure.ac:249: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) m4trace:configure.ac:249: -1- AC_SUBST([INSTALL_SCRIPT]) m4trace:configure.ac:249: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) m4trace:configure.ac:249: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) m4trace:configure.ac:249: -1- AC_SUBST([INSTALL_DATA]) m4trace:configure.ac:249: -1- AC_SUBST_TRACE([INSTALL_DATA]) m4trace:configure.ac:249: -1- m4_pattern_allow([^INSTALL_DATA$]) m4trace:configure.ac:250: -1- AC_SUBST([SED]) m4trace:configure.ac:250: -1- AC_SUBST_TRACE([SED]) m4trace:configure.ac:250: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:250: -1- AC_SUBST([SED]) m4trace:configure.ac:250: -1- AC_SUBST_TRACE([SED]) m4trace:configure.ac:250: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:251: -1- AC_SUBST([LN_S], [$as_ln_s]) m4trace:configure.ac:251: -1- AC_SUBST_TRACE([LN_S]) m4trace:configure.ac:251: -1- m4_pattern_allow([^LN_S$]) m4trace:configure.ac:252: -1- AC_REQUIRE_AUX_FILE([install-sh]) m4trace:configure.ac:255: -1- AC_PROG_LIBTOOL m4trace:configure.ac:255: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. You should run autoupdate.], [m4/libtool.m4:107: AC_PROG_LIBTOOL is expanded from... configure.ac:255: the top level]) m4trace:configure.ac:255: -1- LT_INIT m4trace:configure.ac:255: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) m4trace:configure.ac:255: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) m4trace:configure.ac:255: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) m4trace:configure.ac:255: -1- AC_SUBST([LIBTOOL]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([LIBTOOL]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LIBTOOL$]) m4trace:configure.ac:255: -1- AC_SUBST([SED]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([SED]) m4trace:configure.ac:255: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:255: -1- AC_SUBST([SED]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([SED]) m4trace:configure.ac:255: -1- m4_pattern_allow([^SED$]) m4trace:configure.ac:255: -1- AC_SUBST([GREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:255: -1- AC_SUBST([GREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:255: -1- AC_SUBST([EGREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([EGREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:255: -1- AC_SUBST([EGREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([EGREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^EGREP$]) m4trace:configure.ac:255: -1- AC_SUBST([FGREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([FGREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:255: -1- AC_SUBST([FGREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([FGREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^FGREP$]) m4trace:configure.ac:255: -1- AC_SUBST([GREP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([GREP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^GREP$]) m4trace:configure.ac:255: -1- AC_SUBST([LD]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([LD]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:255: -1- AC_SUBST([DUMPBIN]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([DUMPBIN]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:255: -1- AC_SUBST([ac_ct_DUMPBIN]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN]) m4trace:configure.ac:255: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) m4trace:configure.ac:255: -1- AC_SUBST([DUMPBIN]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([DUMPBIN]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DUMPBIN$]) m4trace:configure.ac:255: -1- AC_SUBST([NM]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([NM]) m4trace:configure.ac:255: -1- m4_pattern_allow([^NM$]) m4trace:configure.ac:255: -1- AC_SUBST([OBJDUMP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([OBJDUMP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:255: -1- AC_SUBST([OBJDUMP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([OBJDUMP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OBJDUMP$]) m4trace:configure.ac:255: -1- AC_SUBST([DLLTOOL]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([DLLTOOL]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:255: -1- AC_SUBST([DLLTOOL]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([DLLTOOL]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DLLTOOL$]) m4trace:configure.ac:255: -1- AC_SUBST([AR]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([AR]) m4trace:configure.ac:255: -1- m4_pattern_allow([^AR$]) m4trace:configure.ac:255: -1- AC_SUBST([ac_ct_AR]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([ac_ct_AR]) m4trace:configure.ac:255: -1- m4_pattern_allow([^ac_ct_AR$]) m4trace:configure.ac:255: -1- AC_SUBST([STRIP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([STRIP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^STRIP$]) m4trace:configure.ac:255: -1- AC_SUBST([RANLIB]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([RANLIB]) m4trace:configure.ac:255: -1- m4_pattern_allow([^RANLIB$]) m4trace:configure.ac:255: -1- m4_pattern_allow([LT_OBJDIR]) m4trace:configure.ac:255: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LT_OBJDIR$]) m4trace:configure.ac:255: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR]) m4trace:configure.ac:255: -1- LT_SUPPORTED_TAG([CC]) m4trace:configure.ac:255: -1- AC_SUBST([MANIFEST_TOOL]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([MANIFEST_TOOL]) m4trace:configure.ac:255: -1- m4_pattern_allow([^MANIFEST_TOOL$]) m4trace:configure.ac:255: -1- AC_SUBST([DSYMUTIL]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([DSYMUTIL]) m4trace:configure.ac:255: -1- m4_pattern_allow([^DSYMUTIL$]) m4trace:configure.ac:255: -1- AC_SUBST([NMEDIT]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([NMEDIT]) m4trace:configure.ac:255: -1- m4_pattern_allow([^NMEDIT$]) m4trace:configure.ac:255: -1- AC_SUBST([LIPO]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([LIPO]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LIPO$]) m4trace:configure.ac:255: -1- AC_SUBST([OTOOL]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([OTOOL]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OTOOL$]) m4trace:configure.ac:255: -1- AC_SUBST([OTOOL64]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([OTOOL64]) m4trace:configure.ac:255: -1- m4_pattern_allow([^OTOOL64$]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H]) m4trace:configure.ac:255: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) m4trace:configure.ac:255: -1- m4_pattern_allow([^STDC_HEADERS$]) m4trace:configure.ac:255: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) m4trace:configure.ac:255: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) m4trace:configure.ac:255: -1- LT_SUPPORTED_TAG([CXX]) m4trace:configure.ac:255: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([CXXCPP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^CXXCPP$]) m4trace:configure.ac:255: -1- AC_SUBST([CPPFLAGS]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([CPPFLAGS]) m4trace:configure.ac:255: -1- m4_pattern_allow([^CPPFLAGS$]) m4trace:configure.ac:255: -1- AC_SUBST([CXXCPP]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([CXXCPP]) m4trace:configure.ac:255: -1- m4_pattern_allow([^CXXCPP$]) m4trace:configure.ac:255: -1- AC_SUBST([LD]) m4trace:configure.ac:255: -1- AC_SUBST_TRACE([LD]) m4trace:configure.ac:255: -1- m4_pattern_allow([^LD$]) m4trace:configure.ac:261: -1- AC_SUBST([HAVE_PKG_CONFIG]) m4trace:configure.ac:261: -1- AC_SUBST_TRACE([HAVE_PKG_CONFIG]) m4trace:configure.ac:261: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) m4trace:configure.ac:275: -1- AC_SUBST([XMKMF]) m4trace:configure.ac:275: -1- AC_SUBST_TRACE([XMKMF]) m4trace:configure.ac:275: -1- m4_pattern_allow([^XMKMF$]) m4trace:configure.ac:275: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) m4trace:configure.ac:275: -1- AH_OUTPUT([X_DISPLAY_MISSING], [/* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING]) m4trace:configure.ac:275: -1- AC_SUBST([X_CFLAGS]) m4trace:configure.ac:275: -1- AC_SUBST_TRACE([X_CFLAGS]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_CFLAGS$]) m4trace:configure.ac:275: -1- AC_SUBST([X_PRE_LIBS]) m4trace:configure.ac:275: -1- AC_SUBST_TRACE([X_PRE_LIBS]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_PRE_LIBS$]) m4trace:configure.ac:275: -1- AC_SUBST([X_LIBS]) m4trace:configure.ac:275: -1- AC_SUBST_TRACE([X_LIBS]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_LIBS$]) m4trace:configure.ac:275: -1- AC_SUBST([X_EXTRA_LIBS]) m4trace:configure.ac:275: -1- AC_SUBST_TRACE([X_EXTRA_LIBS]) m4trace:configure.ac:275: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) m4trace:configure.ac:302: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:302: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:302: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:302: -1- AC_SUBST([MSPACK_CPPFLAGS]) m4trace:configure.ac:302: -1- AC_SUBST_TRACE([MSPACK_CPPFLAGS]) m4trace:configure.ac:302: -1- m4_pattern_allow([^MSPACK_CPPFLAGS$]) m4trace:configure.ac:302: -1- AC_SUBST([MSPACK_LIBS]) m4trace:configure.ac:302: -1- AC_SUBST_TRACE([MSPACK_LIBS]) m4trace:configure.ac:302: -1- m4_pattern_allow([^MSPACK_LIBS$]) m4trace:configure.ac:322: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:322: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:322: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:322: -1- AC_SUBST([GLIB2_CPPFLAGS]) m4trace:configure.ac:322: -1- AC_SUBST_TRACE([GLIB2_CPPFLAGS]) m4trace:configure.ac:322: -1- m4_pattern_allow([^GLIB2_CPPFLAGS$]) m4trace:configure.ac:322: -1- AC_SUBST([GLIB2_LIBS]) m4trace:configure.ac:322: -1- AC_SUBST_TRACE([GLIB2_LIBS]) m4trace:configure.ac:322: -1- m4_pattern_allow([^GLIB2_LIBS$]) m4trace:configure.ac:332: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:332: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:332: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:332: -1- AC_SUBST([GMODULE_CPPFLAGS]) m4trace:configure.ac:332: -1- AC_SUBST_TRACE([GMODULE_CPPFLAGS]) m4trace:configure.ac:332: -1- m4_pattern_allow([^GMODULE_CPPFLAGS$]) m4trace:configure.ac:332: -1- AC_SUBST([GMODULE_LIBS]) m4trace:configure.ac:332: -1- AC_SUBST_TRACE([GMODULE_LIBS]) m4trace:configure.ac:332: -1- m4_pattern_allow([^GMODULE_LIBS$]) m4trace:configure.ac:341: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:341: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:341: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:341: -1- AC_SUBST([GOBJECT_CPPFLAGS]) m4trace:configure.ac:341: -1- AC_SUBST_TRACE([GOBJECT_CPPFLAGS]) m4trace:configure.ac:341: -1- m4_pattern_allow([^GOBJECT_CPPFLAGS$]) m4trace:configure.ac:341: -1- AC_SUBST([GOBJECT_LIBS]) m4trace:configure.ac:341: -1- AC_SUBST_TRACE([GOBJECT_LIBS]) m4trace:configure.ac:341: -1- m4_pattern_allow([^GOBJECT_LIBS$]) m4trace:configure.ac:350: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:350: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:350: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:350: -1- AC_SUBST([GTHREAD_CPPFLAGS]) m4trace:configure.ac:350: -1- AC_SUBST_TRACE([GTHREAD_CPPFLAGS]) m4trace:configure.ac:350: -1- m4_pattern_allow([^GTHREAD_CPPFLAGS$]) m4trace:configure.ac:350: -1- AC_SUBST([GTHREAD_LIBS]) m4trace:configure.ac:350: -1- AC_SUBST_TRACE([GTHREAD_LIBS]) m4trace:configure.ac:350: -1- m4_pattern_allow([^GTHREAD_LIBS$]) m4trace:configure.ac:359: -1- AC_SUBST([have_genmarshal]) m4trace:configure.ac:359: -1- AC_SUBST_TRACE([have_genmarshal]) m4trace:configure.ac:359: -1- m4_pattern_allow([^have_genmarshal$]) m4trace:configure.ac:371: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:371: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:371: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:371: -1- AC_SUBST([FUSE_CPPFLAGS]) m4trace:configure.ac:371: -1- AC_SUBST_TRACE([FUSE_CPPFLAGS]) m4trace:configure.ac:371: -1- m4_pattern_allow([^FUSE_CPPFLAGS$]) m4trace:configure.ac:371: -1- AC_SUBST([FUSE_LIBS]) m4trace:configure.ac:371: -1- AC_SUBST_TRACE([FUSE_LIBS]) m4trace:configure.ac:371: -1- m4_pattern_allow([^FUSE_LIBS$]) m4trace:configure.ac:393: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:393: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:393: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:393: -1- AC_SUBST([PAM_CPPFLAGS]) m4trace:configure.ac:393: -1- AC_SUBST_TRACE([PAM_CPPFLAGS]) m4trace:configure.ac:393: -1- m4_pattern_allow([^PAM_CPPFLAGS$]) m4trace:configure.ac:393: -1- AC_SUBST([PAM_LIBS]) m4trace:configure.ac:393: -1- AC_SUBST_TRACE([PAM_LIBS]) m4trace:configure.ac:393: -1- m4_pattern_allow([^PAM_LIBS$]) m4trace:configure.ac:436: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:436: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:436: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:436: -1- AC_SUBST([SSL_CPPFLAGS]) m4trace:configure.ac:436: -1- AC_SUBST_TRACE([SSL_CPPFLAGS]) m4trace:configure.ac:436: -1- m4_pattern_allow([^SSL_CPPFLAGS$]) m4trace:configure.ac:436: -1- AC_SUBST([SSL_LIBS]) m4trace:configure.ac:436: -1- AC_SUBST_TRACE([SSL_LIBS]) m4trace:configure.ac:436: -1- m4_pattern_allow([^SSL_LIBS$]) m4trace:configure.ac:450: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:450: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:450: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:450: -1- AC_SUBST([XERCES_CPPFLAGS]) m4trace:configure.ac:450: -1- AC_SUBST_TRACE([XERCES_CPPFLAGS]) m4trace:configure.ac:450: -1- m4_pattern_allow([^XERCES_CPPFLAGS$]) m4trace:configure.ac:450: -1- AC_SUBST([XERCES_LIBS]) m4trace:configure.ac:450: -1- AC_SUBST_TRACE([XERCES_LIBS]) m4trace:configure.ac:450: -1- m4_pattern_allow([^XERCES_LIBS$]) m4trace:configure.ac:461: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:461: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:461: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:461: -1- AC_SUBST([XMLSECURITY_CPPFLAGS]) m4trace:configure.ac:461: -1- AC_SUBST_TRACE([XMLSECURITY_CPPFLAGS]) m4trace:configure.ac:461: -1- m4_pattern_allow([^XMLSECURITY_CPPFLAGS$]) m4trace:configure.ac:461: -1- AC_SUBST([XMLSECURITY_LIBS]) m4trace:configure.ac:461: -1- AC_SUBST_TRACE([XMLSECURITY_LIBS]) m4trace:configure.ac:461: -1- m4_pattern_allow([^XMLSECURITY_LIBS$]) m4trace:configure.ac:477: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:477: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:477: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:477: -1- AC_SUBST([CUNIT_CPPFLAGS]) m4trace:configure.ac:477: -1- AC_SUBST_TRACE([CUNIT_CPPFLAGS]) m4trace:configure.ac:477: -1- m4_pattern_allow([^CUNIT_CPPFLAGS$]) m4trace:configure.ac:477: -1- AC_SUBST([CUNIT_LIBS]) m4trace:configure.ac:477: -1- AC_SUBST_TRACE([CUNIT_LIBS]) m4trace:configure.ac:477: -1- m4_pattern_allow([^CUNIT_LIBS$]) m4trace:configure.ac:570: -1- AH_OUTPUT([HAVE_X11_SM_SMLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_X11_SM_SMLIB_H]) m4trace:configure.ac:570: -1- AH_OUTPUT([HAVE_X11_ICE_ICELIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_X11_ICE_ICELIB_H]) m4trace:configure.ac:584: -1- AH_OUTPUT([HAVE_X11_EXTENSIONS_XCOMPOSITE_H], [/* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XCOMPOSITE_H]) m4trace:configure.ac:596: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:596: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:596: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:596: -1- AC_SUBST([GTK_CPPFLAGS]) m4trace:configure.ac:596: -1- AC_SUBST_TRACE([GTK_CPPFLAGS]) m4trace:configure.ac:596: -1- m4_pattern_allow([^GTK_CPPFLAGS$]) m4trace:configure.ac:596: -1- AC_SUBST([GTK_LIBS]) m4trace:configure.ac:596: -1- AC_SUBST_TRACE([GTK_LIBS]) m4trace:configure.ac:596: -1- m4_pattern_allow([^GTK_LIBS$]) m4trace:configure.ac:613: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:613: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:613: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:613: -1- AC_SUBST([GTKMM_CPPFLAGS]) m4trace:configure.ac:613: -1- AC_SUBST_TRACE([GTKMM_CPPFLAGS]) m4trace:configure.ac:613: -1- m4_pattern_allow([^GTKMM_CPPFLAGS$]) m4trace:configure.ac:613: -1- AC_SUBST([GTKMM_LIBS]) m4trace:configure.ac:613: -1- AC_SUBST_TRACE([GTKMM_LIBS]) m4trace:configure.ac:613: -1- m4_pattern_allow([^GTKMM_LIBS$]) m4trace:configure.ac:632: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Define to 1 if you have the `dlopen\' function. */ #undef HAVE_DLOPEN]) m4trace:configure.ac:645: -1- AH_OUTPUT([HAVE_ECVT], [/* Define to 1 if you have the `ecvt\' function. */ #undef HAVE_ECVT]) m4trace:configure.ac:646: -1- AH_OUTPUT([HAVE_FCVT], [/* Define to 1 if you have the `fcvt\' function. */ #undef HAVE_FCVT]) m4trace:configure.ac:687: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:687: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:687: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:687: -1- AC_SUBST([PROCPS_CPPFLAGS]) m4trace:configure.ac:687: -1- AC_SUBST_TRACE([PROCPS_CPPFLAGS]) m4trace:configure.ac:687: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:687: -1- AC_SUBST([PROCPS_LIBS]) m4trace:configure.ac:687: -1- AC_SUBST_TRACE([PROCPS_LIBS]) m4trace:configure.ac:687: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:719: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:719: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:719: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:719: -1- AC_SUBST([PROCPS_CPPFLAGS]) m4trace:configure.ac:719: -1- AC_SUBST_TRACE([PROCPS_CPPFLAGS]) m4trace:configure.ac:719: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:719: -1- AC_SUBST([PROCPS_LIBS]) m4trace:configure.ac:719: -1- AC_SUBST_TRACE([PROCPS_LIBS]) m4trace:configure.ac:719: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:733: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:733: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:733: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:733: -1- AC_SUBST([PROCPS_CPPFLAGS]) m4trace:configure.ac:733: -1- AC_SUBST_TRACE([PROCPS_CPPFLAGS]) m4trace:configure.ac:733: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:733: -1- AC_SUBST([PROCPS_LIBS]) m4trace:configure.ac:733: -1- AC_SUBST_TRACE([PROCPS_LIBS]) m4trace:configure.ac:733: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:747: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:747: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:747: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:747: -1- AC_SUBST([PROCPS_CPPFLAGS]) m4trace:configure.ac:747: -1- AC_SUBST_TRACE([PROCPS_CPPFLAGS]) m4trace:configure.ac:747: -1- m4_pattern_allow([^PROCPS_CPPFLAGS$]) m4trace:configure.ac:747: -1- AC_SUBST([PROCPS_LIBS]) m4trace:configure.ac:747: -1- AC_SUBST_TRACE([PROCPS_LIBS]) m4trace:configure.ac:747: -1- m4_pattern_allow([^PROCPS_LIBS$]) m4trace:configure.ac:760: -1- AC_DEFINE_TRACE_LITERAL([NO_PROCPS]) m4trace:configure.ac:760: -1- m4_pattern_allow([^NO_PROCPS$]) m4trace:configure.ac:760: -1- AH_OUTPUT([NO_PROCPS], [/* Define to 1 if building without procps. */ #undef NO_PROCPS]) m4trace:configure.ac:774: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:774: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:774: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:774: -1- AC_SUBST([DNET_CPPFLAGS]) m4trace:configure.ac:774: -1- AC_SUBST_TRACE([DNET_CPPFLAGS]) m4trace:configure.ac:774: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) m4trace:configure.ac:774: -1- AC_SUBST([DNET_LIBS]) m4trace:configure.ac:774: -1- AC_SUBST_TRACE([DNET_LIBS]) m4trace:configure.ac:774: -1- m4_pattern_allow([^DNET_LIBS$]) m4trace:configure.ac:774: -1- AC_DEFINE_TRACE_LITERAL([DNET_IS_DUMBNET]) m4trace:configure.ac:774: -1- m4_pattern_allow([^DNET_IS_DUMBNET$]) m4trace:configure.ac:774: -1- AH_OUTPUT([DNET_IS_DUMBNET], [/* Define to 1 if substituting Debian\'s libdumbnet for libdnet. */ #undef DNET_IS_DUMBNET]) m4trace:configure.ac:786: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:786: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:786: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:786: -1- AC_SUBST([DNET_CPPFLAGS]) m4trace:configure.ac:786: -1- AC_SUBST_TRACE([DNET_CPPFLAGS]) m4trace:configure.ac:786: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) m4trace:configure.ac:786: -1- AC_SUBST([DNET_LIBS]) m4trace:configure.ac:786: -1- AC_SUBST_TRACE([DNET_LIBS]) m4trace:configure.ac:786: -1- m4_pattern_allow([^DNET_LIBS$]) m4trace:configure.ac:804: -1- AC_DEFINE_TRACE_LITERAL([NO_DNET]) m4trace:configure.ac:804: -1- m4_pattern_allow([^NO_DNET$]) m4trace:configure.ac:804: -1- AH_OUTPUT([NO_DNET], [/* Define to 1 if building without libdnet. */ #undef NO_DNET]) m4trace:configure.ac:814: -1- AC_SUBST([have_cxx]) m4trace:configure.ac:814: -1- AC_SUBST_TRACE([have_cxx]) m4trace:configure.ac:814: -1- m4_pattern_allow([^have_cxx$]) m4trace:configure.ac:821: -1- AC_SUBST([ac_vmw_lib_cfg]) m4trace:configure.ac:821: -1- AC_SUBST_TRACE([ac_vmw_lib_cfg]) m4trace:configure.ac:821: -1- m4_pattern_allow([^ac_vmw_lib_cfg$]) m4trace:configure.ac:821: -1- AC_SUBST([ICU_CPPFLAGS]) m4trace:configure.ac:821: -1- AC_SUBST_TRACE([ICU_CPPFLAGS]) m4trace:configure.ac:821: -1- m4_pattern_allow([^ICU_CPPFLAGS$]) m4trace:configure.ac:821: -1- AC_SUBST([ICU_LIBS]) m4trace:configure.ac:821: -1- AC_SUBST_TRACE([ICU_LIBS]) m4trace:configure.ac:821: -1- m4_pattern_allow([^ICU_LIBS$]) m4trace:configure.ac:835: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:835: the top level]) m4trace:configure.ac:854: -1- AC_SUBST([RPCGEN]) m4trace:configure.ac:854: -1- AC_SUBST_TRACE([RPCGEN]) m4trace:configure.ac:854: -1- m4_pattern_allow([^RPCGEN$]) m4trace:configure.ac:863: -1- AH_OUTPUT([HAVE_CRYPT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H]) m4trace:configure.ac:864: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) m4trace:configure.ac:865: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) m4trace:configure.ac:866: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) m4trace:configure.ac:867: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H]) m4trace:configure.ac:868: -1- AH_OUTPUT([HAVE_SYS_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H]) m4trace:configure.ac:869: -1- AH_OUTPUT([HAVE_SYS_IO_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_IO_H]) m4trace:configure.ac:870: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H]) m4trace:configure.ac:871: -1- AH_OUTPUT([HAVE_SYS_SYSINFO_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSINFO_H]) m4trace:configure.ac:872: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) m4trace:configure.ac:873: -1- AH_OUTPUT([HAVE_SYS_USER_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_USER_H]) m4trace:configure.ac:881: -1- AH_OUTPUT([HAVE_SYS_VFS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H]) m4trace:configure.ac:882: -1- AH_OUTPUT([HAVE_SYSLIMITS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYSLIMITS_H]) m4trace:configure.ac:883: -1- AH_OUTPUT([HAVE_UNWIND_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNWIND_H]) m4trace:configure.ac:919: -1- AC_DEFINE_TRACE_LITERAL([HAVE__BOOL]) m4trace:configure.ac:919: -1- m4_pattern_allow([^HAVE__BOOL$]) m4trace:configure.ac:919: -1- AH_OUTPUT([HAVE__BOOL], [/* Define to 1 if the system has the type `_Bool\'. */ #undef HAVE__BOOL]) m4trace:configure.ac:919: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDBOOL_H]) m4trace:configure.ac:919: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) m4trace:configure.ac:919: -1- AH_OUTPUT([HAVE_STDBOOL_H], [/* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H]) m4trace:configure.ac:920: -1- AC_DEFINE_TRACE_LITERAL([const]) m4trace:configure.ac:920: -1- m4_pattern_allow([^const$]) m4trace:configure.ac:920: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ #undef const]) m4trace:configure.ac:921: -1- AC_DEFINE_TRACE_LITERAL([uid_t]) m4trace:configure.ac:921: -1- m4_pattern_allow([^uid_t$]) m4trace:configure.ac:921: -1- AH_OUTPUT([uid_t], [/* Define to `int\' if doesn\'t define. */ #undef uid_t]) m4trace:configure.ac:921: -1- AC_DEFINE_TRACE_LITERAL([gid_t]) m4trace:configure.ac:921: -1- m4_pattern_allow([^gid_t$]) m4trace:configure.ac:921: -1- AH_OUTPUT([gid_t], [/* Define to `int\' if doesn\'t define. */ #undef gid_t]) m4trace:configure.ac:922: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler calls it, or to nothing if \'inline\' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif]) m4trace:configure.ac:923: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) m4trace:configure.ac:923: -1- m4_pattern_allow([^mode_t$]) m4trace:configure.ac:923: -1- AH_OUTPUT([mode_t], [/* Define to `int\' if does not define. */ #undef mode_t]) m4trace:configure.ac:924: -1- AC_DEFINE_TRACE_LITERAL([off_t]) m4trace:configure.ac:924: -1- m4_pattern_allow([^off_t$]) m4trace:configure.ac:924: -1- AH_OUTPUT([off_t], [/* Define to `long int\' if does not define. */ #undef off_t]) m4trace:configure.ac:925: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) m4trace:configure.ac:925: -1- m4_pattern_allow([^pid_t$]) m4trace:configure.ac:925: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ #undef pid_t]) m4trace:configure.ac:926: -1- AC_DEFINE_TRACE_LITERAL([size_t]) m4trace:configure.ac:926: -1- m4_pattern_allow([^size_t$]) m4trace:configure.ac:926: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ #undef size_t]) m4trace:configure.ac:927: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_RDEV]) m4trace:configure.ac:927: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) m4trace:configure.ac:927: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_RDEV], [/* Define to 1 if `st_rdev\' is member of `struct stat\'. */ #undef HAVE_STRUCT_STAT_ST_RDEV]) m4trace:configure.ac:928: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) m4trace:configure.ac:928: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) m4trace:configure.ac:928: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME]) m4trace:configure.ac:929: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) m4trace:configure.ac:929: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) m4trace:configure.ac:929: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares `struct tm\'. */ #undef TM_IN_SYS_TIME]) m4trace:configure.ac:930: -1- AC_DEFINE_TRACE_LITERAL([volatile]) m4trace:configure.ac:930: -1- m4_pattern_allow([^volatile$]) m4trace:configure.ac:930: -1- AH_OUTPUT([volatile], [/* Define to empty if the keyword `volatile\' does not work. Warning: valid code using `volatile\' can become incorrect without. Disable with care. */ #undef volatile]) m4trace:configure.ac:950: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:950: the top level]) m4trace:configure.ac:967: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:967: the top level]) m4trace:configure.ac:978: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2367: AC_TRY_COMPILE is expanded from... configure.ac:978: the top level]) m4trace:configure.ac:997: -1- AC_SUBST([have_doxygen]) m4trace:configure.ac:997: -1- AC_SUBST_TRACE([have_doxygen]) m4trace:configure.ac:997: -1- m4_pattern_allow([^have_doxygen$]) m4trace:configure.ac:1004: -1- AC_SUBST([DOT]) m4trace:configure.ac:1004: -1- AC_SUBST_TRACE([DOT]) m4trace:configure.ac:1004: -1- m4_pattern_allow([^DOT$]) m4trace:configure.ac:1011: -1- AC_SUBST([DOT]) m4trace:configure.ac:1011: -1- AC_SUBST_TRACE([DOT]) m4trace:configure.ac:1011: -1- m4_pattern_allow([^DOT$]) m4trace:configure.ac:1012: -1- AC_SUBST([HAVE_DOT]) m4trace:configure.ac:1012: -1- AC_SUBST_TRACE([HAVE_DOT]) m4trace:configure.ac:1012: -1- m4_pattern_allow([^HAVE_DOT$]) m4trace:configure.ac:1014: -1- AC_SUBST([MSCGEN]) m4trace:configure.ac:1014: -1- AC_SUBST_TRACE([MSCGEN]) m4trace:configure.ac:1014: -1- m4_pattern_allow([^MSCGEN$]) m4trace:configure.ac:1022: -1- AC_SUBST([MSCGEN_DIR]) m4trace:configure.ac:1022: -1- AC_SUBST_TRACE([MSCGEN_DIR]) m4trace:configure.ac:1022: -1- m4_pattern_allow([^MSCGEN_DIR$]) m4trace:configure.ac:1132: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) m4trace:configure.ac:1132: -1- AC_SUBST([BUILD_HGFSMOUNTER_TRUE]) m4trace:configure.ac:1132: -1- AC_SUBST_TRACE([BUILD_HGFSMOUNTER_TRUE]) m4trace:configure.ac:1132: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) m4trace:configure.ac:1132: -1- AC_SUBST([BUILD_HGFSMOUNTER_FALSE]) m4trace:configure.ac:1132: -1- AC_SUBST_TRACE([BUILD_HGFSMOUNTER_FALSE]) m4trace:configure.ac:1132: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) m4trace:configure.ac:1132: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) m4trace:configure.ac:1132: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) m4trace:configure.ac:1133: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) m4trace:configure.ac:1133: -1- AC_SUBST([LINUX_TRUE]) m4trace:configure.ac:1133: -1- AC_SUBST_TRACE([LINUX_TRUE]) m4trace:configure.ac:1133: -1- m4_pattern_allow([^LINUX_TRUE$]) m4trace:configure.ac:1133: -1- AC_SUBST([LINUX_FALSE]) m4trace:configure.ac:1133: -1- AC_SUBST_TRACE([LINUX_FALSE]) m4trace:configure.ac:1133: -1- m4_pattern_allow([^LINUX_FALSE$]) m4trace:configure.ac:1133: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) m4trace:configure.ac:1133: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) m4trace:configure.ac:1134: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) m4trace:configure.ac:1134: -1- AC_SUBST([SOLARIS_TRUE]) m4trace:configure.ac:1134: -1- AC_SUBST_TRACE([SOLARIS_TRUE]) m4trace:configure.ac:1134: -1- m4_pattern_allow([^SOLARIS_TRUE$]) m4trace:configure.ac:1134: -1- AC_SUBST([SOLARIS_FALSE]) m4trace:configure.ac:1134: -1- AC_SUBST_TRACE([SOLARIS_FALSE]) m4trace:configure.ac:1134: -1- m4_pattern_allow([^SOLARIS_FALSE$]) m4trace:configure.ac:1134: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) m4trace:configure.ac:1134: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) m4trace:configure.ac:1135: -1- AM_CONDITIONAL([FREEBSD], [test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu"]) m4trace:configure.ac:1135: -1- AC_SUBST([FREEBSD_TRUE]) m4trace:configure.ac:1135: -1- AC_SUBST_TRACE([FREEBSD_TRUE]) m4trace:configure.ac:1135: -1- m4_pattern_allow([^FREEBSD_TRUE$]) m4trace:configure.ac:1135: -1- AC_SUBST([FREEBSD_FALSE]) m4trace:configure.ac:1135: -1- AC_SUBST_TRACE([FREEBSD_FALSE]) m4trace:configure.ac:1135: -1- m4_pattern_allow([^FREEBSD_FALSE$]) m4trace:configure.ac:1135: -1- _AM_SUBST_NOTMAKE([FREEBSD_TRUE]) m4trace:configure.ac:1135: -1- _AM_SUBST_NOTMAKE([FREEBSD_FALSE]) m4trace:configure.ac:1136: -1- AM_CONDITIONAL([FREEBSD_CUSTOM_SYSDIR], [test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR"]) m4trace:configure.ac:1136: -1- AC_SUBST([FREEBSD_CUSTOM_SYSDIR_TRUE]) m4trace:configure.ac:1136: -1- AC_SUBST_TRACE([FREEBSD_CUSTOM_SYSDIR_TRUE]) m4trace:configure.ac:1136: -1- m4_pattern_allow([^FREEBSD_CUSTOM_SYSDIR_TRUE$]) m4trace:configure.ac:1136: -1- AC_SUBST([FREEBSD_CUSTOM_SYSDIR_FALSE]) m4trace:configure.ac:1136: -1- AC_SUBST_TRACE([FREEBSD_CUSTOM_SYSDIR_FALSE]) m4trace:configure.ac:1136: -1- m4_pattern_allow([^FREEBSD_CUSTOM_SYSDIR_FALSE$]) m4trace:configure.ac:1136: -1- _AM_SUBST_NOTMAKE([FREEBSD_CUSTOM_SYSDIR_TRUE]) m4trace:configure.ac:1136: -1- _AM_SUBST_NOTMAKE([FREEBSD_CUSTOM_SYSDIR_FALSE]) m4trace:configure.ac:1138: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) m4trace:configure.ac:1138: -1- AC_SUBST([THIRTY_TWO_BIT_USERSPACE_TRUE]) m4trace:configure.ac:1138: -1- AC_SUBST_TRACE([THIRTY_TWO_BIT_USERSPACE_TRUE]) m4trace:configure.ac:1138: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) m4trace:configure.ac:1138: -1- AC_SUBST([THIRTY_TWO_BIT_USERSPACE_FALSE]) m4trace:configure.ac:1138: -1- AC_SUBST_TRACE([THIRTY_TWO_BIT_USERSPACE_FALSE]) m4trace:configure.ac:1138: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) m4trace:configure.ac:1138: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) m4trace:configure.ac:1138: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) m4trace:configure.ac:1139: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) m4trace:configure.ac:1139: -1- AC_SUBST([HAVE_X11_TRUE]) m4trace:configure.ac:1139: -1- AC_SUBST_TRACE([HAVE_X11_TRUE]) m4trace:configure.ac:1139: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) m4trace:configure.ac:1139: -1- AC_SUBST([HAVE_X11_FALSE]) m4trace:configure.ac:1139: -1- AC_SUBST_TRACE([HAVE_X11_FALSE]) m4trace:configure.ac:1139: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) m4trace:configure.ac:1139: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) m4trace:configure.ac:1139: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) m4trace:configure.ac:1140: -1- AM_CONDITIONAL([HAVE_ICU], [test "$with_icu" = "yes"]) m4trace:configure.ac:1140: -1- AC_SUBST([HAVE_ICU_TRUE]) m4trace:configure.ac:1140: -1- AC_SUBST_TRACE([HAVE_ICU_TRUE]) m4trace:configure.ac:1140: -1- m4_pattern_allow([^HAVE_ICU_TRUE$]) m4trace:configure.ac:1140: -1- AC_SUBST([HAVE_ICU_FALSE]) m4trace:configure.ac:1140: -1- AC_SUBST_TRACE([HAVE_ICU_FALSE]) m4trace:configure.ac:1140: -1- m4_pattern_allow([^HAVE_ICU_FALSE$]) m4trace:configure.ac:1140: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_TRUE]) m4trace:configure.ac:1140: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_FALSE]) m4trace:configure.ac:1141: -1- AM_CONDITIONAL([WITH_KERNEL_MODULES], [test "$with_kernel_modules" = "yes"]) m4trace:configure.ac:1141: -1- AC_SUBST([WITH_KERNEL_MODULES_TRUE]) m4trace:configure.ac:1141: -1- AC_SUBST_TRACE([WITH_KERNEL_MODULES_TRUE]) m4trace:configure.ac:1141: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_TRUE$]) m4trace:configure.ac:1141: -1- AC_SUBST([WITH_KERNEL_MODULES_FALSE]) m4trace:configure.ac:1141: -1- AC_SUBST_TRACE([WITH_KERNEL_MODULES_FALSE]) m4trace:configure.ac:1141: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_FALSE$]) m4trace:configure.ac:1141: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_TRUE]) m4trace:configure.ac:1141: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_FALSE]) m4trace:configure.ac:1142: -1- AM_CONDITIONAL([HAVE_XSM], [test "$have_xsm" = "yes"]) m4trace:configure.ac:1142: -1- AC_SUBST([HAVE_XSM_TRUE]) m4trace:configure.ac:1142: -1- AC_SUBST_TRACE([HAVE_XSM_TRUE]) m4trace:configure.ac:1142: -1- m4_pattern_allow([^HAVE_XSM_TRUE$]) m4trace:configure.ac:1142: -1- AC_SUBST([HAVE_XSM_FALSE]) m4trace:configure.ac:1142: -1- AC_SUBST_TRACE([HAVE_XSM_FALSE]) m4trace:configure.ac:1142: -1- m4_pattern_allow([^HAVE_XSM_FALSE$]) m4trace:configure.ac:1142: -1- _AM_SUBST_NOTMAKE([HAVE_XSM_TRUE]) m4trace:configure.ac:1142: -1- _AM_SUBST_NOTMAKE([HAVE_XSM_FALSE]) m4trace:configure.ac:1143: -1- AM_CONDITIONAL([HAVE_XCOMPOSITE], [test "$have_xcomposite" = "yes"]) m4trace:configure.ac:1143: -1- AC_SUBST([HAVE_XCOMPOSITE_TRUE]) m4trace:configure.ac:1143: -1- AC_SUBST_TRACE([HAVE_XCOMPOSITE_TRUE]) m4trace:configure.ac:1143: -1- m4_pattern_allow([^HAVE_XCOMPOSITE_TRUE$]) m4trace:configure.ac:1143: -1- AC_SUBST([HAVE_XCOMPOSITE_FALSE]) m4trace:configure.ac:1143: -1- AC_SUBST_TRACE([HAVE_XCOMPOSITE_FALSE]) m4trace:configure.ac:1143: -1- m4_pattern_allow([^HAVE_XCOMPOSITE_FALSE$]) m4trace:configure.ac:1143: -1- _AM_SUBST_NOTMAKE([HAVE_XCOMPOSITE_TRUE]) m4trace:configure.ac:1143: -1- _AM_SUBST_NOTMAKE([HAVE_XCOMPOSITE_FALSE]) m4trace:configure.ac:1144: -1- AM_CONDITIONAL([ENABLE_TESTS], [test "$have_cunit" = "yes"]) m4trace:configure.ac:1144: -1- AC_SUBST([ENABLE_TESTS_TRUE]) m4trace:configure.ac:1144: -1- AC_SUBST_TRACE([ENABLE_TESTS_TRUE]) m4trace:configure.ac:1144: -1- m4_pattern_allow([^ENABLE_TESTS_TRUE$]) m4trace:configure.ac:1144: -1- AC_SUBST([ENABLE_TESTS_FALSE]) m4trace:configure.ac:1144: -1- AC_SUBST_TRACE([ENABLE_TESTS_FALSE]) m4trace:configure.ac:1144: -1- m4_pattern_allow([^ENABLE_TESTS_FALSE$]) m4trace:configure.ac:1144: -1- _AM_SUBST_NOTMAKE([ENABLE_TESTS_TRUE]) m4trace:configure.ac:1144: -1- _AM_SUBST_NOTMAKE([ENABLE_TESTS_FALSE]) m4trace:configure.ac:1145: -1- AM_CONDITIONAL([WITH_ROOT_PRIVILEGES], [test "$with_root_privileges" = "yes"]) m4trace:configure.ac:1145: -1- AC_SUBST([WITH_ROOT_PRIVILEGES_TRUE]) m4trace:configure.ac:1145: -1- AC_SUBST_TRACE([WITH_ROOT_PRIVILEGES_TRUE]) m4trace:configure.ac:1145: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_TRUE$]) m4trace:configure.ac:1145: -1- AC_SUBST([WITH_ROOT_PRIVILEGES_FALSE]) m4trace:configure.ac:1145: -1- AC_SUBST_TRACE([WITH_ROOT_PRIVILEGES_FALSE]) m4trace:configure.ac:1145: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_FALSE$]) m4trace:configure.ac:1145: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_TRUE]) m4trace:configure.ac:1145: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_FALSE]) m4trace:configure.ac:1146: -1- AM_CONDITIONAL([HAVE_DNET], [test "$have_dnet" = "yes"]) m4trace:configure.ac:1146: -1- AC_SUBST([HAVE_DNET_TRUE]) m4trace:configure.ac:1146: -1- AC_SUBST_TRACE([HAVE_DNET_TRUE]) m4trace:configure.ac:1146: -1- m4_pattern_allow([^HAVE_DNET_TRUE$]) m4trace:configure.ac:1146: -1- AC_SUBST([HAVE_DNET_FALSE]) m4trace:configure.ac:1146: -1- AC_SUBST_TRACE([HAVE_DNET_FALSE]) m4trace:configure.ac:1146: -1- m4_pattern_allow([^HAVE_DNET_FALSE$]) m4trace:configure.ac:1146: -1- _AM_SUBST_NOTMAKE([HAVE_DNET_TRUE]) m4trace:configure.ac:1146: -1- _AM_SUBST_NOTMAKE([HAVE_DNET_FALSE]) m4trace:configure.ac:1147: -1- AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = "yes"]) m4trace:configure.ac:1147: -1- AC_SUBST([HAVE_DOXYGEN_TRUE]) m4trace:configure.ac:1147: -1- AC_SUBST_TRACE([HAVE_DOXYGEN_TRUE]) m4trace:configure.ac:1147: -1- m4_pattern_allow([^HAVE_DOXYGEN_TRUE$]) m4trace:configure.ac:1147: -1- AC_SUBST([HAVE_DOXYGEN_FALSE]) m4trace:configure.ac:1147: -1- AC_SUBST_TRACE([HAVE_DOXYGEN_FALSE]) m4trace:configure.ac:1147: -1- m4_pattern_allow([^HAVE_DOXYGEN_FALSE$]) m4trace:configure.ac:1147: -1- _AM_SUBST_NOTMAKE([HAVE_DOXYGEN_TRUE]) m4trace:configure.ac:1147: -1- _AM_SUBST_NOTMAKE([HAVE_DOXYGEN_FALSE]) m4trace:configure.ac:1148: -1- AM_CONDITIONAL([HAVE_FUSE], [test "$have_fuse" = "yes"]) m4trace:configure.ac:1148: -1- AC_SUBST([HAVE_FUSE_TRUE]) m4trace:configure.ac:1148: -1- AC_SUBST_TRACE([HAVE_FUSE_TRUE]) m4trace:configure.ac:1148: -1- m4_pattern_allow([^HAVE_FUSE_TRUE$]) m4trace:configure.ac:1148: -1- AC_SUBST([HAVE_FUSE_FALSE]) m4trace:configure.ac:1148: -1- AC_SUBST_TRACE([HAVE_FUSE_FALSE]) m4trace:configure.ac:1148: -1- m4_pattern_allow([^HAVE_FUSE_FALSE$]) m4trace:configure.ac:1148: -1- _AM_SUBST_NOTMAKE([HAVE_FUSE_TRUE]) m4trace:configure.ac:1148: -1- _AM_SUBST_NOTMAKE([HAVE_FUSE_FALSE]) m4trace:configure.ac:1149: -1- AM_CONDITIONAL([HAVE_GNU_LD], [test "$with_gnu_ld" = "yes"]) m4trace:configure.ac:1149: -1- AC_SUBST([HAVE_GNU_LD_TRUE]) m4trace:configure.ac:1149: -1- AC_SUBST_TRACE([HAVE_GNU_LD_TRUE]) m4trace:configure.ac:1149: -1- m4_pattern_allow([^HAVE_GNU_LD_TRUE$]) m4trace:configure.ac:1149: -1- AC_SUBST([HAVE_GNU_LD_FALSE]) m4trace:configure.ac:1149: -1- AC_SUBST_TRACE([HAVE_GNU_LD_FALSE]) m4trace:configure.ac:1149: -1- m4_pattern_allow([^HAVE_GNU_LD_FALSE$]) m4trace:configure.ac:1149: -1- _AM_SUBST_NOTMAKE([HAVE_GNU_LD_TRUE]) m4trace:configure.ac:1149: -1- _AM_SUBST_NOTMAKE([HAVE_GNU_LD_FALSE]) m4trace:configure.ac:1150: -1- AM_CONDITIONAL([HAVE_GTKMM], [test "$have_x" = "yes" -a "$with_gtkmm" = "yes"]) m4trace:configure.ac:1150: -1- AC_SUBST([HAVE_GTKMM_TRUE]) m4trace:configure.ac:1150: -1- AC_SUBST_TRACE([HAVE_GTKMM_TRUE]) m4trace:configure.ac:1150: -1- m4_pattern_allow([^HAVE_GTKMM_TRUE$]) m4trace:configure.ac:1150: -1- AC_SUBST([HAVE_GTKMM_FALSE]) m4trace:configure.ac:1150: -1- AC_SUBST_TRACE([HAVE_GTKMM_FALSE]) m4trace:configure.ac:1150: -1- m4_pattern_allow([^HAVE_GTKMM_FALSE$]) m4trace:configure.ac:1150: -1- _AM_SUBST_NOTMAKE([HAVE_GTKMM_TRUE]) m4trace:configure.ac:1150: -1- _AM_SUBST_NOTMAKE([HAVE_GTKMM_FALSE]) m4trace:configure.ac:1151: -1- AM_CONDITIONAL([HAVE_PAM], [test "$with_pam" = "yes"]) m4trace:configure.ac:1151: -1- AC_SUBST([HAVE_PAM_TRUE]) m4trace:configure.ac:1151: -1- AC_SUBST_TRACE([HAVE_PAM_TRUE]) m4trace:configure.ac:1151: -1- m4_pattern_allow([^HAVE_PAM_TRUE$]) m4trace:configure.ac:1151: -1- AC_SUBST([HAVE_PAM_FALSE]) m4trace:configure.ac:1151: -1- AC_SUBST_TRACE([HAVE_PAM_FALSE]) m4trace:configure.ac:1151: -1- m4_pattern_allow([^HAVE_PAM_FALSE$]) m4trace:configure.ac:1151: -1- _AM_SUBST_NOTMAKE([HAVE_PAM_TRUE]) m4trace:configure.ac:1151: -1- _AM_SUBST_NOTMAKE([HAVE_PAM_FALSE]) m4trace:configure.ac:1152: -1- AM_CONDITIONAL([USE_SLASH_PROC], [test "$os" = "linux"]) m4trace:configure.ac:1152: -1- AC_SUBST([USE_SLASH_PROC_TRUE]) m4trace:configure.ac:1152: -1- AC_SUBST_TRACE([USE_SLASH_PROC_TRUE]) m4trace:configure.ac:1152: -1- m4_pattern_allow([^USE_SLASH_PROC_TRUE$]) m4trace:configure.ac:1152: -1- AC_SUBST([USE_SLASH_PROC_FALSE]) m4trace:configure.ac:1152: -1- AC_SUBST_TRACE([USE_SLASH_PROC_FALSE]) m4trace:configure.ac:1152: -1- m4_pattern_allow([^USE_SLASH_PROC_FALSE$]) m4trace:configure.ac:1152: -1- _AM_SUBST_NOTMAKE([USE_SLASH_PROC_TRUE]) m4trace:configure.ac:1152: -1- _AM_SUBST_NOTMAKE([USE_SLASH_PROC_FALSE]) m4trace:configure.ac:1153: -1- AM_CONDITIONAL([USE_PRINTF_WRAPPERS], [test "$bsdPrintfWrappers" = "yes"]) m4trace:configure.ac:1153: -1- AC_SUBST([USE_PRINTF_WRAPPERS_TRUE]) m4trace:configure.ac:1153: -1- AC_SUBST_TRACE([USE_PRINTF_WRAPPERS_TRUE]) m4trace:configure.ac:1153: -1- m4_pattern_allow([^USE_PRINTF_WRAPPERS_TRUE$]) m4trace:configure.ac:1153: -1- AC_SUBST([USE_PRINTF_WRAPPERS_FALSE]) m4trace:configure.ac:1153: -1- AC_SUBST_TRACE([USE_PRINTF_WRAPPERS_FALSE]) m4trace:configure.ac:1153: -1- m4_pattern_allow([^USE_PRINTF_WRAPPERS_FALSE$]) m4trace:configure.ac:1153: -1- _AM_SUBST_NOTMAKE([USE_PRINTF_WRAPPERS_TRUE]) m4trace:configure.ac:1153: -1- _AM_SUBST_NOTMAKE([USE_PRINTF_WRAPPERS_FALSE]) m4trace:configure.ac:1154: -1- AM_CONDITIONAL([ENABLE_DEPLOYPKG], [test "$enable_deploypkg" = "yes"]) m4trace:configure.ac:1154: -1- AC_SUBST([ENABLE_DEPLOYPKG_TRUE]) m4trace:configure.ac:1154: -1- AC_SUBST_TRACE([ENABLE_DEPLOYPKG_TRUE]) m4trace:configure.ac:1154: -1- m4_pattern_allow([^ENABLE_DEPLOYPKG_TRUE$]) m4trace:configure.ac:1154: -1- AC_SUBST([ENABLE_DEPLOYPKG_FALSE]) m4trace:configure.ac:1154: -1- AC_SUBST_TRACE([ENABLE_DEPLOYPKG_FALSE]) m4trace:configure.ac:1154: -1- m4_pattern_allow([^ENABLE_DEPLOYPKG_FALSE$]) m4trace:configure.ac:1154: -1- _AM_SUBST_NOTMAKE([ENABLE_DEPLOYPKG_TRUE]) m4trace:configure.ac:1154: -1- _AM_SUBST_NOTMAKE([ENABLE_DEPLOYPKG_FALSE]) m4trace:configure.ac:1155: -1- AM_CONDITIONAL([ENABLE_GRABBITMQPROXY], [test "$enable_grabbitmqproxy" = "yes"]) m4trace:configure.ac:1155: -1- AC_SUBST([ENABLE_GRABBITMQPROXY_TRUE]) m4trace:configure.ac:1155: -1- AC_SUBST_TRACE([ENABLE_GRABBITMQPROXY_TRUE]) m4trace:configure.ac:1155: -1- m4_pattern_allow([^ENABLE_GRABBITMQPROXY_TRUE$]) m4trace:configure.ac:1155: -1- AC_SUBST([ENABLE_GRABBITMQPROXY_FALSE]) m4trace:configure.ac:1155: -1- AC_SUBST_TRACE([ENABLE_GRABBITMQPROXY_FALSE]) m4trace:configure.ac:1155: -1- m4_pattern_allow([^ENABLE_GRABBITMQPROXY_FALSE$]) m4trace:configure.ac:1155: -1- _AM_SUBST_NOTMAKE([ENABLE_GRABBITMQPROXY_TRUE]) m4trace:configure.ac:1155: -1- _AM_SUBST_NOTMAKE([ENABLE_GRABBITMQPROXY_FALSE]) m4trace:configure.ac:1156: -1- AM_CONDITIONAL([ENABLE_VGAUTH], [test "$enable_vgauth" = "yes"]) m4trace:configure.ac:1156: -1- AC_SUBST([ENABLE_VGAUTH_TRUE]) m4trace:configure.ac:1156: -1- AC_SUBST_TRACE([ENABLE_VGAUTH_TRUE]) m4trace:configure.ac:1156: -1- m4_pattern_allow([^ENABLE_VGAUTH_TRUE$]) m4trace:configure.ac:1156: -1- AC_SUBST([ENABLE_VGAUTH_FALSE]) m4trace:configure.ac:1156: -1- AC_SUBST_TRACE([ENABLE_VGAUTH_FALSE]) m4trace:configure.ac:1156: -1- m4_pattern_allow([^ENABLE_VGAUTH_FALSE$]) m4trace:configure.ac:1156: -1- _AM_SUBST_NOTMAKE([ENABLE_VGAUTH_TRUE]) m4trace:configure.ac:1156: -1- _AM_SUBST_NOTMAKE([ENABLE_VGAUTH_FALSE]) m4trace:configure.ac:1157: -1- AM_CONDITIONAL([HAVE_VSOCK], [test "$os" = "linux"]) m4trace:configure.ac:1157: -1- AC_SUBST([HAVE_VSOCK_TRUE]) m4trace:configure.ac:1157: -1- AC_SUBST_TRACE([HAVE_VSOCK_TRUE]) m4trace:configure.ac:1157: -1- m4_pattern_allow([^HAVE_VSOCK_TRUE$]) m4trace:configure.ac:1157: -1- AC_SUBST([HAVE_VSOCK_FALSE]) m4trace:configure.ac:1157: -1- AC_SUBST_TRACE([HAVE_VSOCK_FALSE]) m4trace:configure.ac:1157: -1- m4_pattern_allow([^HAVE_VSOCK_FALSE$]) m4trace:configure.ac:1157: -1- _AM_SUBST_NOTMAKE([HAVE_VSOCK_TRUE]) m4trace:configure.ac:1157: -1- _AM_SUBST_NOTMAKE([HAVE_VSOCK_FALSE]) m4trace:configure.ac:1160: -1- AC_DEFINE_TRACE_LITERAL([NO_XSM]) m4trace:configure.ac:1160: -1- m4_pattern_allow([^NO_XSM$]) m4trace:configure.ac:1164: -1- AC_DEFINE_TRACE_LITERAL([NO_XCOMPOSITE]) m4trace:configure.ac:1164: -1- m4_pattern_allow([^NO_XCOMPOSITE$]) m4trace:configure.ac:1176: -1- AC_DEFINE_TRACE_LITERAL([NO_MULTIMON]) m4trace:configure.ac:1176: -1- m4_pattern_allow([^NO_MULTIMON$]) m4trace:configure.ac:1176: -1- AH_OUTPUT([NO_MULTIMON], [/* Define to 1 if building without multimon support. */ #undef NO_MULTIMON]) m4trace:configure.ac:1218: -1- AC_SUBST([HGFS_LIBS]) m4trace:configure.ac:1218: -1- AC_SUBST_TRACE([HGFS_LIBS]) m4trace:configure.ac:1218: -1- m4_pattern_allow([^HGFS_LIBS$]) m4trace:configure.ac:1219: -1- AC_SUBST([TOOLS_VERSION]) m4trace:configure.ac:1219: -1- AC_SUBST_TRACE([TOOLS_VERSION]) m4trace:configure.ac:1219: -1- m4_pattern_allow([^TOOLS_VERSION$]) m4trace:configure.ac:1220: -1- AC_SUBST([TARGET_OS]) m4trace:configure.ac:1220: -1- AC_SUBST_TRACE([TARGET_OS]) m4trace:configure.ac:1220: -1- m4_pattern_allow([^TARGET_OS$]) m4trace:configure.ac:1221: -1- AC_SUBST([KERNEL_RELEASE]) m4trace:configure.ac:1221: -1- AC_SUBST_TRACE([KERNEL_RELEASE]) m4trace:configure.ac:1221: -1- m4_pattern_allow([^KERNEL_RELEASE$]) m4trace:configure.ac:1222: -1- AC_SUBST([LINUXINCLUDE]) m4trace:configure.ac:1222: -1- AC_SUBST_TRACE([LINUXINCLUDE]) m4trace:configure.ac:1222: -1- m4_pattern_allow([^LINUXINCLUDE$]) m4trace:configure.ac:1223: -1- AC_SUBST([MODULES_OS]) m4trace:configure.ac:1223: -1- AC_SUBST_TRACE([MODULES_OS]) m4trace:configure.ac:1223: -1- m4_pattern_allow([^MODULES_OS$]) m4trace:configure.ac:1224: -1- AC_SUBST([MODULES_DIR]) m4trace:configure.ac:1224: -1- AC_SUBST_TRACE([MODULES_DIR]) m4trace:configure.ac:1224: -1- m4_pattern_allow([^MODULES_DIR$]) m4trace:configure.ac:1225: -1- AC_SUBST([MODULES]) m4trace:configure.ac:1225: -1- AC_SUBST_TRACE([MODULES]) m4trace:configure.ac:1225: -1- m4_pattern_allow([^MODULES$]) m4trace:configure.ac:1226: -1- AC_SUBST([COMMON_XLIBS]) m4trace:configure.ac:1226: -1- AC_SUBST_TRACE([COMMON_XLIBS]) m4trace:configure.ac:1226: -1- m4_pattern_allow([^COMMON_XLIBS$]) m4trace:configure.ac:1227: -1- AC_SUBST([XSM_LIBS]) m4trace:configure.ac:1227: -1- AC_SUBST_TRACE([XSM_LIBS]) m4trace:configure.ac:1227: -1- m4_pattern_allow([^XSM_LIBS$]) m4trace:configure.ac:1228: -1- AC_SUBST([XCOMPOSITE_LIBS]) m4trace:configure.ac:1228: -1- AC_SUBST_TRACE([XCOMPOSITE_LIBS]) m4trace:configure.ac:1228: -1- m4_pattern_allow([^XCOMPOSITE_LIBS$]) m4trace:configure.ac:1229: -1- AC_SUBST([PAM_PREFIX]) m4trace:configure.ac:1229: -1- AC_SUBST_TRACE([PAM_PREFIX]) m4trace:configure.ac:1229: -1- m4_pattern_allow([^PAM_PREFIX$]) m4trace:configure.ac:1230: -1- AC_SUBST([PLUGIN_CPPFLAGS]) m4trace:configure.ac:1230: -1- AC_SUBST_TRACE([PLUGIN_CPPFLAGS]) m4trace:configure.ac:1230: -1- m4_pattern_allow([^PLUGIN_CPPFLAGS$]) m4trace:configure.ac:1231: -1- AC_SUBST([PLUGIN_LDFLAGS]) m4trace:configure.ac:1231: -1- AC_SUBST_TRACE([PLUGIN_LDFLAGS]) m4trace:configure.ac:1231: -1- m4_pattern_allow([^PLUGIN_LDFLAGS$]) m4trace:configure.ac:1232: -1- AC_SUBST([VMTOOLS_CPPFLAGS]) m4trace:configure.ac:1232: -1- AC_SUBST_TRACE([VMTOOLS_CPPFLAGS]) m4trace:configure.ac:1232: -1- m4_pattern_allow([^VMTOOLS_CPPFLAGS$]) m4trace:configure.ac:1233: -1- AC_SUBST([VMTOOLS_LIBS]) m4trace:configure.ac:1233: -1- AC_SUBST_TRACE([VMTOOLS_LIBS]) m4trace:configure.ac:1233: -1- m4_pattern_allow([^VMTOOLS_LIBS$]) m4trace:configure.ac:1234: -1- AC_SUBST([RPCGENFLAGS]) m4trace:configure.ac:1234: -1- AC_SUBST_TRACE([RPCGENFLAGS]) m4trace:configure.ac:1234: -1- m4_pattern_allow([^RPCGENFLAGS$]) m4trace:configure.ac:1235: -1- AC_SUBST([XDR_LIBS]) m4trace:configure.ac:1235: -1- AC_SUBST_TRACE([XDR_LIBS]) m4trace:configure.ac:1235: -1- m4_pattern_allow([^XDR_LIBS$]) m4trace:configure.ac:1236: -1- AC_SUBST([TEST_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1236: -1- AC_SUBST_TRACE([TEST_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1236: -1- m4_pattern_allow([^TEST_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1237: -1- AC_SUBST([COMMON_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1237: -1- AC_SUBST_TRACE([COMMON_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1237: -1- m4_pattern_allow([^COMMON_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1238: -1- AC_SUBST([VMSVC_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1238: -1- AC_SUBST_TRACE([VMSVC_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1238: -1- m4_pattern_allow([^VMSVC_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1239: -1- AC_SUBST([VMUSR_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1239: -1- AC_SUBST_TRACE([VMUSR_PLUGIN_INSTALLDIR]) m4trace:configure.ac:1239: -1- m4_pattern_allow([^VMUSR_PLUGIN_INSTALLDIR$]) m4trace:configure.ac:1244: -1- AC_SUBST([SYSDIR]) m4trace:configure.ac:1244: -1- AC_SUBST_TRACE([SYSDIR]) m4trace:configure.ac:1244: -1- m4_pattern_allow([^SYSDIR$]) m4trace:configure.ac:1246: -1- AC_SUBST([INSTVMSG]) m4trace:configure.ac:1246: -1- AC_SUBST_TRACE([INSTVMSG]) m4trace:configure.ac:1246: -1- m4_pattern_allow([^INSTVMSG$]) m4trace:configure.ac:1247: -1- AC_SUBST([RPCGEN_WRAPPER]) m4trace:configure.ac:1247: -1- AC_SUBST_TRACE([RPCGEN_WRAPPER]) m4trace:configure.ac:1247: -1- m4_pattern_allow([^RPCGEN_WRAPPER$]) m4trace:configure.ac:1251: -1- AC_SUBST([LIB_AUTH_CPPFLAGS]) m4trace:configure.ac:1251: -1- AC_SUBST_TRACE([LIB_AUTH_CPPFLAGS]) m4trace:configure.ac:1251: -1- m4_pattern_allow([^LIB_AUTH_CPPFLAGS$]) m4trace:configure.ac:1252: -1- AC_SUBST([LIB_IMPERSONATE_CPPFLAGS]) m4trace:configure.ac:1252: -1- AC_SUBST_TRACE([LIB_IMPERSONATE_CPPFLAGS]) m4trace:configure.ac:1252: -1- m4_pattern_allow([^LIB_IMPERSONATE_CPPFLAGS$]) m4trace:configure.ac:1253: -1- AC_SUBST([LIB_USER_CPPFLAGS]) m4trace:configure.ac:1253: -1- AC_SUBST_TRACE([LIB_USER_CPPFLAGS]) m4trace:configure.ac:1253: -1- m4_pattern_allow([^LIB_USER_CPPFLAGS$]) m4trace:configure.ac:1254: -1- AC_SUBST([LIBVMTOOLS_LIBADD]) m4trace:configure.ac:1254: -1- AC_SUBST_TRACE([LIBVMTOOLS_LIBADD]) m4trace:configure.ac:1254: -1- m4_pattern_allow([^LIBVMTOOLS_LIBADD$]) m4trace:configure.ac:1258: -1- AC_SUBST([VIX_LIBADD]) m4trace:configure.ac:1258: -1- AC_SUBST_TRACE([VIX_LIBADD]) m4trace:configure.ac:1258: -1- m4_pattern_allow([^VIX_LIBADD$]) m4trace:configure.ac:1259: -1- AC_SUBST([VGAUTH_LIBADD]) m4trace:configure.ac:1259: -1- AC_SUBST_TRACE([VGAUTH_LIBADD]) m4trace:configure.ac:1259: -1- m4_pattern_allow([^VGAUTH_LIBADD$]) m4trace:configure.ac:1264: -1- AC_CONFIG_FILES([ \ Makefile \ lib/Makefile \ lib/appUtil/Makefile \ lib/auth/Makefile \ lib/backdoor/Makefile \ lib/asyncsocket/Makefile \ lib/sslDirect/Makefile \ lib/pollGtk/Makefile \ lib/poll/Makefile \ lib/dataMap/Makefile \ lib/hashMap/Makefile \ lib/dict/Makefile \ lib/dynxdr/Makefile \ lib/err/Makefile \ lib/file/Makefile \ lib/foundryMsg/Makefile \ lib/glibUtils/Makefile \ lib/guestApp/Makefile \ lib/guestRpc/Makefile \ lib/hgfs/Makefile \ lib/hgfsBd/Makefile \ lib/hgfsHelper/Makefile \ lib/hgfsServer/Makefile \ lib/hgfsServerManagerGuest/Makefile \ lib/hgfsServerPolicyGuest/Makefile \ lib/hgfsUri/Makefile \ lib/impersonate/Makefile \ lib/lock/Makefile \ lib/message/Makefile \ lib/misc/Makefile \ lib/netUtil/Makefile \ lib/nicInfo/Makefile \ lib/panic/Makefile \ lib/panicDefault/Makefile \ lib/procMgr/Makefile \ lib/rpcChannel/Makefile \ lib/rpcIn/Makefile \ lib/rpcOut/Makefile \ lib/rpcVmx/Makefile \ lib/slashProc/Makefile \ lib/string/Makefile \ lib/stubs/Makefile \ lib/syncDriver/Makefile \ lib/system/Makefile \ lib/unicode/Makefile \ lib/user/Makefile \ lib/vmCheck/Makefile \ lib/vmSignal/Makefile \ lib/wiper/Makefile \ lib/xdg/Makefile \ services/Makefile \ services/vmtoolsd/Makefile \ services/plugins/Makefile \ services/plugins/desktopEvents/Makefile \ services/plugins/dndcp/Makefile \ services/plugins/grabbitmqProxy/Makefile \ services/plugins/guestInfo/Makefile \ services/plugins/hgfsServer/Makefile \ services/plugins/powerOps/Makefile \ services/plugins/resolutionSet/Makefile \ services/plugins/timeSync/Makefile \ services/plugins/vix/Makefile \ services/plugins/vmbackup/Makefile \ services/plugins/deployPkg/Makefile \ vmware-user-suid-wrapper/Makefile \ toolbox/Makefile \ hgfsclient/Makefile \ hgfsmounter/Makefile \ checkvm/Makefile \ rpctool/Makefile \ namespacetool/Makefile \ guestproxycerttool/Makefile \ vgauth/Makefile \ vgauth/lib/Makefile \ vgauth/cli/Makefile \ vgauth/service/Makefile \ libguestlib/Makefile \ libguestlib/vmguestlib.pc \ libDeployPkg/Makefile \ libDeployPkg/libDeployPkg.pc \ libhgfs/Makefile \ libvmtools/Makefile \ xferlogs/Makefile \ modules/Makefile \ vmblock-fuse/Makefile \ vmhgfs-fuse/Makefile \ vmblockmounter/Makefile \ tests/Makefile \ tests/vmrpcdbg/Makefile \ tests/testDebug/Makefile \ tests/testPlugin/Makefile \ tests/testVmblock/Makefile \ docs/Makefile \ docs/api/Makefile \ scripts/Makefile \ scripts/build/rpcgen_wrapper.sh \ ]) m4trace:configure.ac:1366: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) m4trace:configure.ac:1366: -1- m4_pattern_allow([^LIB@&t@OBJS$]) m4trace:configure.ac:1366: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([LTLIBOBJS]) m4trace:configure.ac:1366: -1- m4_pattern_allow([^LTLIBOBJS$]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([top_builddir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([srcdir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([abs_srcdir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([top_srcdir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([abs_top_srcdir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([builddir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([abs_builddir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([abs_top_builddir]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([INSTALL]) m4trace:configure.ac:1366: -1- AC_SUBST_TRACE([MKDIR_P]) m4trace:configure.ac:1366: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) open-vm-tools-10.0.7-3227872/autom4te.cache/output.00000644000000000000000000421035112660700531020103 0ustar rootroot@%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. @%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 10.0.7. @%:@ @%:@ Report bugs to . @%:@ @%:@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @%:@ 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ( test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } ( test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" SHELL=${CONFIG_SHELL-/bin/sh} exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIB@&t@OBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' PACKAGE_VERSION='10.0.7' PACKAGE_STRING='open-vm-tools 10.0.7' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef 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 datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar 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 CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE SED LN_S LIBTOOL GREP EGREP FGREP LD DUMPBIN ac_ct_DUMPBIN NM OBJDUMP DLLTOOL AR ac_ct_AR RANLIB MANIFEST_TOOL DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 CXXCPP HAVE_PKG_CONFIG XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS ac_vmw_lib_cfg MSPACK_CPPFLAGS MSPACK_LIBS GLIB2_CPPFLAGS GLIB2_LIBS GMODULE_CPPFLAGS GMODULE_LIBS GOBJECT_CPPFLAGS GOBJECT_LIBS GTHREAD_CPPFLAGS GTHREAD_LIBS have_genmarshal FUSE_CPPFLAGS FUSE_LIBS PAM_CPPFLAGS PAM_LIBS SSL_CPPFLAGS SSL_LIBS XERCES_CPPFLAGS XERCES_LIBS XMLSECURITY_CPPFLAGS XMLSECURITY_LIBS CUNIT_CPPFLAGS CUNIT_LIBS GTK_CPPFLAGS GTK_LIBS GTKMM_CPPFLAGS GTKMM_LIBS PROCPS_CPPFLAGS PROCPS_LIBS DNET_CPPFLAGS DNET_LIBS have_cxx ICU_CPPFLAGS ICU_LIBS RPCGEN have_doxygen DOT HAVE_DOT MSCGEN MSCGEN_DIR BUILD_HGFSMOUNTER_TRUE BUILD_HGFSMOUNTER_FALSE LINUX_TRUE LINUX_FALSE SOLARIS_TRUE SOLARIS_FALSE FREEBSD_TRUE FREEBSD_FALSE FREEBSD_CUSTOM_SYSDIR_TRUE FREEBSD_CUSTOM_SYSDIR_FALSE THIRTY_TWO_BIT_USERSPACE_TRUE THIRTY_TWO_BIT_USERSPACE_FALSE HAVE_X11_TRUE HAVE_X11_FALSE HAVE_ICU_TRUE HAVE_ICU_FALSE WITH_KERNEL_MODULES_TRUE WITH_KERNEL_MODULES_FALSE HAVE_XSM_TRUE HAVE_XSM_FALSE HAVE_XCOMPOSITE_TRUE HAVE_XCOMPOSITE_FALSE ENABLE_TESTS_TRUE ENABLE_TESTS_FALSE WITH_ROOT_PRIVILEGES_TRUE WITH_ROOT_PRIVILEGES_FALSE HAVE_DNET_TRUE HAVE_DNET_FALSE HAVE_DOXYGEN_TRUE HAVE_DOXYGEN_FALSE HAVE_FUSE_TRUE HAVE_FUSE_FALSE HAVE_GNU_LD_TRUE HAVE_GNU_LD_FALSE HAVE_GTKMM_TRUE HAVE_GTKMM_FALSE HAVE_PAM_TRUE HAVE_PAM_FALSE USE_SLASH_PROC_TRUE USE_SLASH_PROC_FALSE USE_PRINTF_WRAPPERS_TRUE USE_PRINTF_WRAPPERS_FALSE ENABLE_DEPLOYPKG_TRUE ENABLE_DEPLOYPKG_FALSE ENABLE_GRABBITMQPROXY_TRUE ENABLE_GRABBITMQPROXY_FALSE ENABLE_VGAUTH_TRUE ENABLE_VGAUTH_FALSE HAVE_VSOCK_TRUE HAVE_VSOCK_FALSE HGFS_LIBS TOOLS_VERSION TARGET_OS KERNEL_RELEASE LINUXINCLUDE MODULES_OS MODULES_DIR MODULES COMMON_XLIBS XSM_LIBS XCOMPOSITE_LIBS PAM_PREFIX PLUGIN_CPPFLAGS PLUGIN_LDFLAGS VMTOOLS_CPPFLAGS VMTOOLS_LIBS RPCGENFLAGS XDR_LIBS TEST_PLUGIN_INSTALLDIR COMMON_PLUGIN_INSTALLDIR VMSVC_PLUGIN_INSTALLDIR VMUSR_PLUGIN_INSTALLDIR SYSDIR INSTVMSG RPCGEN_WRAPPER LIB_AUTH_CPPFLAGS LIB_IMPERSONATE_CPPFLAGS LIB_USER_CPPFLAGS LIBVMTOOLS_LIBADD VIX_LIBADD VGAUTH_LIBADD LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP XMKMF' # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$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 ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -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'` 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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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'` 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; }; } 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 directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 open-vm-tools 10.0.7 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root @<:@DATAROOTDIR/doc/open-vm-tools@:>@ --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _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 X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of open-vm-tools 10.0.7:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-multimon disables multimon, enabled by default --disable-docs disables generation of API documentation; by default, docs are built if doxygen is available. --disable-tests disable compilation of test code. --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) --disable-deploypkg do not build deploypkg plugin. --disable-grabbitmqproxy do not build grabbitmqproxy plugin. --disable-vgauth do not build vgauth. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-root-privileges does not perform any operations that require root privileges --without-kernel-modules does not compile or install the kernel modules --with-kernel-release specifies the kernel release you want to build against --with-linuxdir specifies the Linux directory you want to use --without-gtk2 compiles without Gtk 2.0 --without-gtkmm compiles without Gtkmm, sigc++, and related libs --with-pic@<:@=PKGS@:>@ try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-x use the X Window System --without-pam compiles without PAM support. --without-ssl compiles without openssl support (disables grabbitmqproxy and vgauth). --without-xmlsecurity compiles without xml-security-c support (disables vgauth). --without-xerces compiles without xerces support (disables vgauth). --with-pam-prefix specifies where pam files go. Default is $(sysconfdir) --without-procps compiles without libproc (disables support for meminfo) --without-dnet compiles without libdnet (disables support for nicinfo) --without-icu disables support for ICU 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective 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 XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF open-vm-tools configure 10.0.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by open-vm-tools $as_me 10.0.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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 IFS=$as_save_IFS } >&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_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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 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, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX @%:@@%:@ ----------------- @%:@@%:@ @%:@@%:@ Output variables. @%:@@%:@ @%:@@%:@ ----------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX @%:@@%:@ ------------------- @%:@@%:@ @%:@@%:@ File substitutions. @%:@@%:@ @%:@@%:@ ------------------- @%:@@%:@ _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX @%:@@%:@ ----------- @%:@@%:@ @%:@@%:@ confdefs.h. @%:@@%:@ @%:@@%:@ ----------- @%:@@%:@ _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file 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 $ac_precious_vars; 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 # In order to make this configure script auto-detect situations where # people have a 32-bit userland running with a 64-bit kernel, we try to ask # the compiler (assumedly gcc) for its default Target:. # We have to set up $TEST_CC manually, since AC_PROG_CC hasn't yet been run (and can't be until AC_CANONICAL_HOST & AC_CANONICAL_BUILD are run) # The purpose of all this is to set up $host_alias/$build_alias in a more # intelligent way than config.guess currently does. TEST_CC="$CC_FOR_BUILD" test -z "$TEST_CC" && TEST_CC="$HOST_CC" test -z "$TEST_CC" && TEST_CC="$CC" if test -n "$TEST_CC" -a -z "$host_alias"; then host_alias="`$TEST_CC -dumpmachine`" if test -z "$build_alias" -a -n "$host_alias"; then build_alias="$host_alias" fi fi unset TEST_CC # checkvm/checkvm.c has no special significance - we just need to pass in a file that # helps autoconf verify that it really has found the source tree. # Keep the top-level directory tidy by putting auxiliary build tools and local # macros in separate subdirectories. 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 # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { 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 if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac # Quote the regular expressions case "$host_cpu" in i[3456]86) userSpaceBitness="32" ;; x86_64) userSpaceBitness="64" ;; *) { { echo "$as_me:$LINENO: error: Unknown architecture." >&5 echo "$as_me: error: Unknown architecture." >&2;} { (exit 1); exit 1; }; } ;; esac # Operational arguments. # Check whether --with-root-privileges was given. if test "${with_root_privileges+set}" = set; then withval=$with_root_privileges; else with_root_privileges=yes fi # Kernel arguments. # The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible # to getOsVersion() # Check whether --with-kernel-modules was given. if test "${with_kernel_modules+set}" = set; then withval=$with_kernel_modules; else with_kernel_modules=yes fi # Check whether --with-kernel-release was given. if test "${with_kernel_release+set}" = set; then withval=$with_kernel_release; KERNEL_RELEASE="$withval" else KERNEL_RELEASE=`uname -r` fi # Check whether --with-linuxdir was given. if test "${with_linuxdir+set}" = set; then withval=$with_linuxdir; LINUXDIR="$withval" else LINUXDIR=/lib/modules/$KERNEL_RELEASE fi # Turn the uname output into something we can run comparisons on. getOsVersion() { major_version="`echo $KERNEL_RELEASE | cut -f1 -d. | cut -f1 -d-`" minor_version="`echo $KERNEL_RELEASE | cut -f2 -d. | cut -f1 -d-`" micro_version="`echo $KERNEL_RELEASE | cut -f3 -d. | cut -f1 -d-`" printf '%02d%02d%03d' $major_version $minor_version $micro_version } case "$host_os" in linux*) os="linux" ;; freebsd*) os="freebsd" ;; kfreebsd*-gnu) os="kfreebsd-gnu" ;; solaris*) os="solaris" ;; *) { echo "$as_me:$LINENO: WARNING: This is an untested and unsupported Operating System. Proceed at your own peril." >&5 echo "$as_me: WARNING: This is an untested and unsupported Operating System. Proceed at your own peril." >&2;} ;; esac osVersion="`getOsVersion`" if test "$with_kernel_modules" = "yes"; then case "$os" in linux) if test "$osVersion" -lt 206009; then { { echo "$as_me:$LINENO: error: Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers." >&5 echo "$as_me: error: Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers." >&2;} { (exit 1); exit 1; }; } fi if test ! -d "$LINUXDIR/kernel/"; then { { echo "$as_me:$LINENO: error: $LINUXDIR/kernel does not exist" >&5 echo "$as_me: error: $LINUXDIR/kernel does not exist" >&2;} { (exit 1); exit 1; }; } fi LINUXINCLUDE="$LINUXDIR/build/include" if test ! -d "$LINUXINCLUDE"; then { { echo "$as_me:$LINENO: error: Can't find include dir under $LINUXDIR" >&5 echo "$as_me: error: Can't find include dir under $LINUXDIR" >&2;} { (exit 1); exit 1; }; } fi ;; freebsd) freebsd_sysdir=/usr/src/sys if test -n "$SYSDIR"; then freebsd_sysdir="$SYSDIR" fi if test ! -f "$freebsd_sysdir/conf/kmod.mk"; then { { echo "$as_me:$LINENO: error: FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules." >&5 echo "$as_me: error: FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules." >&2;} { (exit 1); exit 1; }; } fi ;; esac fi # Arguments for disabling individual open-vm-tools features or libraries. # Check whether --enable-multimon was given. if test "${enable_multimon+set}" = set; then enableval=$enable_multimon; enable_multimon="$enableval" else enable_multimon="yes" fi # Check whether --with-gtk2 was given. if test "${with_gtk2+set}" = set; then withval=$with_gtk2; with_gtk2="$withval" else with_gtk2="yes" fi # Check whether --with-gtkmm was given. if test "${with_gtkmm+set}" = set; then withval=$with_gtkmm; with_gtkmm="$withval" else with_gtkmm="yes" fi # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then enableval=$enable_docs; enable_docs="$enableval" else enable_docs="yes" fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then enableval=$enable_tests; enable_tests="$enableval" else enable_tests="auto" fi am__api_version='1.10' # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 -f 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 { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if 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 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='open-vm-tools' VERSION='10.0.7' 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-"\$(SHELL) $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(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 -' ### ### Constants ### # These need to be declared after initialization. # Some of our macro call-sites require changes to # CPPFLAGS/CFLAGS/LDFLAGS. In such places, we save the original value # of CPPFLAGS/CFLAGS/LDFLAGS before the macro call and restore it when # the call is done. We must perform this save at each macro site, # because CPPFLAGS/CFLAGS/LDFLAGS may change over the course of # configuration. # # CPPFLAGS is intended for preprocessor options (-D and -I mainly) # CFLAGS is intended for compiler options (-O, -f, -W, and so forth) CPPFLAGS="$CPPFLAGS -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS" ### ### Programs ### # C preprocessor and compiler. 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 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then 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 # Check that 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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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_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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 # C++ compiler. Note that unlike AC_PROG_CC, this call does not trigger an # error if no C++ compiler was found; it'll just set the variable CXX to 'g++'. ac_ext=cpp 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 -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag 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 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 # This allows features like per-target compiler flags. I.e., you can compile # one copy of the same sources twice with different flags. (See lib/guestApp # for an example.) if test "x$CC" != xcc; then { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_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. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { 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; } cat >>confdefs.h <<\_ACEOF @%:@define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # Needed for the various install and uninstall hooks. # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 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 "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { 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 for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } # Needed for creating the archives in lib/ and the shared libraries. case `pwd` in *\ * | *\ *) { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. 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 delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { echo "$as_me:$LINENO: checking how to print strings" >&5 echo $ECHO_N "checking how to print strings... $ECHO_C" >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { echo "$as_me:$LINENO: result: printf" >&5 echo "${ECHO_T}printf" >&6; } ;; print*) { echo "$as_me:$LINENO: result: print -r" >&5 echo "${ECHO_T}print -r" >&6; } ;; *) { echo "$as_me:$LINENO: result: cat" >&5 echo "${ECHO_T}cat" >&6; } ;; esac { 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 "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_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_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for fgrep" >&5 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else # Extract the first word of "fgrep" to use in msg output if test -z "$FGREP"; then set dummy fgrep; ac_prog_name=$2 if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS fi FGREP="$ac_cv_path_FGREP" if test -z "$FGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-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 BSD- or MS-compatible name lister (nm)" >&5 echo $ECHO_N "checking for BSD- or MS-compatible name lister (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 : ${lt_cv_path_NM=no} fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 echo "${ECHO_T}$DUMPBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } if test "${lt_cv_nm_interface+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 echo "${ECHO_T}$lt_cv_nm_interface" >&6; } # 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* | cegcc*) # 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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` fi ;; 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 max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { echo "$as_me:$LINENO: result: $xsi_shell" >&5 echo "${ECHO_T}$xsi_shell" >&6; } { echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { echo "$as_me:$LINENO: result: $lt_shell_append" >&5 echo "${ECHO_T}$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { echo "$as_me:$LINENO: checking how to convert $build file names to $host format" >&5 echo $ECHO_N "checking how to convert $build file names to $host format... $ECHO_C" >&6; } if test "${lt_cv_to_host_file_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { echo "$as_me:$LINENO: result: $lt_cv_to_host_file_cmd" >&5 echo "${ECHO_T}$lt_cv_to_host_file_cmd" >&6; } { echo "$as_me:$LINENO: checking how to convert $build file names to toolchain format" >&5 echo $ECHO_N "checking how to convert $build file names to toolchain format... $ECHO_C" >&6; } if test "${lt_cv_to_tool_file_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { echo "$as_me:$LINENO: result: $lt_cv_to_tool_file_cmd" >&5 echo "${ECHO_T}$lt_cv_to_tool_file_cmd" >&6; } { 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 cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 echo "${ECHO_T}$OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize 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 aix[4-9]*) 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', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | 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 ;; haiku*) 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])(-bit)?( [LM]SB)? 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 ;; interix[3-9]*) # 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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=pass_all ;; 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 ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 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 ;; tpf*) 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_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 echo "${ECHO_T}$DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { echo "$as_me:$LINENO: checking how to associate runtime and link libraries" >&5 echo $ECHO_N "checking how to associate runtime and link libraries... $ECHO_C" >&6; } if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 echo "${ECHO_T}$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { echo "$as_me:$LINENO: checking for archiver @FILE support" >&5 echo $ECHO_N "checking for archiver @FILE support... $ECHO_C" >&6; } if test "${lt_cv_ar_at_file+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ar_at_file=no 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { (eval echo "$as_me:$LINENO: \"$lt_ar_try\"") >&5 (eval $lt_ar_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { (eval echo "$as_me:$LINENO: \"$lt_ar_try\"") >&5 (eval $lt_ar_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $lt_cv_ar_at_file" >&5 echo "${ECHO_T}$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' 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 \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 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]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # 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 # Try without a prefix underscore, 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. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF 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 # 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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 -rf 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { echo "$as_me:$LINENO: checking for sysroot" >&5 echo $ECHO_N "checking for sysroot... $ECHO_C" >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { echo "$as_me:$LINENO: result: ${with_sysroot}" >&5 echo "${ECHO_T}${with_sysroot}" >&6; } { { echo "$as_me:$LINENO: error: The sysroot must be an absolute path." >&5 echo "$as_me: error: The sysroot must be an absolute path." >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: result: ${lt_sysroot:-no}" >&5 echo "${ECHO_T}${lt_sysroot:-no}" >&6; } # Check whether --enable-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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 ;; *-*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*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { echo "$as_me:$LINENO: result: $MANIFEST_TOOL" >&5 echo "${ECHO_T}$MANIFEST_TOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_MANIFEST_TOOL" >&5 echo "${ECHO_T}$ac_ct_MANIFEST_TOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { echo "$as_me:$LINENO: checking if $MANIFEST_TOOL is a manifest tool" >&5 echo $ECHO_N "checking if $MANIFEST_TOOL is a manifest tool... $ECHO_C" >&6; } if test "${lt_cv_path_mainfest_tool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_path_mainfest_tool" >&5 echo "${ECHO_T}$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 echo "${ECHO_T}$DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { echo "$as_me:$LINENO: result: $NMEDIT" >&5 echo "${ECHO_T}$NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { echo "$as_me:$LINENO: result: $LIPO" >&5 echo "${ECHO_T}$LIPO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 echo "${ECHO_T}$ac_ct_LIPO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { echo "$as_me:$LINENO: result: $OTOOL" >&5 echo "${ECHO_T}$OTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 echo "${ECHO_T}$ac_ct_OTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { echo "$as_me:$LINENO: result: $OTOOL64" >&5 echo "${ECHO_T}$OTOOL64" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 echo "${ECHO_T}$ac_ct_OTOOL64" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_ld_exported_symbols_list=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } { echo "$as_me:$LINENO: checking for -force_load linker flag" >&5 echo $ECHO_N "checking for -force_load linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_force_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { echo "$as_me:$LINENO: result: $lt_cv_ld_force_load" >&5 echo "${ECHO_T}$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac { 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-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 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 --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-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 # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST 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 cat >>confdefs.h <<_ACEOF @%:@define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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 # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file 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 <<_LT_EOF 1>&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 _LT_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 <<_LT_EOF 1>&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 _LT_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 # Use C for the default configuration in the libtool script 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;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # 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 the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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 echo "$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 -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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= 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # 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 ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; 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 ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) 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 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@&t@ -DPIC" ;; esac { 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 "${lt_cv_prog_compiler_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # 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_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic@&t@ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works=yes fi fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_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 # # 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_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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; } { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # 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_|_GLOBAL__F[ID]_.*' # 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. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = 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>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [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 aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; 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* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' 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 ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 <<_LT_EOF 1>&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. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 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 ;; 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ;; aix[4-9]*) 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 # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) 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_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' 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 : 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 link_all_deplibs=no 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 export_dynamic_flag_spec='${wl}-bexpall' # 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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath_+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ 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 func_echo_all "${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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath_+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ 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' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper 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 `func_echo_all "$deplibs" | $SED '\''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' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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* | dragonfly*) archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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 && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${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 hardcode_direct_absolute=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 && test "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${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' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { echo "$as_me:$LINENO: checking if $CC understands -b" >&5 echo $ECHO_N "checking if $CC understands -b... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler__b+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5 echo "${ECHO_T}$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${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 ;; 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_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { echo "$as_me:$LINENO: checking whether the $host_os linker accepts -exported_symbol" >&5 echo $ECHO_N "checking whether the $host_os linker accepts -exported_symbol... $ECHO_C" >&6; } if test "${lt_cv_irix_exported_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_irix_exported_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_irix_exported_symbol" >&5 echo "${ECHO_T}$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) 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 ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes 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 else ld_shlibs=no 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) 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' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac 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 and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; 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* | sco3.2v5.0.[024]*) 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='${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,$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 ;; 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 if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # 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; } if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $RM conftest* echo "$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 lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi 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" 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 # correct to gnu/linux during the next big refactor 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' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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}${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`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then lt_cv_shlibpath_overrides_runpath=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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-existent 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_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 || test "$inherit_rpath" = yes; 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 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* | cegcc*) 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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="-ldld" 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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="-ldld" 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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_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 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" old_striplib="$STRIP -S" { 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 # 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 ;; aix[4-9]*) 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; } 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" 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=cpp 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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=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 else _lt_caught_CXX_error=yes fi ac_ext=cpp 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= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # 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 echo "$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 echo "$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 -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS 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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when 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 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 $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -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 -v "^Configured with:" | $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 ;; aix[4-9]*) 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].*|aix[5-9]*) 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_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' 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 : 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 export_dynamic_flag_spec_CXX='${wl}-bexpall' # 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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath__CXX+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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 func_echo_all "${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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath__CXX+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi 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* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' 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 ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then 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${_lt_dsymutil}" archive_expsym_cmds_CXX="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no 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 ;; freebsd2.*) # 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* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; 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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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*) ;; *) 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_direct_absolute_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; func_echo_all "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${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 ;; interix[3-9]*) 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" && func_echo_all "-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 $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) 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; func_echo_all "$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* | ecpc* ) # 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* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols 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' ;; esac 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; func_echo_all \"$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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 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='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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' ;; esac ;; 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::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes 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=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | 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. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) 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" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) 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" && func_echo_all "-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' ;; esac 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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac 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 -v "^Configured with:" | $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* | sunCC*) # 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 compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # 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 $pic_flag -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 $pic_flag -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 -v "^Configured with:" | $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 -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac 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. 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='${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,$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' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) 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 ;; 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" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # 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= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac 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 # 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 for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${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 fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # 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= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # 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. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries 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= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # 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 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # 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_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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' ;; 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* | 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* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # 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' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; 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* | sunCC*) # 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 ;; 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 ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac 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@&t@ -DPIC" ;; esac { 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 "${lt_cv_prog_compiler_pic_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # 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_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX@&t@ -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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works_CXX=yes fi fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_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 # # 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_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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; } { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # 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 # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". 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") || (\$ 2 == "W")) && (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* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) 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 with_gnu_ld_CXX=$with_gnu_ld # # 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; } if test "${lt_cv_archive_cmds_need_lc_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $RM conftest* echo "$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 lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_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* fi { echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; 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" 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 # correct to gnu/linux during the next big refactor 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' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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}${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`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then lt_cv_shlibpath_overrides_runpath=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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-existent 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_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 || test "$inherit_rpath_CXX" = yes; 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 fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test "$_lt_caught_CXX_error" != 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 ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "$ac_cv_prog_AR" = false; then { { echo "$as_me:$LINENO: error: The 'ar' utility was not found. Please put ar on the path." >&5 echo "$as_me: error: The 'ar' utility was not found. Please put ar on the path." >&2;} { (exit 1); exit 1; }; } fi # We use pkg-config to set up the cflags and libs for gtk. # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; 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_HAVE_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$HAVE_PKG_CONFIG"; then ac_cv_prog_HAVE_PKG_CONFIG="$HAVE_PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_HAVE_PKG_CONFIG="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_PKG_CONFIG" && ac_cv_prog_HAVE_PKG_CONFIG="no" fi fi HAVE_PKG_CONFIG=$ac_cv_prog_HAVE_PKG_CONFIG if test -n "$HAVE_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $HAVE_PKG_CONFIG" >&5 echo "${ECHO_T}$HAVE_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$GCC" != "yes"; then { { echo "$as_me:$LINENO: error: Only GCC is currently supported. Please put gcc in the path." >&5 echo "$as_me: error: Only GCC is currently supported. Please put gcc in the path." >&2;} { (exit 1); exit 1; }; } fi ### ### Libraries ### { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" 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 () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF @%:@define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi # # Check for libintl.h. When configuring using "--without-x", /usr/local/include # may not be added to the include path, so code that use glib's i18n functions # would fail to compile because it can't find libintl.h. # if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 libintl.h presence" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then : else have_libintl=no fi if test "$have_libintl" = "no"; then unset ac_cv_header_libintl_h CPPFLAGS="$CPPFLAGS -I/usr/local/include" if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 libintl.h presence" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then : else { { echo "$as_me:$LINENO: error: libintl.h not found. Make sure you have the gettext headers installed." >&5 echo "$as_me: error: libintl.h not found. Make sure you have the gettext headers installed." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-deploypkg was given. if test "${enable_deploypkg+set}" = set; then enableval=$enable_deploypkg; else enable_deploypkg=yes fi if test "$enable_deploypkg" = "yes"; then if test -z "mspack"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "MSPACK"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_MSPACK_CPPFLAGS}" || test -n "${CUSTOM_MSPACK_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_MSPACK_LIBS} -lmspack" if test -n "mspack.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_MSPACK_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_mspack_h+set}" = set; then { echo "$as_me:$LINENO: checking for mspack.h" >&5 echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 echo "${ECHO_T}$ac_cv_header_mspack_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking mspack.h usability" >&5 echo $ECHO_N "checking mspack.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 mspack.h presence" >&5 echo $ECHO_N "checking mspack.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: mspack.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: mspack.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: mspack.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: mspack.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: mspack.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: mspack.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for mspack.h" >&5 echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_mspack_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 echo "${ECHO_T}$ac_cv_header_mspack_h" >&6; } fi if test $ac_cv_header_mspack_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_mspack_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lmspack" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lmspack... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmspack $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then MSPACK_CPPFLAGS="${CUSTOM_MSPACK_CPPFLAGS}" MSPACK_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "libmspack"; then if test -n "0.0.20040308alpha"; then { echo "$as_me:$LINENO: checking for libmspack >= 0.0.20040308alpha (via pkg-config)" >&5 echo $ECHO_N "checking for libmspack >= 0.0.20040308alpha (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libmspack >= 0.0.20040308alpha'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for libmspack (via pkg-config)" >&5 echo $ECHO_N "checking for libmspack (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libmspack'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags libmspack`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs libmspack`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } MSPACK_CPPFLAGS="$ac_vmw_cppflags" MSPACK_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then MSPACK_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" MSPACK_LIBS="`$ac_vmw_lib_cfg --ldflags`" else MSPACK_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" MSPACK_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: mspack >= 0.0.20040308alpha is required." >&5 echo "$as_me: error: mspack >= 0.0.20040308alpha is required." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-grabbitmqproxy was given. if test "${enable_grabbitmqproxy+set}" = set; then enableval=$enable_grabbitmqproxy; else enable_grabbitmqproxy=yes fi # # Check for glib 2.6.14 or greater. # if test -z "glib-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GLIB2"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GLIB2_CPPFLAGS}" || test -n "${CUSTOM_GLIB2_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GLIB2_LIBS} -lglib-2.0" if test -n "glib.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GLIB2_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_glib_h+set}" = set; then { echo "$as_me:$LINENO: checking for glib.h" >&5 echo $ECHO_N "checking for glib.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking glib.h usability" >&5 echo $ECHO_N "checking glib.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 glib.h presence" >&5 echo $ECHO_N "checking glib.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: glib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: glib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: glib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: glib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: glib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: glib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: glib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: glib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: glib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: glib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for glib.h" >&5 echo $ECHO_N "checking for glib.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_glib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_h" >&6; } fi if test $ac_cv_header_glib_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "g_key_file_new"; then ac_vmw_function=g_key_file_new else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_glib-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lglib-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lglib-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lglib-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GLIB2_CPPFLAGS="${CUSTOM_GLIB2_CPPFLAGS}" GLIB2_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "glib-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for glib-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for glib-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'glib-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for glib-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for glib-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'glib-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags glib-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs glib-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GLIB2_CPPFLAGS="$ac_vmw_cppflags" GLIB2_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GLIB2_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GLIB2_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GLIB2_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GLIB2_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: glib2 >= 2.14.0 is required." >&5 echo "$as_me: error: glib2 >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gmodule-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GMODULE"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GMODULE_CPPFLAGS}" || test -n "${CUSTOM_GMODULE_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GMODULE_LIBS} -lgmodule-2.0" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GMODULE_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gmodule-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgmodule-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgmodule-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgmodule-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GMODULE_CPPFLAGS="${CUSTOM_GMODULE_CPPFLAGS}" GMODULE_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gmodule-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gmodule-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gmodule-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gmodule-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gmodule-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gmodule-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gmodule-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gmodule-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gmodule-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GMODULE_CPPFLAGS="$ac_vmw_cppflags" GMODULE_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GMODULE_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GMODULE_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GMODULE_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GMODULE_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: gmodule >= 2.14.0 is required." >&5 echo "$as_me: error: gmodule >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gobject-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GOBJECT"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GOBJECT_CPPFLAGS}" || test -n "${CUSTOM_GOBJECT_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GOBJECT_LIBS} -lgobject-2.0" if test -n "glib-object.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GOBJECT_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_glib_object_h+set}" = set; then { echo "$as_me:$LINENO: checking for glib-object.h" >&5 echo $ECHO_N "checking for glib-object.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_object_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_object_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_object_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking glib-object.h usability" >&5 echo $ECHO_N "checking glib-object.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 glib-object.h presence" >&5 echo $ECHO_N "checking glib-object.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: glib-object.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: glib-object.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: glib-object.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: glib-object.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: glib-object.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: glib-object.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: glib-object.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: glib-object.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: glib-object.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: glib-object.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for glib-object.h" >&5 echo $ECHO_N "checking for glib-object.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_object_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_glib_object_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_object_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_object_h" >&6; } fi if test $ac_cv_header_glib_object_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gobject-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgobject-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgobject-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgobject-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GOBJECT_CPPFLAGS="${CUSTOM_GOBJECT_CPPFLAGS}" GOBJECT_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gobject-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gobject-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gobject-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gobject-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gobject-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gobject-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gobject-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gobject-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gobject-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GOBJECT_CPPFLAGS="$ac_vmw_cppflags" GOBJECT_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GOBJECT_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GOBJECT_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GOBJECT_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GOBJECT_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: gobject >= 2.14.0 is required." >&5 echo "$as_me: error: gobject >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gthread-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTHREAD"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTHREAD_CPPFLAGS}" || test -n "${CUSTOM_GTHREAD_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTHREAD_LIBS} -lgthread-2.0" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTHREAD_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gthread-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgthread-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgthread-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgthread-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTHREAD_CPPFLAGS="${CUSTOM_GTHREAD_CPPFLAGS}" GTHREAD_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gthread-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gthread-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gthread-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gthread-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gthread-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gthread-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gthread-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gthread-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gthread-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTHREAD_CPPFLAGS="$ac_vmw_cppflags" GTHREAD_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTHREAD_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTHREAD_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTHREAD_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTHREAD_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: glib >= 2.14.0 is required." >&5 echo "$as_me: error: glib >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "glib-genmarshal", so it can be a program name with args. set dummy glib-genmarshal; 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_have_genmarshal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_genmarshal"; then ac_cv_prog_have_genmarshal="$have_genmarshal" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_genmarshal="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_genmarshal" && ac_cv_prog_have_genmarshal="no" fi fi have_genmarshal=$ac_cv_prog_have_genmarshal if test -n "$have_genmarshal"; then { echo "$as_me:$LINENO: result: $have_genmarshal" >&5 echo "${ECHO_T}$have_genmarshal" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$have_genmarshal" != "yes"; then { { echo "$as_me:$LINENO: error: glib-genmarshal is required; make sure it's available in your path." >&5 echo "$as_me: error: glib-genmarshal is required; make sure it's available in your path." >&2;} { (exit 1); exit 1; }; } fi # # Check for fuse. # if test -z "fuse"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "FUSE"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_FUSE_CPPFLAGS}" || test -n "${CUSTOM_FUSE_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_FUSE_LIBS} -lfuse" if test -n "fuse.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_FUSE_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_fuse_h+set}" = set; then { echo "$as_me:$LINENO: checking for fuse.h" >&5 echo $ECHO_N "checking for fuse.h... $ECHO_C" >&6; } if test "${ac_cv_header_fuse_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_fuse_h" >&5 echo "${ECHO_T}$ac_cv_header_fuse_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking fuse.h usability" >&5 echo $ECHO_N "checking fuse.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 fuse.h presence" >&5 echo $ECHO_N "checking fuse.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: fuse.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: fuse.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: fuse.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: fuse.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: fuse.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: fuse.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: fuse.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: fuse.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: fuse.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: fuse.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for fuse.h" >&5 echo $ECHO_N "checking for fuse.h... $ECHO_C" >&6; } if test "${ac_cv_header_fuse_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_fuse_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_fuse_h" >&5 echo "${ECHO_T}$ac_cv_header_fuse_h" >&6; } fi if test $ac_cv_header_fuse_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "fuse_main"; then ac_vmw_function=fuse_main else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_fuse_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lfuse" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lfuse... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then FUSE_CPPFLAGS="${CUSTOM_FUSE_CPPFLAGS}" FUSE_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "fuse"; then if test -n ""; then { echo "$as_me:$LINENO: checking for fuse >= (via pkg-config)" >&5 echo $ECHO_N "checking for fuse >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'fuse >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for fuse (via pkg-config)" >&5 echo $ECHO_N "checking for fuse (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'fuse'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags fuse`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs fuse`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } FUSE_CPPFLAGS="$ac_vmw_cppflags" FUSE_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then FUSE_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" FUSE_LIBS="`$ac_vmw_lib_cfg --ldflags`" else FUSE_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" FUSE_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_fuse=yes else true have_fuse=no; { echo "$as_me:$LINENO: WARNING: Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled." >&5 echo "$as_me: WARNING: Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled." >&2;} fi # # Check for PAM. # # Check whether --with-pam was given. if test "${with_pam+set}" = set; then withval=$with_pam; else with_pam=yes fi if test "$with_pam" = "yes"; then if test -z "$CUSTOM_PAM_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_PAM_CPPFLAGS="-I/usr/local/include" else CUSTOM_PAM_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_PAM_CPPFLAGS="${CUSTOM_PAM_CPPFLAGS}/" fi fi if test -z "pam"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PAM"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PAM_CPPFLAGS}" || test -n "${CUSTOM_PAM_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PAM_LIBS} -lpam" if test -n "security/pam_appl.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PAM_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_security_pam_appl_h+set}" = set; then { echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 echo $ECHO_N "checking security/pam_appl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 security/pam_appl.h presence" >&5 echo $ECHO_N "checking security/pam_appl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: security/pam_appl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_security_pam_appl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6; } fi if test $ac_cv_header_security_pam_appl_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "pam_start"; then ac_vmw_function=pam_start else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_pam_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lpam" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lpam... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PAM_CPPFLAGS="${CUSTOM_PAM_CPPFLAGS}" PAM_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PAM_CPPFLAGS="$ac_vmw_cppflags" PAM_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PAM_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PAM_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PAM_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PAM_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true PAM_CPPFLAGS="$PAM_CPPFLAGS -DUSE_PAM" else true feature="" if test -z "$feature"; then feature="PAM" fi { { echo "$as_me:$LINENO: error: Cannot find PAM library. Please configure without $feature (using --without-pam), or install the PAM libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find PAM library. Please configure without $feature (using --without-pam), or install the PAM libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-vgauth was given. if test "${enable_vgauth+set}" = set; then enableval=$enable_vgauth; else enable_vgauth=yes fi # # Check for openssl, xerces-c and xml-security-c # # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then withval=$with_ssl; enable_grabbitmqproxy=no enable_vgauth=no else with_ssl=yes fi # Check whether --with-xmlsecurity was given. if test "${with_xmlsecurity+set}" = set; then withval=$with_xmlsecurity; enable_vgauth=no else with_xmlsecurity=yes fi # Check whether --with-xerces was given. if test "${with_xerces+set}" = set; then withval=$with_xerces; enable_vgauth=no else with_xerces=yes fi if test "$enable_vgauth" = "yes" -o "$enable_grabbitmqproxy" = "yes"; then if test -z "$CUSTOM_SSL_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_SSL_CPPFLAGS="-I/usr/local/include" else CUSTOM_SSL_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_SSL_CPPFLAGS="${CUSTOM_SSL_CPPFLAGS}/" fi fi if test -z "ssl"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "SSL"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_SSL_CPPFLAGS}" || test -n "${CUSTOM_SSL_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_SSL_LIBS} -lssl" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_SSL_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_ssl_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lssl" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lssl... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then SSL_CPPFLAGS="${CUSTOM_SSL_CPPFLAGS}" SSL_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SSL_CPPFLAGS="$ac_vmw_cppflags" SSL_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then SSL_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" SSL_LIBS="`$ac_vmw_lib_cfg --ldflags`" else SSL_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" SSL_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="SSL" fi { { echo "$as_me:$LINENO: error: Cannot find SSL library. Please configure without $feature (using --without-ssl), or install the SSL libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find SSL library. Please configure without $feature (using --without-ssl), or install the SSL libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi if test "$enable_vgauth" = "yes"; then CPPFLAGS="$CPPFLAGS -DUSE_VGAUTH" if test -z "$CUSTOM_XERCES_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_XERCES_CPPFLAGS="-I/usr/local/include" else CUSTOM_XERCES_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_XERCES_CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS}/" fi fi if test -z "xerces-c"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "XERCES"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_XERCES_CPPFLAGS}" || test -n "${CUSTOM_XERCES_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_XERCES_LIBS} -lxerces-c" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_xerces-c_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lxerces-c" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lxerces-c... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxerces-c $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then XERCES_CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS}" XERCES_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } XERCES_CPPFLAGS="$ac_vmw_cppflags" XERCES_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then XERCES_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" XERCES_LIBS="`$ac_vmw_lib_cfg --ldflags`" else XERCES_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" XERCES_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="XERCES" fi { { echo "$as_me:$LINENO: error: Cannot find XERCES library. Please configure without $feature (using --without-xerces-c), or install the XERCES libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find XERCES library. Please configure without $feature (using --without-xerces-c), or install the XERCES libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi if test -z "$CUSTOM_XMLSECURITY_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_XMLSECURITY_CPPFLAGS="-I/usr/local/include" else CUSTOM_XMLSECURITY_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_XMLSECURITY_CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS}/" fi fi if test -z "xml-security-c"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "XMLSECURITY"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_XMLSECURITY_CPPFLAGS}" || test -n "${CUSTOM_XMLSECURITY_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_XMLSECURITY_LIBS} -lxml-security-c" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_xml-security-c_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lxml-security-c" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lxml-security-c... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxml-security-c $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then XMLSECURITY_CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS}" XMLSECURITY_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } XMLSECURITY_CPPFLAGS="$ac_vmw_cppflags" XMLSECURITY_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then XMLSECURITY_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" XMLSECURITY_LIBS="`$ac_vmw_lib_cfg --ldflags`" else XMLSECURITY_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" XMLSECURITY_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="XMLSECURITY" fi { { echo "$as_me:$LINENO: error: Cannot find XMLSECURITY library. Please configure without $feature (using --without-xml-security-c), or install the XMLSECURITY libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find XMLSECURITY library. Please configure without $feature (using --without-xml-security-c), or install the XMLSECURITY libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # # Check for CUnit and disable test code if not available. # if test "$enable_tests" = "auto" -o "$enable_tests" = "yes"; then if test -z "$CUSTOM_CUNIT_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_CUNIT_CPPFLAGS="-I/usr/local/include" else CUSTOM_CUNIT_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_CUNIT_CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS}/" fi fi if test -z "cunit"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "CUNIT"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_CUNIT_CPPFLAGS}" || test -n "${CUSTOM_CUNIT_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_CUNIT_LIBS} -lcunit" if test -n "CUnit/CUnit.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then { echo "$as_me:$LINENO: checking for CUnit/CUnit.h" >&5 echo $ECHO_N "checking for CUnit/CUnit.h... $ECHO_C" >&6; } if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_CUnit_CUnit_h" >&5 echo "${ECHO_T}$ac_cv_header_CUnit_CUnit_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking CUnit/CUnit.h usability" >&5 echo $ECHO_N "checking CUnit/CUnit.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 CUnit/CUnit.h presence" >&5 echo $ECHO_N "checking CUnit/CUnit.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: CUnit/CUnit.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for CUnit/CUnit.h" >&5 echo $ECHO_N "checking for CUnit/CUnit.h... $ECHO_C" >&6; } if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_CUnit_CUnit_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_CUnit_CUnit_h" >&5 echo "${ECHO_T}$ac_cv_header_CUnit_CUnit_h" >&6; } fi if test $ac_cv_header_CUnit_CUnit_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "CU_initialize_registry"; then ac_vmw_function=CU_initialize_registry else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_cunit_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lcunit" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lcunit... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcunit $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then CUNIT_CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS}" CUNIT_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } CUNIT_CPPFLAGS="$ac_vmw_cppflags" CUNIT_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then CUNIT_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" CUNIT_LIBS="`$ac_vmw_lib_cfg --ldflags`" else CUNIT_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" CUNIT_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_cunit=yes else true have_cunit=no fi if test "$have_cunit" = "no"; then if test "$enable_tests" = "yes"; then feature="" if test -z "$feature"; then feature="CUNIT" fi { { echo "$as_me:$LINENO: error: Cannot find CUNIT library. Please configure without $feature (using --without-cunit), or install the CUNIT libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find CUNIT library. Please configure without $feature (using --without-cunit), or install the CUNIT libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: CUnit not found, tests won't be compiled." >&5 echo "$as_me: WARNING: CUnit not found, tests won't be compiled." >&2;} fi fi fi # If the user explicitly disables X11, then don't try to detect the X-related libraries if test "$have_x" = "disabled"; then enable_multimon="no" elif test "$have_x" != "yes"; then { { echo "$as_me:$LINENO: error: The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s)." >&5 echo "$as_me: error: The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s)." >&2;} { (exit 1); exit 1; }; } else CPPFLAGS="$CPPFLAGS $X_CFLAGS" COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" { echo "$as_me:$LINENO: checking for XeviQueryVersion in -lXext" >&5 echo $ECHO_N "checking for XeviQueryVersion in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XeviQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XeviQueryVersion (); int main () { return XeviQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XeviQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XeviQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XeviQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XeviQueryVersion" >&6; } if test $ac_cv_lib_Xext_XeviQueryVersion = yes; then COMMON_XLIBS="-lXext $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s)." >&5 echo "$as_me: error: libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for X11/extensions/extutil.h" >&5 echo $ECHO_N "checking for X11/extensions/extutil.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_extensions_extutil_h+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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_X11_extensions_extutil_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_X11_extensions_extutil_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_extutil_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_extensions_extutil_h" >&6; } if test $ac_cv_header_X11_extensions_extutil_h = yes; then : else { { echo "$as_me:$LINENO: error: X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x)." >&5 echo "$as_me: error: X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x)." >&2;} { (exit 1); exit 1; }; } fi if test "$enable_multimon" != "no"; then { echo "$as_me:$LINENO: checking for XineramaQueryVersion in -lXinerama" >&5 echo $ECHO_N "checking for XineramaQueryVersion in -lXinerama... $ECHO_C" >&6; } if test "${ac_cv_lib_Xinerama_XineramaQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XineramaQueryVersion (); int main () { return XineramaQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xinerama_XineramaQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xinerama_XineramaQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryVersion" >&6; } if test $ac_cv_lib_Xinerama_XineramaQueryVersion = yes; then COMMON_XLIBS="-lXinerama $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s)." >&5 echo "$as_me: error: libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: checking for XOpenDevice in -lXi" >&5 echo $ECHO_N "checking for XOpenDevice in -lXi... $ECHO_C" >&6; } if test "${ac_cv_lib_Xi_XOpenDevice+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXi $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDevice (); int main () { return XOpenDevice (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xi_XOpenDevice=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xi_XOpenDevice=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xi_XOpenDevice" >&5 echo "${ECHO_T}$ac_cv_lib_Xi_XOpenDevice" >&6; } if test $ac_cv_lib_Xi_XOpenDevice = yes; then COMMON_XLIBS="-lXi $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s)." >&5 echo "$as_me: error: libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 echo $ECHO_N "checking for XRenderQueryVersion in -lXrender... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderQueryVersion (); int main () { return XRenderQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrender_XRenderQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrender_XRenderQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryVersion" >&6; } if test $ac_cv_lib_Xrender_XRenderQueryVersion = yes; then COMMON_XLIBS="-lXrender $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s)." >&5 echo "$as_me: error: libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XRRQueryVersion in -lXrandr" >&5 echo $ECHO_N "checking for XRRQueryVersion in -lXrandr... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrandr_XRRQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRRQueryVersion (); int main () { return XRRQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrandr_XRRQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrandr_XRRQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRQueryVersion" >&6; } if test $ac_cv_lib_Xrandr_XRRQueryVersion = yes; then COMMON_XLIBS="-lXrandr $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s)." >&5 echo "$as_me: error: libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XTestQueryExtension in -lXtst" >&5 echo $ECHO_N "checking for XTestQueryExtension in -lXtst... $ECHO_C" >&6; } if test "${ac_cv_lib_Xtst_XTestQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXtst $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XTestQueryExtension (); int main () { return XTestQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xtst_XTestQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xtst_XTestQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xtst_XTestQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xtst_XTestQueryExtension" >&6; } if test $ac_cv_lib_Xtst_XTestQueryExtension = yes; then COMMON_XLIBS="-lXtst $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s)." >&5 echo "$as_me: error: libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5 echo $ECHO_N "checking for SmcOpenConnection in -lSM... $ECHO_C" >&6; } if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSM $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SmcOpenConnection (); int main () { return SmcOpenConnection (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_SM_SmcOpenConnection=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_SM_SmcOpenConnection=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_SM_SmcOpenConnection" >&5 echo "${ECHO_T}$ac_cv_lib_SM_SmcOpenConnection" >&6; } if test $ac_cv_lib_SM_SmcOpenConnection = yes; then XSM_LIBS="-lSM -lICE" && have_xsm_lib="yes" else -lICE fi for ac_header in X11/SM/SMlib.h X11/ICE/ICElib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 have_xsm_header="yes" fi done if test "$have_xsm_lib" = "yes" -a "$have_xsm_header" = "yes"; then have_xsm="yes" fi { echo "$as_me:$LINENO: checking for XCompositeQueryExtension in -lXcomposite" >&5 echo $ECHO_N "checking for XCompositeQueryExtension in -lXcomposite... $ECHO_C" >&6; } if test "${ac_cv_lib_Xcomposite_XCompositeQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXcomposite $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XCompositeQueryExtension (); int main () { return XCompositeQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xcomposite_XCompositeQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xcomposite_XCompositeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&6; } if test $ac_cv_lib_Xcomposite_XCompositeQueryExtension = yes; then XCOMPOSITE_LIBS="-lXcomposite" else have_xcomposite="no" fi for ac_header in X11/extensions/Xcomposite.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 else have_xcomposite="no" fi done if test "$have_xcomposite" != "no"; then have_xcomposite="yes" fi # Check whether we have gtk+ 2.0. if test "$with_gtk2" != "no"; then # gdk_display_get_default_group (added in gtk+ 2.4.0) is function currently # needed by vmware-user. if test -z "gtk-x11-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTK"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTK_CPPFLAGS}" || test -n "${CUSTOM_GTK_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTK_LIBS} -lgtk-x11-2.0" if test -n "gtk/gtk.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTK_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_gtk_gtk_h+set}" = set; then { echo "$as_me:$LINENO: checking for gtk/gtk.h" >&5 echo $ECHO_N "checking for gtk/gtk.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtk_gtk_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtk_gtk_h" >&5 echo "${ECHO_T}$ac_cv_header_gtk_gtk_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gtk/gtk.h usability" >&5 echo $ECHO_N "checking gtk/gtk.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 gtk/gtk.h presence" >&5 echo $ECHO_N "checking gtk/gtk.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gtk/gtk.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gtk/gtk.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gtk/gtk.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gtk/gtk.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gtk/gtk.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gtk/gtk.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gtk/gtk.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gtk/gtk.h" >&5 echo $ECHO_N "checking for gtk/gtk.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtk_gtk_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gtk_gtk_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtk_gtk_h" >&5 echo "${ECHO_T}$ac_cv_header_gtk_gtk_h" >&6; } fi if test $ac_cv_header_gtk_gtk_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "gdk_display_get_default_group"; then ac_vmw_function=gdk_display_get_default_group else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gtk-x11-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgtk-x11-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgtk-x11-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtk-x11-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTK_CPPFLAGS="${CUSTOM_GTK_CPPFLAGS}" GTK_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gtk+-2.0"; then if test -n "2.4.0"; then { echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtk+-2.0 >= 2.4.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtk+-2.0 >= 2.4.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gtk+-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtk+-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtk+-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gtk+-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gtk+-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTK_CPPFLAGS="$ac_vmw_cppflags" GTK_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTK_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTK_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTK_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTK_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" else true { { echo "$as_me:$LINENO: error: Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package." >&5 echo "$as_me: error: Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package." >&2;} { (exit 1); exit 1; }; } fi fi # # Check for gtkmm 2.4.0 or greater. # if test "$with_gtkmm" != "no"; then CUSTOM_GTKMM_CPPFLAGS="$CUSTOM_GTKMM_CPPFLAGS $GTK_CPPFLAGS" ac_ext=cpp 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 -z "gtkmm-2.4"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTKMM"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTKMM_CPPFLAGS}" || test -n "${CUSTOM_GTKMM_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTKMM_LIBS} -lgtkmm-2.4" if test -n "gtkmm.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTKMM_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_gtkmm_h+set}" = set; then { echo "$as_me:$LINENO: checking for gtkmm.h" >&5 echo $ECHO_N "checking for gtkmm.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtkmm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtkmm_h" >&5 echo "${ECHO_T}$ac_cv_header_gtkmm_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gtkmm.h usability" >&5 echo $ECHO_N "checking gtkmm.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 gtkmm.h presence" >&5 echo $ECHO_N "checking gtkmm.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: gtkmm.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gtkmm.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gtkmm.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gtkmm.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gtkmm.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gtkmm.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gtkmm.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gtkmm.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gtkmm.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gtkmm.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gtkmm.h" >&5 echo $ECHO_N "checking for gtkmm.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtkmm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gtkmm_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtkmm_h" >&5 echo "${ECHO_T}$ac_cv_header_gtkmm_h" >&6; } fi if test $ac_cv_header_gtkmm_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gtkmm-2.4_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgtkmm-2.4" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgtkmm-2.4... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtkmm-2.4 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTKMM_CPPFLAGS="${CUSTOM_GTKMM_CPPFLAGS}" GTKMM_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gtkmm-2.4"; then if test -n "2.4.0"; then { echo "$as_me:$LINENO: checking for gtkmm-2.4 >= 2.4.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtkmm-2.4 >= 2.4.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtkmm-2.4 >= 2.4.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gtkmm-2.4 (via pkg-config)" >&5 echo $ECHO_N "checking for gtkmm-2.4 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtkmm-2.4'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gtkmm-2.4`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gtkmm-2.4`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTKMM_CPPFLAGS="$ac_vmw_cppflags" GTKMM_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTKMM_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTKMM_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTKMM_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTKMM_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM" else true { { echo "$as_me:$LINENO: error: gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm." >&5 echo "$as_me: error: gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm." >&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 fi fi # End of checks for X libraries { echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6; } if test "${ac_cv_lib_crypt_crypt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6; } if test $ac_cv_lib_crypt_crypt = yes; then HAVE_CRYPT="yes" else { { echo "$as_me:$LINENO: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&5 echo "$as_me: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&2;} { (exit 1); exit 1; }; } fi for ac_func in dlopen 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 VIX_LIBADD="$VIX_LIBADD -ldl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -ldl" VGAUTH_LIBADD="$VGAUTH_LIBADD -ldl" else { { echo "$as_me:$LINENO: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&5 echo "$as_me: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&2;} { (exit 1); exit 1; }; } fi fi done for ac_func in ecvt 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 for ac_func in fcvt 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 if test "$os" = "freebsd" -a "$osVersion" -ge 600000; then { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lthr" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lthr... $ECHO_C" >&6; } if test "${ac_cv_lib_thr_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthr $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_thr_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thr_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_thr_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_thr_pthread_mutex_init" >&6; } if test $ac_cv_lib_thr_pthread_mutex_init = yes; then THREAD_LIB=-lthr else { { echo "$as_me:$LINENO: error: Unable to locate required threading library libthr." >&5 echo "$as_me: error: Unable to locate required threading library libthr." >&2;} { (exit 1); exit 1; }; } fi else { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then THREAD_LIB=-lpthread else { { echo "$as_me:$LINENO: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&5 echo "$as_me: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # PAM prefix # Check whether --with-pam-prefix was given. if test "${with_pam_prefix+set}" = set; then withval=$with_pam_prefix; PAM_PREFIX="$withval" else PAM_PREFIX='$(sysconfdir)' fi if test "$os" = "linux"; then # Check whether --with-procps was given. if test "${with_procps+set}" = set; then withval=$with_procps; else with_procps=yes fi else with_procps="no" fi if test "$with_procps" = "yes"; then have_procps=no if test -z "$CUSTOM_PROCPS_NAME" && test -z "$CUSTOM_PROCPS_LIBS"; then # See if we have procps-ng (that finally supports pkg-config). if test -z "procps-ng"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lprocps-ng" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_procps-ng_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lprocps-ng" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lprocps-ng... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lprocps-ng $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "libprocps"; then if test -n ""; then { echo "$as_me:$LINENO: checking for libprocps >= (via pkg-config)" >&5 echo $ECHO_N "checking for libprocps >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libprocps >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for libprocps (via pkg-config)" >&5 echo $ECHO_N "checking for libprocps (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libprocps'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags libprocps`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs libprocps`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then # Let's see if there is an older procps version, one that does not # support pkg-config. if test -z "$CUSTOM_PROCPS_NAME"; then CUSTOM_PROCPS_NAME=proc fi # XXX: no pkg-config and no procps-config means we need to # hard-code a sensible default. if test -z "$CUSTOM_PROCPS_LIBS"; then CUSTOM_PROCPS_LIBS="-L/lib" fi # Some distros provide libproc-${version}.so only, others provide the # libproc.so symlink. Try both to see what sticks (but only try the 3.2.7 # and 3.2.8 versions - adding every possible version here would be a mess). # # Users can help by providing CUSTOM_PROCPS_NAME / CUSTOM_PROCPS_LIBS if # necessary. if test -z "$CUSTOM_PROCPS_NAME"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -l$CUSTOM_PROCPS_NAME" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_$CUSTOM_PROCPS_NAME''_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -l$CUSTOM_PROCPS_NAME" >&5 echo $ECHO_N "checking for $ac_vmw_function in -l$CUSTOM_PROCPS_NAME... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$CUSTOM_PROCPS_NAME $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then if test -z "proc-3.2.8"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lproc-3.2.8" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_proc-3.2.8_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lproc-3.2.8" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lproc-3.2.8... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproc-3.2.8 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then if test -z "proc-3.2.7"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lproc-3.2.7" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_proc-3.2.7_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lproc-3.2.7" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lproc-3.2.7... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproc-3.2.7 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&5 echo "$as_me: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&2;} { (exit 1); exit 1; }; } fi fi fi if test "$with_procps" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_PROCPS 1 _ACEOF fi # Check whether --with-dnet was given. if test "${with_dnet+set}" = set; then withval=$with_dnet; else with_dnet=yes fi have_dnet="no" if test "$with_dnet" = "yes"; then # On Debian, dnet is installed via the libdumbnet package. We need to # detect this so that our source files include dumbnet.h instead of # dnet.h, which is part of a different package altogether. if test -z "dumbnet"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "DNET"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_DNET_CPPFLAGS}" || test -n "${CUSTOM_DNET_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_DNET_LIBS} -ldumbnet" if test -n "dumbnet.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_DNET_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_dumbnet_h+set}" = set; then { echo "$as_me:$LINENO: checking for dumbnet.h" >&5 echo $ECHO_N "checking for dumbnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dumbnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dumbnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dumbnet_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dumbnet.h usability" >&5 echo $ECHO_N "checking dumbnet.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 dumbnet.h presence" >&5 echo $ECHO_N "checking dumbnet.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: dumbnet.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dumbnet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dumbnet.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dumbnet.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dumbnet.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dumbnet.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dumbnet.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dumbnet.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dumbnet.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dumbnet.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for dumbnet.h" >&5 echo $ECHO_N "checking for dumbnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dumbnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dumbnet_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dumbnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dumbnet_h" >&6; } fi if test $ac_cv_header_dumbnet_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "intf_open"; then ac_vmw_function=intf_open else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_dumbnet_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -ldumbnet" >&5 echo $ECHO_N "checking for $ac_vmw_function in -ldumbnet... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldumbnet $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then DNET_CPPFLAGS="${CUSTOM_DNET_CPPFLAGS}" DNET_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DNET_CPPFLAGS="$ac_vmw_cppflags" DNET_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "dumbnet-config"; then # Extract the first word of "dumbnet-config", so it can be a program name with args. set dummy dumbnet-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" DNET_LIBS="`$ac_vmw_lib_cfg --ldflags`" else DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" DNET_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_dnet="yes"; cat >>confdefs.h <<\_ACEOF @%:@define DNET_IS_DUMBNET 1 _ACEOF else true fi if test $have_dnet = "no"; then if test -z "dnet"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "DNET"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_DNET_CPPFLAGS}" || test -n "${CUSTOM_DNET_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_DNET_LIBS} -ldnet" if test -n "dnet.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_DNET_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_dnet_h+set}" = set; then { echo "$as_me:$LINENO: checking for dnet.h" >&5 echo $ECHO_N "checking for dnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dnet_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dnet.h usability" >&5 echo $ECHO_N "checking dnet.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 dnet.h presence" >&5 echo $ECHO_N "checking dnet.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: dnet.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dnet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dnet.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dnet.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dnet.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dnet.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dnet.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dnet.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dnet.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dnet.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for dnet.h" >&5 echo $ECHO_N "checking for dnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dnet_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dnet_h" >&6; } fi if test $ac_cv_header_dnet_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "intf_open"; then ac_vmw_function=intf_open else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_dnet_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -ldnet" >&5 echo $ECHO_N "checking for $ac_vmw_function in -ldnet... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then DNET_CPPFLAGS="${CUSTOM_DNET_CPPFLAGS}" DNET_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DNET_CPPFLAGS="$ac_vmw_cppflags" DNET_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "dnet-config"; then # Extract the first word of "dnet-config", so it can be a program name with args. set dummy dnet-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" DNET_LIBS="`$ac_vmw_lib_cfg --ldflags`" else DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" DNET_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_dnet="yes" else true fi fi if test $have_dnet = "no"; then { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&5 echo "$as_me: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&2;} { (exit 1); exit 1; }; } fi fi if test "$with_dnet" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_DNET 1 _ACEOF fi # Check whether --with-icu was given. if test "${with_icu+set}" = set; then withval=$with_icu; else with_icu=yes fi if test "$have_x" = "yes" -o "$with_icu" = "yes"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$CXX", so it can be a program name with args. set dummy ${ac_tool_prefix}$CXX; 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_have_cxx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_cxx"; then ac_cv_prog_have_cxx="$have_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_cxx="${ac_tool_prefix}$CXX" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi have_cxx=$ac_cv_prog_have_cxx if test -n "$have_cxx"; then { echo "$as_me:$LINENO: result: $have_cxx" >&5 echo "${ECHO_T}$have_cxx" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_have_cxx"; then ac_ct_have_cxx=$have_cxx # Extract the first word of "$CXX", so it can be a program name with args. set dummy $CXX; 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_have_cxx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_have_cxx"; then ac_cv_prog_ac_ct_have_cxx="$ac_ct_have_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_have_cxx="$CXX" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_have_cxx=$ac_cv_prog_ac_ct_have_cxx if test -n "$ac_ct_have_cxx"; then { echo "$as_me:$LINENO: result: $ac_ct_have_cxx" >&5 echo "${ECHO_T}$ac_ct_have_cxx" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_have_cxx" = x; then have_cxx="no" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac have_cxx=$ac_ct_have_cxx fi else have_cxx="$ac_cv_prog_have_cxx" fi if test "$have_cxx" = "no"; then { { echo "$as_me:$LINENO: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu)." >&5 echo "$as_me: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu)." >&2;} { (exit 1); exit 1; }; } fi fi if test "$with_icu" = "yes"; then ac_ext=cpp 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 -z "icuuc"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "ICU"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_ICU_CPPFLAGS}" || test -n "${CUSTOM_ICU_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_ICU_LIBS} -licuuc" if test -n "unicode/utf.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_ICU_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_unicode_utf_h+set}" = set; then { echo "$as_me:$LINENO: checking for unicode/utf.h" >&5 echo $ECHO_N "checking for unicode/utf.h... $ECHO_C" >&6; } if test "${ac_cv_header_unicode_utf_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_unicode_utf_h" >&5 echo "${ECHO_T}$ac_cv_header_unicode_utf_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking unicode/utf.h usability" >&5 echo $ECHO_N "checking unicode/utf.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 unicode/utf.h presence" >&5 echo $ECHO_N "checking unicode/utf.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: unicode/utf.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: unicode/utf.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: unicode/utf.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: unicode/utf.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: unicode/utf.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: unicode/utf.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: unicode/utf.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: unicode/utf.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: unicode/utf.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: unicode/utf.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for unicode/utf.h" >&5 echo $ECHO_N "checking for unicode/utf.h... $ECHO_C" >&6; } if test "${ac_cv_header_unicode_utf_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_unicode_utf_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_unicode_utf_h" >&5 echo "${ECHO_T}$ac_cv_header_unicode_utf_h" >&6; } fi if test $ac_cv_header_unicode_utf_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_icuuc_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -licuuc" >&5 echo $ECHO_N "checking for $ac_vmw_function in -licuuc... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-licuuc $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then ICU_CPPFLAGS="${CUSTOM_ICU_CPPFLAGS}" ICU_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } ICU_CPPFLAGS="$ac_vmw_cppflags" ICU_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "icu-config"; then # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then ICU_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" ICU_LIBS="`$ac_vmw_lib_cfg --ldflags`" else ICU_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" ICU_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU" else true { { echo "$as_me:$LINENO: error: ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 echo "$as_me: error: ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&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 # Check whether we have ICU >= 3.8. ac_ext=cpp 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 for ucasemap_utf8ToTitle in ICU" >&5 echo $ECHO_N "checking for ucasemap_utf8ToTitle in ICU... $ECHO_C" >&6; } ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" 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 () { (void) &ucasemap_utf8ToTitle; return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$ORIGINAL_CPPFLAGS" 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 # Easier to give all modules the ICU defines/includes... CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" else CPPFLAGS="$CPPFLAGS -DNO_ICU" fi # Extract the first word of "rpcgen", so it can be a program name with args. set dummy rpcgen; 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_path_RPCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RPCGEN in [\\/]* | ?:[\\/]*) ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RPCGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RPCGEN" && ac_cv_path_RPCGEN=" { { echo "$as_me:$LINENO: error: rpcgen not found. Please install the libc devel package." >&5 echo "$as_me: error: rpcgen not found. Please install the libc devel package." >&2;} { (exit 1); exit 1; }; } " ;; esac fi RPCGEN=$ac_cv_path_RPCGEN if test -n "$RPCGEN"; then { echo "$as_me:$LINENO: result: $RPCGEN" >&5 echo "${ECHO_T}$RPCGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ### ### Headers ### for ac_header in crypt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/io.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 # Required to make the sys/user.h check work correctly on FreeBSD for ac_header in sys/sysinfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/user.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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ #ifdef HAVE_SYS_PARAM_H # include #endif @%:@include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 sys/vfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in syslimits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF @%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in unwind.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 if test "${ac_cv_header_wchar_h+set}" = set; then { echo "$as_me:$LINENO: checking for wchar.h" >&5 echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking wchar.h usability" >&5 echo $ECHO_N "checking wchar.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 wchar.h presence" >&5 echo $ECHO_N "checking wchar.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for wchar.h" >&5 echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } fi if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H="yes" else HAVE_WCHAR_H="no" fi if test "$os" = "linux"; then # Make sure kernel-headers package is installed. if test "${ac_cv_header_linux_unistd_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/unistd.h" >&5 echo $ECHO_N "checking for linux/unistd.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_unistd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_unistd_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_unistd_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/unistd.h usability" >&5 echo $ECHO_N "checking linux/unistd.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 linux/unistd.h presence" >&5 echo $ECHO_N "checking linux/unistd.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: linux/unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/unistd.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/unistd.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/unistd.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/unistd.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/unistd.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/unistd.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/unistd.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/unistd.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for linux/unistd.h" >&5 echo $ECHO_N "checking for linux/unistd.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_unistd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_unistd_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_unistd_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_unistd_h" >&6; } fi if test $ac_cv_header_linux_unistd_h = yes; then : else { { echo "$as_me:$LINENO: error: linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package." >&5 echo "$as_me: error: linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package." >&2;} { (exit 1); exit 1; }; } fi fi if test "$enable_multimon" != "no"; then { echo "$as_me:$LINENO: checking for X11/extensions/panoramiXproto.h" >&5 echo $ECHO_N "checking for X11/extensions/panoramiXproto.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_extensions_panoramiXproto_h+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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_X11_extensions_panoramiXproto_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_X11_extensions_panoramiXproto_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_panoramiXproto_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_extensions_panoramiXproto_h" >&6; } if test $ac_cv_header_X11_extensions_panoramiXproto_h = yes; then : else { { echo "$as_me:$LINENO: error: panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s)." >&5 echo "$as_me: error: panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi bsdPrintfWrappers=no if test "$os" = "linux"; then { echo "$as_me:$LINENO: checking for ecvt in -lc" >&5 echo $ECHO_N "checking for ecvt in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_ecvt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ecvt (); int main () { return ecvt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_ecvt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_ecvt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_ecvt" >&5 echo "${ECHO_T}$ac_cv_lib_c_ecvt" >&6; } if test $ac_cv_lib_c_ecvt = yes; then bsdPrintfWrappers=yes fi fi ### ### Typdefs, structs, and compiler quarks. ### { echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+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 #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } { echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+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 typedef _Bool ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF @%:@define HAVE_STDBOOL_H 1 _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 cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 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 inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_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. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_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. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define off_t long int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_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. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_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. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF @%:@define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_rdev+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 int main () { static struct stat ac_aggr; if (ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF @%:@define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+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 int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @%:@define TIME_WITH_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+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 int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @%:@define TM_IN_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking for working volatile" >&5 echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } if test "${ac_cv_c_volatile+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 () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_volatile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 echo "${ECHO_T}$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then cat >>confdefs.h <<\_ACEOF @%:@define volatile _ACEOF fi ### ### Specific features and OS/arch flags / actions ### ### General flags / actions CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Werror" # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' # in Xlib.h on OpenSolaris. # Glib2 keep changing mutex APIs so we also need to disable 'deprecated' # warnings for now (-Wno-deprecated-declarations). for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations; do { echo "$as_me:$LINENO: checking for GCC flag $TEST_CFLAG" >&5 echo $ECHO_N "checking for GCC flag $TEST_CFLAG... $ECHO_C" >&6; } ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" NEW_CFLAG="" 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; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then NEW_CFLAG=" $TEST_CFLAG" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG" done CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS" CPPFLAGS="$CPPFLAGS" # -fvisibility is used by "core service" plugins, but not required. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" { echo "$as_me:$LINENO: checking for GCC flag -fvisibility" >&5 echo $ECHO_N "checking for GCC flag -fvisibility... $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. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then PLUGIN_CPPFLAGS="-fvisibility=hidden -DGCC_EXPLICIT_EXPORT"; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS" # Detect "unused-but-set-variable" gcc warning and disable it. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-but-set-variable" { echo "$as_me:$LINENO: checking for GCC flag -Wno-unused-but-set-variable" >&5 echo $ECHO_N "checking for GCC flag -Wno-unused-but-set-variable... $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. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ORIGINAL_CFLAGS="$ORIGINAL_CFLAGS -Wno-unused-but-set-variable"; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS" BUILDDIR="`pwd`" INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" BLD_INCLUDE_DIR="$BUILDDIR/lib/include" CPPFLAGS="-I$INCLUDE_DIR -I$BLD_INCLUDE_DIR $CPPFLAGS" ### ### Documentation. ### if test "$enable_docs" = "yes"; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_have_doxygen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_doxygen"; then ac_cv_prog_have_doxygen="$have_doxygen" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_doxygen="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_doxygen" && ac_cv_prog_have_doxygen="no" fi fi have_doxygen=$ac_cv_prog_have_doxygen if test -n "$have_doxygen"; then { echo "$as_me:$LINENO: result: $have_doxygen" >&5 echo "${ECHO_T}$have_doxygen" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$have_doxygen" = "no"; then { echo "$as_me:$LINENO: WARNING: doxygen not found; API documentation will not be generated." >&5 echo "$as_me: WARNING: doxygen not found; API documentation will not be generated." >&2;} else # Extract the first word of "dot", so it can be a program name with args. set dummy dot; 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_path_DOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then { echo "$as_me:$LINENO: result: $DOT" >&5 echo "${ECHO_T}$DOT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$DOT" = ""; then HAVE_DOT=NO else DOT=`dirname $DOT` HAVE_DOT=YES fi # Extract the first word of "mscgen", so it can be a program name with args. set dummy mscgen; 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_path_MSCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSCGEN in [\\/]* | ?:[\\/]*) ac_cv_path_MSCGEN="$MSCGEN" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSCGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MSCGEN" && ac_cv_path_MSCGEN="no" ;; esac fi MSCGEN=$ac_cv_path_MSCGEN if test -n "$MSCGEN"; then { echo "$as_me:$LINENO: result: $MSCGEN" >&5 echo "${ECHO_T}$MSCGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$MSCGEN" != "no"; then MSCGEN_DIR="`dirname $MSCGEN`" else MSCGEN_DIR= fi fi fi ### ### OS/arch-specific flags / actions ### MODULES="" MODULES_OS="$os" TARGET_OS="$os" MODULES_DIR="" buildHgfsmounter=no if test "$os" = "linux"; then MODULES_DIR="$LINUXDIR/kernel/" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE" CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrt" # vmxnet is not supported for kernels 3.3.0 and newer if test "$osVersion" -lt 303000; then MODULES="$MODULES vmxnet" fi # See if we need vmhgfs module. Starting with 4.0.0 we use FUSE if test "$osVersion" -lt 400000; then MODULES="$MODULES vmhgfs" fi # See if we need vmci and vsock modules. Starting with 3.9 they made # their way into mainline kernel. if test "$osVersion" -lt 309000; then MODULES="$MODULES vmci vsock" fi if test "$osVersion" -lt 300000; then MODULES="$MODULES vmblock vmsync" fi buildHgfsmounter=yes fi if test "$os" = "freebsd" || test "$os" = "kfreebsd-gnu"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm" MODULES_DIR="/boot/modules" if test "$osVersion" -ge 302000; then MODULES="$MODULES vmmemctl" fi if test "$osVersion" -ge 409000; then MODULES="$MODULES vmxnet" fi if test "$osVersion" -ge 600000; then MODULES="$MODULES vmblock" fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building FreeBSD kernel modules. Make sure you use " echo " 'make' to build open-vm-tools, and not GNU make ('gmake'). " echo "****************************************************************" fi fi if test "$os" = "solaris"; then LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lsocket" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lnsl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lresolv" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrpcsvc" # Setup defines to identify the OS version. if test "$osVersion" -eq 509000; then CPPFLAGS="$CPPFLAGS -DSOL9" fi if test "$osVersion" -eq 510000; then CPPFLAGS="$CPPFLAGS -DSOL10" fi if test "$osVersion" -eq 511000; then CPPFLAGS="$CPPFLAGS -DSOL11" fi MODULES="$MODULES vmxnet vmmemctl" # HGFS and vmblock need Solaris 10 at least. if test "$osVersion" -ge 510000; then MODULES="$MODULES vmhgfs vmblock" fi # vmxnet3 is built on Solaris 10 / 11 only if GLDv3 is installed. if test "$osVersion" -gt 510000; then if test "${ac_cv_header_sys_mac_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/mac.h usability" >&5 echo $ECHO_N "checking sys/mac.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 sys/mac.h presence" >&5 echo $ECHO_N "checking sys/mac.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: sys/mac.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/mac.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/mac.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/mac.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/mac.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/mac.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/mac.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/mac.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/mac.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mac.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX @%:@@%:@ -------------------------------------------------------- @%:@@%:@ @%:@@%:@ Report this to open-vm-tools-devel@lists.sourceforge.net @%:@@%:@ @%:@@%:@ -------------------------------------------------------- @%:@@%:@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mac_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } fi if test $ac_cv_header_sys_mac_h = yes; then MODULES="$MODULES vmxnet3" else { echo "$as_me:$LINENO: WARNING: GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled." >&5 echo "$as_me: WARNING: GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled." >&2;} fi fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building Solaris kernel modules. Make sure you use " echo " GNU make to build open-vm-tools. " echo "****************************************************************" fi fi if test "$buildHgfsmounter" = "yes"; then BUILD_HGFSMOUNTER_TRUE= BUILD_HGFSMOUNTER_FALSE='#' else BUILD_HGFSMOUNTER_TRUE='#' BUILD_HGFSMOUNTER_FALSE= fi if test "$os" = "linux"; then LINUX_TRUE= LINUX_FALSE='#' else LINUX_TRUE='#' LINUX_FALSE= fi if test "$os" = "solaris"; then SOLARIS_TRUE= SOLARIS_FALSE='#' else SOLARIS_TRUE='#' SOLARIS_FALSE= fi if test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu"; then FREEBSD_TRUE= FREEBSD_FALSE='#' else FREEBSD_TRUE='#' FREEBSD_FALSE= fi if test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR"; then FREEBSD_CUSTOM_SYSDIR_TRUE= FREEBSD_CUSTOM_SYSDIR_FALSE='#' else FREEBSD_CUSTOM_SYSDIR_TRUE='#' FREEBSD_CUSTOM_SYSDIR_FALSE= fi if test "$userSpaceBitness" = "32"; then THIRTY_TWO_BIT_USERSPACE_TRUE= THIRTY_TWO_BIT_USERSPACE_FALSE='#' else THIRTY_TWO_BIT_USERSPACE_TRUE='#' THIRTY_TWO_BIT_USERSPACE_FALSE= fi if test "$have_x" = "yes"; then HAVE_X11_TRUE= HAVE_X11_FALSE='#' else HAVE_X11_TRUE='#' HAVE_X11_FALSE= fi if test "$with_icu" = "yes"; then HAVE_ICU_TRUE= HAVE_ICU_FALSE='#' else HAVE_ICU_TRUE='#' HAVE_ICU_FALSE= fi if test "$with_kernel_modules" = "yes"; then WITH_KERNEL_MODULES_TRUE= WITH_KERNEL_MODULES_FALSE='#' else WITH_KERNEL_MODULES_TRUE='#' WITH_KERNEL_MODULES_FALSE= fi if test "$have_xsm" = "yes"; then HAVE_XSM_TRUE= HAVE_XSM_FALSE='#' else HAVE_XSM_TRUE='#' HAVE_XSM_FALSE= fi if test "$have_xcomposite" = "yes"; then HAVE_XCOMPOSITE_TRUE= HAVE_XCOMPOSITE_FALSE='#' else HAVE_XCOMPOSITE_TRUE='#' HAVE_XCOMPOSITE_FALSE= fi if test "$have_cunit" = "yes"; then ENABLE_TESTS_TRUE= ENABLE_TESTS_FALSE='#' else ENABLE_TESTS_TRUE='#' ENABLE_TESTS_FALSE= fi if test "$with_root_privileges" = "yes"; then WITH_ROOT_PRIVILEGES_TRUE= WITH_ROOT_PRIVILEGES_FALSE='#' else WITH_ROOT_PRIVILEGES_TRUE='#' WITH_ROOT_PRIVILEGES_FALSE= fi if test "$have_dnet" = "yes"; then HAVE_DNET_TRUE= HAVE_DNET_FALSE='#' else HAVE_DNET_TRUE='#' HAVE_DNET_FALSE= fi if test "$have_doxygen" = "yes"; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' else HAVE_DOXYGEN_TRUE='#' HAVE_DOXYGEN_FALSE= fi if test "$have_fuse" = "yes"; then HAVE_FUSE_TRUE= HAVE_FUSE_FALSE='#' else HAVE_FUSE_TRUE='#' HAVE_FUSE_FALSE= fi if test "$with_gnu_ld" = "yes"; then HAVE_GNU_LD_TRUE= HAVE_GNU_LD_FALSE='#' else HAVE_GNU_LD_TRUE='#' HAVE_GNU_LD_FALSE= fi if test "$have_x" = "yes" -a "$with_gtkmm" = "yes"; then HAVE_GTKMM_TRUE= HAVE_GTKMM_FALSE='#' else HAVE_GTKMM_TRUE='#' HAVE_GTKMM_FALSE= fi if test "$with_pam" = "yes"; then HAVE_PAM_TRUE= HAVE_PAM_FALSE='#' else HAVE_PAM_TRUE='#' HAVE_PAM_FALSE= fi if test "$os" = "linux"; then USE_SLASH_PROC_TRUE= USE_SLASH_PROC_FALSE='#' else USE_SLASH_PROC_TRUE='#' USE_SLASH_PROC_FALSE= fi if test "$bsdPrintfWrappers" = "yes"; then USE_PRINTF_WRAPPERS_TRUE= USE_PRINTF_WRAPPERS_FALSE='#' else USE_PRINTF_WRAPPERS_TRUE='#' USE_PRINTF_WRAPPERS_FALSE= fi if test "$enable_deploypkg" = "yes"; then ENABLE_DEPLOYPKG_TRUE= ENABLE_DEPLOYPKG_FALSE='#' else ENABLE_DEPLOYPKG_TRUE='#' ENABLE_DEPLOYPKG_FALSE= fi if test "$enable_grabbitmqproxy" = "yes"; then ENABLE_GRABBITMQPROXY_TRUE= ENABLE_GRABBITMQPROXY_FALSE='#' else ENABLE_GRABBITMQPROXY_TRUE='#' ENABLE_GRABBITMQPROXY_FALSE= fi if test "$enable_vgauth" = "yes"; then ENABLE_VGAUTH_TRUE= ENABLE_VGAUTH_FALSE='#' else ENABLE_VGAUTH_TRUE='#' ENABLE_VGAUTH_FALSE= fi if test "$os" = "linux"; then HAVE_VSOCK_TRUE= HAVE_VSOCK_FALSE='#' else HAVE_VSOCK_TRUE='#' HAVE_VSOCK_FALSE= fi if test "$have_xsm" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_XSM 1 _ACEOF fi if test "$have_xcomposite" != "yes"; then cat >>confdefs.h <<\_ACEOF @%:@define NO_XCOMPOSITE 1 _ACEOF fi ### Feature-specific flags / actions # Combine where possible # If control reaches this point and multimon is still enabled, then we know # all of the tests for required components have passed and it's safe to allow # multimon. Otherwise, it should be disabled. if test "$enable_multimon" = "no"; then # XXX: For consistency, change this to ENABLE_MULTIMON. This will require # some additional code cleanup. cat >>confdefs.h <<\_ACEOF @%:@define NO_MULTIMON 1 _ACEOF fi LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS $PAM_CPPFLAGS" if test "$HAVE_CRYPT" = "yes"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lcrypt" VIX_LIBADD="$VIX_LIBADD -lcrypt" fi LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $THREAD_LIB" VIX_LIBADD="$VIX_LIBADD $THREAD_LIB" ### Core Services definitions. HGFS_LIBS="$BUILDDIR/libhgfs/libhgfs.la" VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS" VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS" PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS" PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -shared -module -avoid-version" # In Solaris, the XDR-related functions are not in libc like in Linux and # FreeBSD, so binaries need to be linked to some extra libraries. XDR_LIBS= if test "$os" = "solaris"; then XDR_LIBS="-lnsl -lrpcsvc" fi # Installation directories for core services plugins. TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common VMSVC_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmsvc VMUSR_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmusr # General definitions INSTVMSG='$(SHELL) $(top_srcdir)/scripts/build/instvmsg.sh' RPCGEN_WRAPPER='$(SHELL) $(top_builddir)/scripts/build/rpcgen_wrapper.sh' ### General substs if test "$os" = "freebsd" -a -n "$SYSDIR"; then # If SYSDIR is not defined, AC_SUBST expands to nothing, so we need something # inside this block. true fi ### Lib substs ### Program substs ### ### Create the Makefiles ### ac_config_files="$ac_config_files Makefile lib/Makefile lib/appUtil/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/asyncsocket/Makefile lib/sslDirect/Makefile lib/pollGtk/Makefile lib/poll/Makefile lib/dataMap/Makefile lib/hashMap/Makefile lib/dict/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/glibUtils/Makefile lib/guestApp/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsHelper/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/hgfsUri/Makefile lib/impersonate/Makefile lib/lock/Makefile lib/message/Makefile lib/misc/Makefile lib/netUtil/Makefile lib/nicInfo/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/procMgr/Makefile lib/rpcChannel/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcVmx/Makefile lib/slashProc/Makefile lib/string/Makefile lib/stubs/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/unicode/Makefile lib/user/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile lib/xdg/Makefile services/Makefile services/vmtoolsd/Makefile services/plugins/Makefile services/plugins/desktopEvents/Makefile services/plugins/dndcp/Makefile services/plugins/grabbitmqProxy/Makefile services/plugins/guestInfo/Makefile services/plugins/hgfsServer/Makefile services/plugins/powerOps/Makefile services/plugins/resolutionSet/Makefile services/plugins/timeSync/Makefile services/plugins/vix/Makefile services/plugins/vmbackup/Makefile services/plugins/deployPkg/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile rpctool/Makefile namespacetool/Makefile guestproxycerttool/Makefile vgauth/Makefile vgauth/lib/Makefile vgauth/cli/Makefile vgauth/service/Makefile libguestlib/Makefile libguestlib/vmguestlib.pc libDeployPkg/Makefile libDeployPkg/libDeployPkg.pc libhgfs/Makefile libvmtools/Makefile xferlogs/Makefile modules/Makefile vmblock-fuse/Makefile vmhgfs-fuse/Makefile vmblockmounter/Makefile tests/Makefile tests/vmrpcdbg/Makefile tests/testDebug/Makefile tests/testPlugin/Makefile tests/testVmblock/Makefile docs/Makefile docs/api/Makefile scripts/Makefile scripts/build/rpcgen_wrapper.sh" ### ### Output ### 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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 "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIB@&t@OBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIB@&t@OBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs 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__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 "${BUILD_HGFSMOUNTER_TRUE}" && test -z "${BUILD_HGFSMOUNTER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_HGFSMOUNTER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_HGFSMOUNTER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SOLARIS_TRUE}" && test -z "${SOLARIS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREEBSD_TRUE}" && test -z "${FREEBSD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREEBSD_CUSTOM_SYSDIR_TRUE}" && test -z "${FREEBSD_CUSTOM_SYSDIR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREEBSD_CUSTOM_SYSDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREEBSD_CUSTOM_SYSDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${THIRTY_TWO_BIT_USERSPACE_TRUE}" && test -z "${THIRTY_TWO_BIT_USERSPACE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"THIRTY_TWO_BIT_USERSPACE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"THIRTY_TWO_BIT_USERSPACE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_X11_TRUE}" && test -z "${HAVE_X11_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_ICU_TRUE}" && test -z "${HAVE_ICU_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_ICU\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_ICU\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_KERNEL_MODULES_TRUE}" && test -z "${WITH_KERNEL_MODULES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_KERNEL_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_KERNEL_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XSM_TRUE}" && test -z "${HAVE_XSM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XSM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_XSM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XCOMPOSITE_TRUE}" && test -z "${HAVE_XCOMPOSITE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XCOMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_XCOMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_ROOT_PRIVILEGES_TRUE}" && test -z "${WITH_ROOT_PRIVILEGES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_ROOT_PRIVILEGES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_ROOT_PRIVILEGES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DNET_TRUE}" && test -z "${HAVE_DNET_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_DNET\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_DNET\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_FUSE_TRUE}" && test -z "${HAVE_FUSE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GNU_LD_TRUE}" && test -z "${HAVE_GNU_LD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GTKMM_TRUE}" && test -z "${HAVE_GTKMM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTKMM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GTKMM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_PAM_TRUE}" && test -z "${HAVE_PAM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SLASH_PROC_TRUE}" && test -z "${USE_SLASH_PROC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SLASH_PROC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SLASH_PROC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PRINTF_WRAPPERS_TRUE}" && test -z "${USE_PRINTF_WRAPPERS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PRINTF_WRAPPERS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PRINTF_WRAPPERS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_DEPLOYPKG_TRUE}" && test -z "${ENABLE_DEPLOYPKG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DEPLOYPKG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_DEPLOYPKG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_GRABBITMQPROXY_TRUE}" && test -z "${ENABLE_GRABBITMQPROXY_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_GRABBITMQPROXY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_GRABBITMQPROXY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_VGAUTH_TRUE}" && test -z "${ENABLE_VGAUTH_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_VGAUTH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_VGAUTH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_VSOCK_TRUE}" && test -z "${HAVE_VSOCK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_VSOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_VSOCK\" 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by open-vm-tools $as_me 10.0.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF 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 and configuration settings, 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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ open-vm-tools config.status 10.0.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _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 ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { 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" ac_need_defaults=false ;; 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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX @%:@@%:@ Running $as_me. @%:@@%:@ _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/appUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/appUtil/Makefile" ;; "lib/auth/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auth/Makefile" ;; "lib/backdoor/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/Makefile" ;; "lib/asyncsocket/Makefile") CONFIG_FILES="$CONFIG_FILES lib/asyncsocket/Makefile" ;; "lib/sslDirect/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sslDirect/Makefile" ;; "lib/pollGtk/Makefile") CONFIG_FILES="$CONFIG_FILES lib/pollGtk/Makefile" ;; "lib/poll/Makefile") CONFIG_FILES="$CONFIG_FILES lib/poll/Makefile" ;; "lib/dataMap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dataMap/Makefile" ;; "lib/hashMap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hashMap/Makefile" ;; "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; "lib/glibUtils/Makefile") CONFIG_FILES="$CONFIG_FILES lib/glibUtils/Makefile" ;; "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; "lib/guestRpc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestRpc/Makefile" ;; "lib/hgfs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfs/Makefile" ;; "lib/hgfsBd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsBd/Makefile" ;; "lib/hgfsHelper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsHelper/Makefile" ;; "lib/hgfsServer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServer/Makefile" ;; "lib/hgfsServerManagerGuest/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServerManagerGuest/Makefile" ;; "lib/hgfsServerPolicyGuest/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServerPolicyGuest/Makefile" ;; "lib/hgfsUri/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsUri/Makefile" ;; "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; "lib/lock/Makefile") CONFIG_FILES="$CONFIG_FILES lib/lock/Makefile" ;; "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; "lib/nicInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/nicInfo/Makefile" ;; "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; "lib/rpcChannel/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcChannel/Makefile" ;; "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; "lib/slashProc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/slashProc/Makefile" ;; "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; "lib/vmCheck/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmCheck/Makefile" ;; "lib/vmSignal/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmSignal/Makefile" ;; "lib/wiper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/wiper/Makefile" ;; "lib/xdg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xdg/Makefile" ;; "services/Makefile") CONFIG_FILES="$CONFIG_FILES services/Makefile" ;; "services/vmtoolsd/Makefile") CONFIG_FILES="$CONFIG_FILES services/vmtoolsd/Makefile" ;; "services/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/Makefile" ;; "services/plugins/desktopEvents/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/desktopEvents/Makefile" ;; "services/plugins/dndcp/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/dndcp/Makefile" ;; "services/plugins/grabbitmqProxy/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/grabbitmqProxy/Makefile" ;; "services/plugins/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/guestInfo/Makefile" ;; "services/plugins/hgfsServer/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/hgfsServer/Makefile" ;; "services/plugins/powerOps/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/powerOps/Makefile" ;; "services/plugins/resolutionSet/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/resolutionSet/Makefile" ;; "services/plugins/timeSync/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/timeSync/Makefile" ;; "services/plugins/vix/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/vix/Makefile" ;; "services/plugins/vmbackup/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/vmbackup/Makefile" ;; "services/plugins/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/deployPkg/Makefile" ;; "vmware-user-suid-wrapper/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user-suid-wrapper/Makefile" ;; "toolbox/Makefile") CONFIG_FILES="$CONFIG_FILES toolbox/Makefile" ;; "hgfsclient/Makefile") CONFIG_FILES="$CONFIG_FILES hgfsclient/Makefile" ;; "hgfsmounter/Makefile") CONFIG_FILES="$CONFIG_FILES hgfsmounter/Makefile" ;; "checkvm/Makefile") CONFIG_FILES="$CONFIG_FILES checkvm/Makefile" ;; "rpctool/Makefile") CONFIG_FILES="$CONFIG_FILES rpctool/Makefile" ;; "namespacetool/Makefile") CONFIG_FILES="$CONFIG_FILES namespacetool/Makefile" ;; "guestproxycerttool/Makefile") CONFIG_FILES="$CONFIG_FILES guestproxycerttool/Makefile" ;; "vgauth/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/Makefile" ;; "vgauth/lib/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/lib/Makefile" ;; "vgauth/cli/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/cli/Makefile" ;; "vgauth/service/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/service/Makefile" ;; "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; "libguestlib/vmguestlib.pc") CONFIG_FILES="$CONFIG_FILES libguestlib/vmguestlib.pc" ;; "libDeployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES libDeployPkg/Makefile" ;; "libDeployPkg/libDeployPkg.pc") CONFIG_FILES="$CONFIG_FILES libDeployPkg/libDeployPkg.pc" ;; "libhgfs/Makefile") CONFIG_FILES="$CONFIG_FILES libhgfs/Makefile" ;; "libvmtools/Makefile") CONFIG_FILES="$CONFIG_FILES libvmtools/Makefile" ;; "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "vmblock-fuse/Makefile") CONFIG_FILES="$CONFIG_FILES vmblock-fuse/Makefile" ;; "vmhgfs-fuse/Makefile") CONFIG_FILES="$CONFIG_FILES vmhgfs-fuse/Makefile" ;; "vmblockmounter/Makefile") CONFIG_FILES="$CONFIG_FILES vmblockmounter/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/vmrpcdbg/Makefile") CONFIG_FILES="$CONFIG_FILES tests/vmrpcdbg/Makefile" ;; "tests/testDebug/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testDebug/Makefile" ;; "tests/testPlugin/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testPlugin/Makefile" ;; "tests/testVmblock/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testVmblock/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/api/Makefile") CONFIG_FILES="$CONFIG_FILES docs/api/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/build/rpcgen_wrapper.sh") CONFIG_FILES="$CONFIG_FILES scripts/build/rpcgen_wrapper.sh" ;; *) { { 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_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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for 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 _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim SED!$SED$ac_delim LN_S!$LN_S$ac_delim LIBTOOL!$LIBTOOL$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim FGREP!$FGREP$ac_delim LD!$LD$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF DUMPBIN!$DUMPBIN$ac_delim ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim NM!$NM$ac_delim OBJDUMP!$OBJDUMP$ac_delim DLLTOOL!$DLLTOOL$ac_delim AR!$AR$ac_delim ac_ct_AR!$ac_ct_AR$ac_delim RANLIB!$RANLIB$ac_delim MANIFEST_TOOL!$MANIFEST_TOOL$ac_delim DSYMUTIL!$DSYMUTIL$ac_delim NMEDIT!$NMEDIT$ac_delim LIPO!$LIPO$ac_delim OTOOL!$OTOOL$ac_delim OTOOL64!$OTOOL64$ac_delim CXXCPP!$CXXCPP$ac_delim HAVE_PKG_CONFIG!$HAVE_PKG_CONFIG$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim ac_vmw_lib_cfg!$ac_vmw_lib_cfg$ac_delim MSPACK_CPPFLAGS!$MSPACK_CPPFLAGS$ac_delim MSPACK_LIBS!$MSPACK_LIBS$ac_delim GLIB2_CPPFLAGS!$GLIB2_CPPFLAGS$ac_delim GLIB2_LIBS!$GLIB2_LIBS$ac_delim GMODULE_CPPFLAGS!$GMODULE_CPPFLAGS$ac_delim GMODULE_LIBS!$GMODULE_LIBS$ac_delim GOBJECT_CPPFLAGS!$GOBJECT_CPPFLAGS$ac_delim GOBJECT_LIBS!$GOBJECT_LIBS$ac_delim GTHREAD_CPPFLAGS!$GTHREAD_CPPFLAGS$ac_delim GTHREAD_LIBS!$GTHREAD_LIBS$ac_delim have_genmarshal!$have_genmarshal$ac_delim FUSE_CPPFLAGS!$FUSE_CPPFLAGS$ac_delim FUSE_LIBS!$FUSE_LIBS$ac_delim PAM_CPPFLAGS!$PAM_CPPFLAGS$ac_delim PAM_LIBS!$PAM_LIBS$ac_delim SSL_CPPFLAGS!$SSL_CPPFLAGS$ac_delim SSL_LIBS!$SSL_LIBS$ac_delim XERCES_CPPFLAGS!$XERCES_CPPFLAGS$ac_delim XERCES_LIBS!$XERCES_LIBS$ac_delim XMLSECURITY_CPPFLAGS!$XMLSECURITY_CPPFLAGS$ac_delim XMLSECURITY_LIBS!$XMLSECURITY_LIBS$ac_delim CUNIT_CPPFLAGS!$CUNIT_CPPFLAGS$ac_delim CUNIT_LIBS!$CUNIT_LIBS$ac_delim GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim GTK_LIBS!$GTK_LIBS$ac_delim GTKMM_CPPFLAGS!$GTKMM_CPPFLAGS$ac_delim GTKMM_LIBS!$GTKMM_LIBS$ac_delim PROCPS_CPPFLAGS!$PROCPS_CPPFLAGS$ac_delim PROCPS_LIBS!$PROCPS_LIBS$ac_delim DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim DNET_LIBS!$DNET_LIBS$ac_delim have_cxx!$have_cxx$ac_delim ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim ICU_LIBS!$ICU_LIBS$ac_delim RPCGEN!$RPCGEN$ac_delim have_doxygen!$have_doxygen$ac_delim DOT!$DOT$ac_delim HAVE_DOT!$HAVE_DOT$ac_delim MSCGEN!$MSCGEN$ac_delim MSCGEN_DIR!$MSCGEN_DIR$ac_delim BUILD_HGFSMOUNTER_TRUE!$BUILD_HGFSMOUNTER_TRUE$ac_delim BUILD_HGFSMOUNTER_FALSE!$BUILD_HGFSMOUNTER_FALSE$ac_delim LINUX_TRUE!$LINUX_TRUE$ac_delim LINUX_FALSE!$LINUX_FALSE$ac_delim SOLARIS_TRUE!$SOLARIS_TRUE$ac_delim SOLARIS_FALSE!$SOLARIS_FALSE$ac_delim FREEBSD_TRUE!$FREEBSD_TRUE$ac_delim FREEBSD_FALSE!$FREEBSD_FALSE$ac_delim FREEBSD_CUSTOM_SYSDIR_TRUE!$FREEBSD_CUSTOM_SYSDIR_TRUE$ac_delim FREEBSD_CUSTOM_SYSDIR_FALSE!$FREEBSD_CUSTOM_SYSDIR_FALSE$ac_delim THIRTY_TWO_BIT_USERSPACE_TRUE!$THIRTY_TWO_BIT_USERSPACE_TRUE$ac_delim THIRTY_TWO_BIT_USERSPACE_FALSE!$THIRTY_TWO_BIT_USERSPACE_FALSE$ac_delim HAVE_X11_TRUE!$HAVE_X11_TRUE$ac_delim HAVE_X11_FALSE!$HAVE_X11_FALSE$ac_delim HAVE_ICU_TRUE!$HAVE_ICU_TRUE$ac_delim HAVE_ICU_FALSE!$HAVE_ICU_FALSE$ac_delim WITH_KERNEL_MODULES_TRUE!$WITH_KERNEL_MODULES_TRUE$ac_delim WITH_KERNEL_MODULES_FALSE!$WITH_KERNEL_MODULES_FALSE$ac_delim HAVE_XSM_TRUE!$HAVE_XSM_TRUE$ac_delim HAVE_XSM_FALSE!$HAVE_XSM_FALSE$ac_delim HAVE_XCOMPOSITE_TRUE!$HAVE_XCOMPOSITE_TRUE$ac_delim HAVE_XCOMPOSITE_FALSE!$HAVE_XCOMPOSITE_FALSE$ac_delim ENABLE_TESTS_TRUE!$ENABLE_TESTS_TRUE$ac_delim ENABLE_TESTS_FALSE!$ENABLE_TESTS_FALSE$ac_delim WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim HAVE_DNET_TRUE!$HAVE_DNET_TRUE$ac_delim HAVE_DNET_FALSE!$HAVE_DNET_FALSE$ac_delim HAVE_DOXYGEN_TRUE!$HAVE_DOXYGEN_TRUE$ac_delim HAVE_DOXYGEN_FALSE!$HAVE_DOXYGEN_FALSE$ac_delim HAVE_FUSE_TRUE!$HAVE_FUSE_TRUE$ac_delim HAVE_FUSE_FALSE!$HAVE_FUSE_FALSE$ac_delim HAVE_GNU_LD_TRUE!$HAVE_GNU_LD_TRUE$ac_delim HAVE_GNU_LD_FALSE!$HAVE_GNU_LD_FALSE$ac_delim HAVE_GTKMM_TRUE!$HAVE_GTKMM_TRUE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF HAVE_GTKMM_FALSE!$HAVE_GTKMM_FALSE$ac_delim HAVE_PAM_TRUE!$HAVE_PAM_TRUE$ac_delim HAVE_PAM_FALSE!$HAVE_PAM_FALSE$ac_delim USE_SLASH_PROC_TRUE!$USE_SLASH_PROC_TRUE$ac_delim USE_SLASH_PROC_FALSE!$USE_SLASH_PROC_FALSE$ac_delim USE_PRINTF_WRAPPERS_TRUE!$USE_PRINTF_WRAPPERS_TRUE$ac_delim USE_PRINTF_WRAPPERS_FALSE!$USE_PRINTF_WRAPPERS_FALSE$ac_delim ENABLE_DEPLOYPKG_TRUE!$ENABLE_DEPLOYPKG_TRUE$ac_delim ENABLE_DEPLOYPKG_FALSE!$ENABLE_DEPLOYPKG_FALSE$ac_delim ENABLE_GRABBITMQPROXY_TRUE!$ENABLE_GRABBITMQPROXY_TRUE$ac_delim ENABLE_GRABBITMQPROXY_FALSE!$ENABLE_GRABBITMQPROXY_FALSE$ac_delim ENABLE_VGAUTH_TRUE!$ENABLE_VGAUTH_TRUE$ac_delim ENABLE_VGAUTH_FALSE!$ENABLE_VGAUTH_FALSE$ac_delim HAVE_VSOCK_TRUE!$HAVE_VSOCK_TRUE$ac_delim HAVE_VSOCK_FALSE!$HAVE_VSOCK_FALSE$ac_delim HGFS_LIBS!$HGFS_LIBS$ac_delim TOOLS_VERSION!$TOOLS_VERSION$ac_delim TARGET_OS!$TARGET_OS$ac_delim KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim LINUXINCLUDE!$LINUXINCLUDE$ac_delim MODULES_OS!$MODULES_OS$ac_delim MODULES_DIR!$MODULES_DIR$ac_delim MODULES!$MODULES$ac_delim COMMON_XLIBS!$COMMON_XLIBS$ac_delim XSM_LIBS!$XSM_LIBS$ac_delim XCOMPOSITE_LIBS!$XCOMPOSITE_LIBS$ac_delim PAM_PREFIX!$PAM_PREFIX$ac_delim PLUGIN_CPPFLAGS!$PLUGIN_CPPFLAGS$ac_delim PLUGIN_LDFLAGS!$PLUGIN_LDFLAGS$ac_delim VMTOOLS_CPPFLAGS!$VMTOOLS_CPPFLAGS$ac_delim VMTOOLS_LIBS!$VMTOOLS_LIBS$ac_delim RPCGENFLAGS!$RPCGENFLAGS$ac_delim XDR_LIBS!$XDR_LIBS$ac_delim TEST_PLUGIN_INSTALLDIR!$TEST_PLUGIN_INSTALLDIR$ac_delim COMMON_PLUGIN_INSTALLDIR!$COMMON_PLUGIN_INSTALLDIR$ac_delim VMSVC_PLUGIN_INSTALLDIR!$VMSVC_PLUGIN_INSTALLDIR$ac_delim VMUSR_PLUGIN_INSTALLDIR!$VMUSR_PLUGIN_INSTALLDIR$ac_delim SYSDIR!$SYSDIR$ac_delim INSTVMSG!$INSTVMSG$ac_delim RPCGEN_WRAPPER!$RPCGEN_WRAPPER$ac_delim LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim LIBVMTOOLS_LIBADD!$LIBVMTOOLS_LIBADD$ac_delim VIX_LIBADD!$VIX_LIBADD$ac_delim VGAUTH_LIBADD!$VGAUTH_LIBADD$ac_delim LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 48; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # 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. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $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'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? 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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $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=`$as_dirname -- "$file" || $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'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "libtool":C) # 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 cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # 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 # 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//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # 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 # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # 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 # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # 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 # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # 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 # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # 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 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # 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 a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # 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 # 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 DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # 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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # 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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_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 _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # 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) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { echo "$as_me:$LINENO: WARNING: Unable to substitute extended shell functions in $ofile" >&5 echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # 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 a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # 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 # 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 DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag { (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 open-vm-tools-10.0.7-3227872/ChangeLog0000644000000000000000000005465312660700525015442 0ustar rootrootopen-vm-tools 2016.02.11: * Removed all Makefile.in and it can be regenerated by command "autoreconf -i". * Added namespace command line utility "vmware-namespace-cmd". * Changed open-vm-tools version to 10.0.7 open-vm-tools-10.0.5 build 3227882 * ae82fa6 [Bug 1526360] fix timestamp check * b510107 [Bug 1531545] Add an error handler to X11 resolutionSet * adab9c5 [Bug 1503195] Kill tasklet when unloading vmci module * 35bcc69 [Bug 1519223] Avoid warning message when logging group is missing. * 581f2d0 [Bug 1473600] Skip freezing autofs mounts. * 8184e92 [Bug 1507819] Workaround fix to avoid rpc warning messages flooding by changing log level to debug. * eb47321 [Bug 1526327] make vmhgfs compatible with Linux kernel 4.2 open-vm-tools-10.0.0 build 3000743 * Common versioning * Quiesced snapshots * hgfs-fuse * Logging changes * AsyncSocket changes * Change ASSERT macros to VERIFY * Additional locking fixes and optimizations * Unicode type and macro cleanup * Change glib logging in RpcChannel to use Debug/Warning/Panic. * Clean up HGFS server unpack file name V3 arguments * Fix nested logging for VmxLogger with vsocket channel. * Compile mac-rdpvcbridge from cart-dev * Implement VMware Tools for ESXi 6.0 guests. * Get rid of ASSERT_ALWAYS_AVAILABLE * Get rid of ASSERT_LENGTH. * Move ASSERT_OR_IN_PANIC() from public/vm_assert.h to vmkernel. * Make lib/location product-agnostic * desktopEvents: Leave libICE rug firmly under libSM. * Remove SLPv2 * Provide a kill-switch for using vsocket in RpcChannel. * Use binary search tree to map guest os string to guest os enum. * codeset: use icuDir instead of libDir * Remove NR_MPNS_PER_PAGE * Make FileIO_AtomicUpdate fail gracefully when File_FullPath fails. * Merge atomic FetchAndAdd64 with ReadAdd64. * Rename Atomic_FetchAdd, part 1. * AsyncSocket: Remove UDP socket support. * Introduce Id_IsSetUGid for detecting setuid/setgid binaries. * Update WS, player version numbers on *-main branch. * Integrate all VIX changes from hosted13-pd-rel to vmcore-main. * Rename Atomic_FetchAnd*, part 5. * Cache Tools conf path. * No more Atomic_Fetch. * Add configuring of the Windows core dump flags for the tools service * Temporary fix for PR 1111448. * Add surface logging to basicOps * Id_IsSetUGid fails to compile on Android. * Add devel backdoor command to run replays inside frobos tests. * Save registers earlier during Panic. * Prepare the HGFS Windows client to use VMCI transport header version 2 * Get Mac OS system version from (Server|System)Version.plist * WebMKS plumbing: vmx side * Create new V2 of VMCI transport header * Minor logging cleanup in vmware-vprobe * Notify VMX when Toolsd is going down * Remove ovftool temporary fix. * Add /proc/interrupts and /proc/irq/* to vm-support * Remove HGFS from FreeBSD builds and packaging * Split DR6_ONES into DR6_DEFAULT and DR6_ONES * Add utilMem to Frobos * Support Intel RTM Debug behavior in VT mode. * MSG: Skip errno localization on unknown platforms. * Replace CPU_MemBarrier with Atomic_MFence * Prevent low privileged user from writable access to tools conf data * Change shutdown notification RPC failure message to debug. * Eliminate some "legacy IPC baggage". * Fix tools_obj_linux64 build (license file mismatch) * Convert the HGFS uses of ASSERT_DEVEL into ASSERT or remove * arm64 support in vm_basic_{types,defs}.h * Add an error function hook to PollDefault * arm64 support in vm_[basic_]asm.h * asyncWebSocket: improve rmks warning message when WebSocket connection fails due to bad SSL cert. * Implement MXUser semaphores on Mac OS with lib dispatch semaphores * Replace 3-clause BSD license template with 2-clause BSD license * vm_basic_{types,asm}.h: cleanup architecture #ifdefs * Add a surface flag for 16-byte image alignment in mobs * Change config.version from String to Long. * Fix HGFS server change notification packet handling. * Cleanup "vm_basic_defs.h" * vm_atomic: add ARM64 atomic operations. * Enable the HGFS VMCI VMX and HGFS server use the V2 header * Implement Devel ScreenShot command * Fix the HGFS protocol opcode to differentiate headers * vmkBoot: refactor serial, arm64 serial & panic. * vm_atomic: fix arm64 ReadIfWriteEqual atomics. * arm: bug fixes for uint*set implementations. * Rework the tools heartbeat code in the VMX. * vm_atomic: eliminate non-ASCII chars in comment. * Remove the incorrect immediate constraint from 64-bit atomic ops * Refactor code under guestinfo/getlib. * Remove __builtin_*_address(N) compile checks. * boot: misc. vmkernel changes to allow arm64 boot.c compile. * debug: move debug to main/x86, arm64 stubs. * prda/specialstack: refactor to split out arch deps, arm64 support. * Cleanup guestinfo plugin header dependency. * Change WSAAddressToString to WSAAddressToStringA * Handle EINVAL for preadv and pwritev. * Change GET_CURRENT_LOCATION definition. * Check if __GLIBC_PREREQ is defined before using it. * Add support for IOMMU guest addresses > 16TB. * * Fix Atomic_Read on ARMv7. * Create a trivial view when both the texture and the view are R24G8 class. * vm_atomic: fix ARM 32/64-bit Atomic_Read. * OvhdMem refactor + pull from vmioplugin branch * cpuset/vm_basic_asm: use standard clr/ctz primitives. * vm_basic_asm: fix windows build breakage. * vSock: Rename "VMCI Sockets". * Disable nullDriver by default and add a config switch to enable it. * First submit of the VDTI PCI Device. * Cleanup/Rationalize coreDump * vSock VMX: Introduce a separate sendCb field * Don't define g_info if it is available. * A virtual USB video device backend. * A virtual video device backend. * Skip freezing remote mounts. * lib/file: Various fixes to FileIOP(read|write)vInternal and FileIO_(Readv|Writev). * Use int 31 instruction to trigger an assert in the VMKernel * vm_basic_asm: fix uint32set for arm64. * Clean up of APIs used by the HGFS server library * Clean up the HGFS server shares interface to the HGFS server part II * Ignore disk UUIDs from the paths to be frozen. * Clean up the HGFS server use of the policy share enumeraton APIs * fix HostinfoGetOSShortName to support Debian 7.x * remove unnecessary constraints for ABSOLUTELY_NOINLINE define * More clean up the HGFS server manager, policy manager APIs * Remove MPN32 related macros. * lib/uuid: Add CreateRandomEFI, and cleanup * Fix buffer overflow in perfMonLinux * AsyncSocket: hostname/IP string connection functions should attempt both IPv4 and IPv6 connections. * lib/lock: lock tracking tree optimization * Fast send on the asynNamedPipe if Write completes synchronously. * increase MAX_MPN to 38 bits * finish conversion of invalid_mpn64 and max_mpn64 * Change Mul64x3264 family of functions to round instead of truncating * Add CACHELINE_SIZE to vm_basic_defs.h. * Memory is accessed after being freed in function * Add some debug noise to RPCs received in guest. * Add SMAP support to MMU page walkers and MonTLB * lib/file: File_Rotate needs some protection * Hgfs VMCI: move packet max size to the correct location * Hgfs Server: remove transport only header file from the server. * Log errors in RandomBytesWin32. * Defer the RunScript cleanup when VIX commands are restricted. * Add support in resolution set to log multiple sessions in RDSH. * Make Clamped_SAdd32 more robust against compiler options * Compare the remote FS type strings the right way. * VIX plugin under vmusr should not register for TOOLS_CORE_SIG_IO_FREEZE. * Add runtime macros to check type of tools service. * vm_atomic: remove unfenced atomic operations. * vm_atomic: LOCK-like semantics for arm64 atomics. * refcount/vm_basic_asm: multi-architecture memory barriers. * Hgfs Server: Fix unpacking of protocol header unused fields * Enlarge MAX_IFACES to ensure vmtools could get a valid GOS IP throguh NetUtil_GetPrimaryIP(). * Change BPN to be a 64 bit type. * lib/lock: MXUser_Control* -> typed functions [trivial?] * fix bad error * ARM64: Add more basic assembler support * Guest Tools: Add memNeeded for Windows and Linux and handle versioning * Fix incorrect LRU file accounting for memNeeded on Linux * Change the bit representation of BPN to make way for NVM. * tools perf mon: collect more stats from /proc/meminfo * Remove vmxwifi.sys and macWireless_defs.h * tools perf mon: refactor * tools data collection: Collect all of the new Linux data * Guest stats: fix the time base * gos tables: Table must be sorted; reinsert "coreos-64" accordingly * guest performance data: no need to have a maximum RPC transfer size * guest perf stats: replumb GuestInfo_PerfMon * guest perf stats: GuestInfo_PerfMon builds the RPC data itself * guest perf data: collect the Linux data * guest perf data: return the new protocol * guest perf stats: ice the cake (add some polish) * guest perf stats: Linux goes to the new format * Hgfs Posix Server: fix the writes to not exceed max file size * Stick backdoor behavior after vSocket connection failure. * Hgfs Posix Server: fix Solaris tools obj builds for log statements * Fix memory leak in hgfs server. * Implement QuadBlit for DX11Renderer. * Add feature-specific RDE Dev Targets - folderRedirection, tsmmr, viewMP * MX_Lock should not use HLE on unpatched Haswell systems * Hgfs Posix Server: add some useful logging for symlink names * lib/file: Don't leak a filename in FileRotateByRenumber. * Hgfs Posix Server: add more useful logging to open * Hgfs Posix Server: fix open requests failing EAGAIN (EWOULDBLOCK) * Sometimes channel can be NULL, this will make vmtools panic. * lib: misc/sig support for arm64 (redux). * HostType: stop using sysctl * authPosix: use getspent when using shadow password, but not PAM * Added protocol selection to bora AsyncWebSocket.- Changed VNC Client offer 'vmware-vvc' protocol as an additional protocol. * Enable 3D with DX11Renderer and port over the existing PROTOTYPE RenderOps functions. * Create the support dir under /tmp instead of CWD. * Disable NullDriver backend only for forceQuiece case. * Hgfs Server: fix malformed symlink creation requests * Hgfs Server: fix check malformed read packets * Fix Ubuntu errors in the vm-support script. * Expose BDOOR_CMD_VCPU_MMIO_HONORS_PAT to guest. * Add optional websocket protocols parameter to AsyncSocket_ListenWebSocketUDS. If NULL then default (legacy) protocols are used. * Allow the network script to bring each individual interface up/down. * deployPkg plugin: make deployPkg.cpp build as C or C++ * GOSTable: Plumb vmkernel6 as a separate bit * add deployPkg files to open-vm-tools * Introduce mkfsPmem, libpmem for managing pmem resources via the kernel from user-space. * Allow to queue MCE requests form the kernel to the VMM. * HGFS: Remove R/R * Replace PUSHF/POPF with STAC/NOP when setting EFLAGS.AC * lib/file: hostd crashes in assertion failure due to file list * Tools: Create GuestInfo_GetPrimaryIP as a IPv6 compliant version of NetUtil_GetPrimaryIP * Remove memNeeded calculation from the guest tools * Move SIZE_xxBITS to common architecture file. * GOSTable: Windows 10 as a unique guest * Set _FILE_OFFSET_BITS=64 for Solaris * Plumbing to expose (whitelisted) vsi-based stats in guest * Assorted _FILE_OFFSET_BITS=64 / _LARGEFILE64_SOURCE fixups * Serial: [2/16] Serial8250 - refactor into generic and platform parts. * lib/log: Improve the level filtering implementation and documentation * lib/log: no need to "blip" the lock * lib/misc: header clean up * Add 16 bits atomics to vm_atomic.h. * Add 16 bits atomics for arm64 * Clean up some file headers * Begin plumbing guest mks stats out to the host. * lib/log: improved documentation in log.h * Converting MPN to MPN32. * Reimplement guestproxycerttool.pl in C. * Atomic Boolean support * Add grabbitmqProxy plugin to open-vm-tools. * Windows 10: an all Windows 10 macro * Remove some vacuous FileIO usage * Introducing 64-bit MPN type. * mks: add shared-secret authentication for Blast websocket connections * Windows 10: add macros for all 32 and all 64 bit * Add guestproxycerttool (C-implementation) to open-vm-tools and OSPs. * cleanup app balloon in vmm, vmx, and parts of vmkernel * Honour panic.breakOnPanic on Posix. * hashTable: free function work like our other free functions * Introduce certificate hash verification in blast native clients. * Forward declare sslverifyparam in ssldirect.h * asyncWebsocket: move WebSocketHandshakeState into asyncWebSocket.c * RecordReplayRemoval: make RR go away from automation tools. * tools: improved memNeeded * guest stats: Use DynBufs * guest tools: a bit of consolidation * guest stats: rates in pages per second * Guest stats: Dynamically capture stats in Linux * guestStats: optimize memory allocation * guest stats: Linux deals with overflow * guest stats: consistent open file failure messages * GuestStat: improve function header * GuestStat: more function header cleanup * Stop publishing guest stats from VSI/GuestMemInfo structure. * Guest Stats: extensible reporting * Use new #define _DEFAULT_SOURCE to build open-vm-tools. * Publish Windows guest stats via V5 format * Guest stats: Only populate Linux legacy values that have been consumed * guest stats: Linux publish names as defines * Windows stat code cleanup * GuestStat: official registed the build in names * Adjust lock ranks for IO filters. * asyncWebSocket: remove hybi designator and consolidate code * asyncWebSocket: simplify protocol lists and framing * asyncSocket: simplify the interface for specifying websocket protocols * GuestStat: Name data is properly name string * lib/misc: Support Util_IsAbsolutePath on Solaris and FreeBSD * Hgfs Server: fix unpack of file name args for directory open * Minor updates to windows stat code * GuestStats: Better data validation and names * Debug log messages and minor fixes. * Add TLS caching for gettid calls on Linux * Add File_DeleteDirectoryContent. * Allow vm-support script execution only for root user. * GuestStats: rationalize the stat datum bits * No more MPN64 type. * Gettid TLS: fix coredumping * sigPosix scrub: more consistent self-signal behavior and remove unused code * Guest Stats: fix alphabetization * Publish stats for Windows pagefile size and used subset in KB * GuestOps: Set file ownership before setting file permissions. * GuestStats: no time units. * GuestSDK: remove vmtools.dll/so dependency * Use new generic way to collect guest stats and remove unused legacy guest stats. * Remove vmioplugin. * Use GOnce in pollGtk instead of a static mutex. * Update hgfsServer alias code. * Inline ASM for rotate left/right instruction * Add backdoor command to restrict vmmouse * Add Posix File to hgfsURI * lib/file: FileSleeper must really sleep * Fix unnecessary cast * Add LIKELY/UNLIKELY into MXUserRec * Fix argument order for InterlockedCompareExchange8 * rmks/ssl: change SSL verification for View/Blast RMKS connections to reject mismatched thumbprint always * GuestStats: Linux active/inactive anon buffers * GuestStats: order the linux stats * GuestStats: Clean up include file * Hgfs Server: enhance logging for packet request ID * Allow RpcVMX_LogV to run without calling malloc. * Update the stat IDs list. * Don't mount alias target volumes while resolving HGFS file attributes * Remove the executable bit from various source files * add some improved cert debug noise * Basic infrastructure support for guestIntegrity backdoor calls. * Implement MXUser semaphores on Mac OS with lib dispatch semaphores * Add a backdoor command for mksStats snapshots. * add vmhgfs-fuse to open-vm-tools * vm_basic_defs/gdb: use non-builtin offsetof for vmk gdb macros. * Implement MXUserEvent * Remove updateAgent code. * Change default sampling rate for guest stats to 20 seconds. * Include cstring to avoid 'memset not in scope' error. * Remove guestStats that are beyond 60u1 scope. * Fixes for use_after_free, double_free and double_close. * Use a global lock for protecting gLoggingStopped. * change default debugging level and location * adjust logging noise for vmtoolsd * clean up debug & warning messages in guestInfo plugin * clean up logging in vix plugin * recategorize powerOps logging messages * gather new default Tools logs with vm-support * add toolbox-cmd support for log` open-vm-tools-9.10.2 build 2822639 * Use new #define _DEFAULT_SOURCE to build OVT. glibc-2.20 has deprecated the _BSD_SOURCE and _SVID_SOURCE macros. Starting with glibc-2.19 _DEFAULT_SOURCE is recommended. Keep the old macros because someone might want to build open-vm-tools with an older glibc version. With glibc-2.20 VGAuthLog.c was picking the POSIX definition for strerror_r that returns int type. That does not work with glibc-2.2, which has only one definition with return type char *. For better compatibility with various glibc versions, use the _GNU_SOURCE definition of strerror_r that returns char *. * Fix a compilation error in toolboxcmd-shrink.c with gcc 5.0.1. Building open-vm-tools for Fedora 22 hit a compilation error with gcc 5.0.1. Also remove some redundant code. ShrinkGetMountPoints() calls ShrinkGetWiperState() and handles the WIPER_UNAVAILABLE and WIPER_DISABLED cases. The call to ShrinkGetWiperState() is redundant because wiper state will always be WIPER_ENABLED. * Fix the compiler version check and include mul64.h. The compiler check was intended to be >= GCC 4.4, but it was insisting that the major and minor version numbers of GCC both be >= 4, so it was breaking on Fedora 22, which has GCC 5.1.1, and for a user who was building with GCC 4.3. For old compilers we need to provide mul64.h, so include it in open-vm-tools. * Retry sending vmbackup event with elevated privileges. A privilege check on the host side was implemented in ESXi 5.5. Due to this change, once guest/Toolsd sends iopl_elevation capability (RPC msg "tools.capability.iopl_elevation") to an ESXi 5.5 host, it requires guest to elevate the privileges before the guest sends vmbackup event. Linux Tools version 9.4.x sends this capability and enables this behavior on the host. Tools version 9.10.0 does not send iopl_elevation capability and does not require privilege elevation. Therefore, in order to workaround the host behavior, we retry sending the vmbackup event after elevating the guest privileges. To avoid doubling the RPC messages from Toolsd, we also cache the last failure result from the unprivileged attempt for the duration of current vmbackup operation. * vSock changes to prepare for FreeBSD Add support to header files for FreeBSD. For now just add some stubs that return errors. * add a -h option to vgauth vgauth is not normally run from a command line, but add a -h option to provide minimal documentation. * Bump Tools version to 9.10.2 for open-vm-tools release. * Workaround NFS open bug by retrying on ESTALE RFC 1341775 uncovered an NFS client open race which causes open to fail with ESTALE if there is another host trying to atomically swap the file at the same time. This causes the file to be unlinked which might cause the thread trying to open it (for acquiring lock) to fail with ESTALE. Implement a very simple fix which retries for 3 seconds upon getting ESTALE. * Fix the HGFS protocol opcode to differentiate headers For differentiating the older HgfsRequest and the new HgfsHeader structures sent in an HGFS packet, the old header opcode is set to 0xff using HGFS_V4_LEGACY_OPCODE. This should have been made a specific value of the HGFS opcode enum and named for what it really means, but the enum type could clash with the HGFS_V4_LEGACY_OPCODE by accident if enough values are added. There is a potential issue with the newer HgfsHeader object where it overlays the old HgfsRequest op field. The new header tries to break the field into the first byte and save the remaining 3 bytes for a different use. However, this cannot be done as the current and shipping HGFS server code uses the HgfsRequest and op field (4 bytes) to verify the value is 0xFF. If this is a match then it is deemed that the packet has the new header. If the client tried to use any of the new header's reserved2 fields (overlayed with part of the old header op field) then the HGFS server test for a new header would fail to match. Fixed the HgfsHeader opcode fields to actually be the correct HgfsOp type. Removed the define for HGFS_V4_LEGACY_OPCODE and made it part of the opcode enum to ensure correct type checking. Added an assert on compile to ensure that the HGFS opcode values don't encroach on the invalid opcode used to determine the header type. Renamed the HGFS_V4_LEGACY_OPCODE to conform with the existing enum values and state exactly what its meaning is: HGFS_OP_NEW_HEADER. Now the 4 bytes cannot be used for anything but the protocol opcode new header value. This also corrects any strict typing by compilers for building open vm tools in newer guest operating systems. * Thaw filesystems when the snapshot commit message to VMX fails. If it takes a long time to freeze filesystems, VMX may timeout the snapshot operation so the commit fails. After this happens, thaw the frozen filesystems. * open-vm-tools: fixes to build on FreeBSD 10 Various fixes to make open-vm-tools build on FreeBSD: - disable vsock for OSes other than Linux - define CheckSanity only ifdef VMX86_DEBUG - make build of hgfsUriPosix depend on having gtkmm, and enable on FreeBSD - xferlogs.c does not need wchar.h Instructions for building on FreeBSD: 1. Install gcc48 with 'pkg install gcc' 2. Install build dependencies: glib libdnet libXinerama libXrandr gtk2 gtkmm24 3. autoreconf -i --force 4. env CC=gcc48 CFLAGS=-Wl,-rpath=/usr/local/lib/gcc48 CPPFLAGS="-I/usr/local/include/" LIBS="-L/usr/local/lib" ./configure --without-kernel-modules --without-xmlsecurity --without-icu --disable-vgauth --disable-grabbitmqproxy --disable-deploypkg 5. make * Don't build vmxnet driver for Linux >= 3.3 The vmxnet driver does not build for Linux kernel versions >= 3.3. * Don't build HGFS kernel driver for Linux >= 3.17.0 The HGFS kernel component is old and has many changes missing to support newer Linux kernel releases. There will be a newer update coming which will include all of the changes necessary for newer Linux kernels to be supported. For now, we are limiting the building of the current HGFS kernel client to Linux kernels 3.17.0 and earlier for this release of open-vm-tools. This will allow the build of the open-vm-tools package to complete on newer kernel versions. open-vm-tools-10.0.7-3227872/checkvm/0000755000000000000000000000000012660700525015273 5ustar rootrootopen-vm-tools-10.0.7-3227872/checkvm/Makefile.am0000644000000000000000000000257312660700525017336 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ bin_PROGRAMS = vmware-checkvm vmware_checkvm_SOURCES = vmware_checkvm_SOURCES += checkvm.c vmware_checkvm_LDADD = vmware_checkvm_LDADD += @VMTOOLS_LIBS@ if HAVE_ICU vmware_checkvm_LDADD += @ICU_LIBS@ vmware_checkvm_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXX) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ else vmware_checkvm_LINK = $(LINK) endif open-vm-tools-10.0.7-3227872/checkvm/checkvm.c0000644000000000000000000000664712660700525017074 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * checkvm.c -- * * Check if we are running in a VM or not */ #include #include #if !defined(_WIN32) #include #endif #include "vm_version.h" #include "backdoor.h" #include "backdoor_def.h" #include "vm_basic_types.h" #include "vmcheck.h" #if defined(_WIN32) #include "getoptwin32.h" #endif #include "checkvm_version.h" #include "vm_version.h" #include "embed_version.h" VM_EMBED_VERSION(CHECKVM_VERSION_STRING); /* * getHWVersion - Read VM HW version through backdoor */ void getHWVersion(uint32 *hwVersion) { Backdoor_proto bp; bp.in.cx.halfs.low = BDOOR_CMD_GETHWVERSION; Backdoor(&bp); *hwVersion = bp.out.ax.word; } /* * getScreenSize - Get screen size of the host */ void getScreenSize(uint32 *screensize) { Backdoor_proto bp; bp.in.cx.halfs.low = BDOOR_CMD_GETSCREENSIZE; Backdoor(&bp); *screensize = bp.out.ax.word; } /* * Start of main program. Check if we are in a VM, by reading * a backdoor port. Then process any other commands. */ int main(int argc, char *argv[]) { uint32 version[2]; int opt; int width, height; uint32 screensize = 0; uint32 hwVersion; if (!VmCheck_IsVirtualWorld()) { fprintf(stdout, "Not running in a virtual machine.\n"); return 1; } if (!VmCheck_GetVersion(&version[0], &version[1])) { fprintf(stdout, "Couldn't get version\n"); return 1; } /* * OK, we're in a VM, check if there are any other requests */ while ((opt = getopt(argc, argv, "rph")) != EOF) { switch (opt) { case 'r': getScreenSize(&screensize); width = (screensize >> 16) & 0xffff; height = screensize & 0xffff; if ((width <= 0x7fff) && (height <= 0x7fff)) { printf("%d %d\n", width, height); } else { printf("0 0\n"); } return 0; case 'p': /* * Print out product that we're running on based on code * obtained from getVersion(). */ switch (version[1]) { case VMX_TYPE_SCALABLE_SERVER: printf("ESX Server\n"); break; case VMX_TYPE_WORKSTATION: printf("Workstation\n"); break; default: printf("Unknown\n"); break; } return 0; case 'h': getHWVersion(&hwVersion); printf("VM's hw version is %u\n", hwVersion); break; default: break; } } printf("%s version %d (good)\n", PRODUCT_LINE_NAME, version[0]); return 0; } open-vm-tools-10.0.7-3227872/checkvm/checkvm_version.h0000644000000000000000000000301512660700525020630 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * checkvm_version.h -- * * Version definitions for the VM checking utility. */ #ifndef _CHECKVM_VERSION_H_ #define _CHECKVM_VERSION_H_ /* * This component's version is coupled with Tools versioning. The effect * is that the version increments with each build, and with each Tools * version bump. If and when it becomes necessary to version the component * manually, make sure that the version is bumped any time the component or * its dependencies are changed. */ #include "vm_tools_version.h" #define CHECKVM_VERSION_COMMAS TOOLS_VERSION_EXT_CURRENT_CSV #define CHECKVM_VERSION_STRING TOOLS_VERSION_EXT_CURRENT_STR #endif /* _CHECKVM_VERSION_H_ */ open-vm-tools-10.0.7-3227872/checkvm/Makefile.in0000644000000000000000000004325512660700525017351 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ bin_PROGRAMS = vmware-checkvm$(EXEEXT) @HAVE_ICU_TRUE@am__append_1 = @ICU_LIBS@ subdir = checkvm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_vmware_checkvm_OBJECTS = checkvm.$(OBJEXT) vmware_checkvm_OBJECTS = $(am_vmware_checkvm_OBJECTS) am__DEPENDENCIES_1 = vmware_checkvm_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(vmware_checkvm_SOURCES) DIST_SOURCES = $(vmware_checkvm_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ vmware_checkvm_SOURCES = checkvm.c vmware_checkvm_LDADD = @VMTOOLS_LIBS@ $(am__append_1) @HAVE_ICU_FALSE@vmware_checkvm_LINK = $(LINK) @HAVE_ICU_TRUE@vmware_checkvm_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) \ @HAVE_ICU_TRUE@ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ @HAVE_ICU_TRUE@ $(LDFLAGS) -o $@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 checkvm/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu checkvm/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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 vmware-checkvm$(EXEEXT): $(vmware_checkvm_OBJECTS) $(vmware_checkvm_DEPENDENCIES) @rm -f vmware-checkvm$(EXEEXT) $(vmware_checkvm_LINK) $(vmware_checkvm_OBJECTS) $(vmware_checkvm_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkvm.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic 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-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/checkvm/COPYING0000644000000000000000000006347112660700525016341 0ustar rootroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! open-vm-tools-10.0.7-3227872/config/0000755000000000000000000000000012660700525015120 5ustar rootrootopen-vm-tools-10.0.7-3227872/config/ltmain.sh0000644000000000000000000105204012660700525016742 0ustar rootroot # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 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. # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [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 # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # 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. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.2 Debian-2.4.2-1ubuntu1" TIMESTAMP="" package_revision=1.3337 # 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+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # 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" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; 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 that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # 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 "$opt_dry_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" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # 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= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_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 $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE 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. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # 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 () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` 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 "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # 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. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # 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 func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # 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= pie_flag= 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) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append 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,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append 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. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # 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 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) 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 "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" 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 $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "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." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/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." $opt_dry_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 func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/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." $opt_dry_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 func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [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: $progname [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 -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler 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: $progname [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: $progname [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: $progname [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 following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [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 -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -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 -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -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] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) 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: $progname [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." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" 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 -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; 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 LANGUAGE 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 else $lt_unset $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 } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" 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" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # 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. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; 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. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append 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 -e "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. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_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 test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append 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 func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_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 func_basename "$file" destfile="$func_basename_result" 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 func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "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) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # 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/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) 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*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; 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 "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # 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. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug 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 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $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_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" 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 func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result 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" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_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've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # 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. sed_quote_subst='$sed_quote_subst' # 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+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # 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 variables: generated_by_libtool_version='$macro_version' 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 file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED '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 \"\$file\" | $SED '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 \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ 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 "\ # 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 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # 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 \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} 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 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #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 # define FOPEN_WB "wb" # 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 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ 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; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); 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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); 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 * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } 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; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" 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 func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append 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 func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" 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 func_append 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. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append 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 func_append 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" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" 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 # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir 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 func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework 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*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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* | *-cegcc* | *-*-haiku*) # 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 func_append deplibs " System.ltframework" 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 func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" 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*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext 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 ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" 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 func_append 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. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append 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 func_append 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" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" 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. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'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\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. 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 $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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 $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append 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 notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; 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 # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi 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%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" 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 \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; 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 func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" 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 func_dirname "$lib" "" "." ladir="$func_dirname_result" 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 *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; 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 func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` 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 use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac 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. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # 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 func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append 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 func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" 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. func_append dlprefiles " $lib $dependency_libs" else func_append 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 func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$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 func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac 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 func_append 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*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; 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 $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append 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 *"$absdir:"*) ;; *) func_append 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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 case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && 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 "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" 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* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' 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 "$opt_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 (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; 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 elif test -n "$old_library"; then 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 && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append 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 func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append 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:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; 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:"*) ;; *) func_append 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 [\\/]*) func_append 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*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append 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" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= 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 "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi 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 "*) ;; *) func_append 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 "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append 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 func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" 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 test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # 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="$1" number_minor="$2" number_revision="$3" # # 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 # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; 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]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; 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]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; 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]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" 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 func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result 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 func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result 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 func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; 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 func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_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 | *.gcno) ;; $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 func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "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 func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append 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 "*) ;; *) func_append 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 "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-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 func_append 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. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi 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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append 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 ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append 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 func_append 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 ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; 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 " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) 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 ;; esac ;; 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 with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; 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 # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; 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 " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append 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 # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_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 func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append 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 "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append 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 "$opt_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 shift realname="$1" 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 func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "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" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_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:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # 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 func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append 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. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result 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~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "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" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi 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\" test "X$libobjs" = "X " && libobjs= 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 fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( 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 "$opt_mode" = relink; then $opt_dry_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 func_show_eval '${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 func_show_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 "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_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 "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${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" # $opt_dry_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" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; 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 "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append 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 "*) ;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append 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"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status 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 func_append 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 func_append 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi 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" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` 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 "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "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}\" || $lt_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 func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result 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 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } 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 $symfileobj" 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" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append 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 # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # 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 func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$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 eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$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= len=$len0 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 func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "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}\" || $lt_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 func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; 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 "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { 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) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # 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' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_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 } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug 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) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; 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 func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append 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 func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # 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 build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 open-vm-tools-10.0.7-3227872/config/depcomp0000755000000000000000000004224612660700525016505 0ustar rootroot#! /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: open-vm-tools-10.0.7-3227872/config/config.guess0000755000000000000000000012626012660700525017447 0ustar rootroot#! /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: open-vm-tools-10.0.7-3227872/config/compile0000755000000000000000000000717312660700525016506 0ustar rootroot#! /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: open-vm-tools-10.0.7-3227872/config/config.sub0000755000000000000000000007746012660700525017121 0ustar rootroot#! /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: open-vm-tools-10.0.7-3227872/config/missing0000755000000000000000000002557712660700525016537 0ustar rootroot#! /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: open-vm-tools-10.0.7-3227872/config/install-sh0000755000000000000000000003160012660700525017124 0ustar rootroot#!/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: open-vm-tools-10.0.7-3227872/configure0000755000000000000000000417642212660700525015602 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for open-vm-tools 10.0.7. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ( test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" )) || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= 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=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF 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 : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF 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 : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } ( test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )) || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell autoconf@gnu.org about your system, echo including any error possibly output before this echo message } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" SHELL=${CONFIG_SHELL-/bin/sh} exec 7<&0 &1 # 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` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' PACKAGE_VERSION='10.0.7' PACKAGE_STRING='open-vm-tools 10.0.7' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef 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 datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar 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 CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE SED LN_S LIBTOOL GREP EGREP FGREP LD DUMPBIN ac_ct_DUMPBIN NM OBJDUMP DLLTOOL AR ac_ct_AR RANLIB MANIFEST_TOOL DSYMUTIL NMEDIT LIPO OTOOL OTOOL64 CXXCPP HAVE_PKG_CONFIG XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS ac_vmw_lib_cfg MSPACK_CPPFLAGS MSPACK_LIBS GLIB2_CPPFLAGS GLIB2_LIBS GMODULE_CPPFLAGS GMODULE_LIBS GOBJECT_CPPFLAGS GOBJECT_LIBS GTHREAD_CPPFLAGS GTHREAD_LIBS have_genmarshal FUSE_CPPFLAGS FUSE_LIBS PAM_CPPFLAGS PAM_LIBS SSL_CPPFLAGS SSL_LIBS XERCES_CPPFLAGS XERCES_LIBS XMLSECURITY_CPPFLAGS XMLSECURITY_LIBS CUNIT_CPPFLAGS CUNIT_LIBS GTK_CPPFLAGS GTK_LIBS GTKMM_CPPFLAGS GTKMM_LIBS PROCPS_CPPFLAGS PROCPS_LIBS DNET_CPPFLAGS DNET_LIBS have_cxx ICU_CPPFLAGS ICU_LIBS RPCGEN have_doxygen DOT HAVE_DOT MSCGEN MSCGEN_DIR BUILD_HGFSMOUNTER_TRUE BUILD_HGFSMOUNTER_FALSE LINUX_TRUE LINUX_FALSE SOLARIS_TRUE SOLARIS_FALSE FREEBSD_TRUE FREEBSD_FALSE FREEBSD_CUSTOM_SYSDIR_TRUE FREEBSD_CUSTOM_SYSDIR_FALSE THIRTY_TWO_BIT_USERSPACE_TRUE THIRTY_TWO_BIT_USERSPACE_FALSE HAVE_X11_TRUE HAVE_X11_FALSE HAVE_ICU_TRUE HAVE_ICU_FALSE WITH_KERNEL_MODULES_TRUE WITH_KERNEL_MODULES_FALSE HAVE_XSM_TRUE HAVE_XSM_FALSE HAVE_XCOMPOSITE_TRUE HAVE_XCOMPOSITE_FALSE ENABLE_TESTS_TRUE ENABLE_TESTS_FALSE WITH_ROOT_PRIVILEGES_TRUE WITH_ROOT_PRIVILEGES_FALSE HAVE_DNET_TRUE HAVE_DNET_FALSE HAVE_DOXYGEN_TRUE HAVE_DOXYGEN_FALSE HAVE_FUSE_TRUE HAVE_FUSE_FALSE HAVE_GNU_LD_TRUE HAVE_GNU_LD_FALSE HAVE_GTKMM_TRUE HAVE_GTKMM_FALSE HAVE_PAM_TRUE HAVE_PAM_FALSE USE_SLASH_PROC_TRUE USE_SLASH_PROC_FALSE USE_PRINTF_WRAPPERS_TRUE USE_PRINTF_WRAPPERS_FALSE ENABLE_DEPLOYPKG_TRUE ENABLE_DEPLOYPKG_FALSE ENABLE_GRABBITMQPROXY_TRUE ENABLE_GRABBITMQPROXY_FALSE ENABLE_VGAUTH_TRUE ENABLE_VGAUTH_FALSE HAVE_VSOCK_TRUE HAVE_VSOCK_FALSE HGFS_LIBS TOOLS_VERSION TARGET_OS KERNEL_RELEASE LINUXINCLUDE MODULES_OS MODULES_DIR MODULES COMMON_XLIBS XSM_LIBS XCOMPOSITE_LIBS PAM_PREFIX PLUGIN_CPPFLAGS PLUGIN_LDFLAGS VMTOOLS_CPPFLAGS VMTOOLS_LIBS RPCGENFLAGS XDR_LIBS TEST_PLUGIN_INSTALLDIR COMMON_PLUGIN_INSTALLDIR VMSVC_PLUGIN_INSTALLDIR VMUSR_PLUGIN_INSTALLDIR SYSDIR INSTVMSG RPCGEN_WRAPPER LIB_AUTH_CPPFLAGS LIB_IMPERSONATE_CPPFLAGS LIB_USER_CPPFLAGS LIBVMTOOLS_LIBADD VIX_LIBADD VGAUTH_LIBADD LIBOBJS LTLIBOBJS' ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP XMKMF' # 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. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= 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 case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -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) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$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 ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -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'` 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 ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$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 ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) 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 ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$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'` 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; }; } 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 directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } 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 ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # 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 the parent directory. ac_confdir=`$as_dirname -- "$0" || $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 test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # 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 open-vm-tools 10.0.7 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 \`..'] 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] --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] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/open-vm-tools] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _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 X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of open-vm-tools 10.0.7:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-multimon disables multimon, enabled by default --disable-docs disables generation of API documentation; by default, docs are built if doxygen is available. --disable-tests disable compilation of test code. --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) --disable-deploypkg do not build deploypkg plugin. --disable-grabbitmqproxy do not build grabbitmqproxy plugin. --disable-vgauth do not build vgauth. Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-root-privileges does not perform any operations that require root privileges --without-kernel-modules does not compile or install the kernel modules --with-kernel-release specifies the kernel release you want to build against --with-linuxdir specifies the Linux directory you want to use --without-gtk2 compiles without Gtk 2.0 --without-gtkmm compiles without Gtkmm, sigc++, and related libs --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). --with-x use the X Window System --without-pam compiles without PAM support. --without-ssl compiles without openssl support (disables grabbitmqproxy and vgauth). --without-xmlsecurity compiles without xml-security-c support (disables vgauth). --without-xerces compiles without xerces support (disables vgauth). --with-pam-prefix specifies where pam files go. Default is $(sysconfdir) --without-procps compiles without libproc (disables support for meminfo) --without-dnet compiles without libdnet (disables support for nicinfo) --without-icu disables support for ICU 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 LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective 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 XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested 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 else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF open-vm-tools configure 10.0.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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 fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by open-vm-tools $as_me 10.0.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { 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` /usr/bin/hostinfo = `(/usr/bin/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 IFS=$as_save_IFS } >&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_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_arg'" ;; 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: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. 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, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r 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 -f -r conftest* 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 -n "$CONFIG_SITE"; then set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then set x "$prefix/share/config.site" "$prefix/etc/config.site" else set x "$ac_default_prefix/share/config.site" \ "$ac_default_prefix/etc/config.site" fi shift for ac_site_file 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 $ac_precious_vars; 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 # In order to make this configure script auto-detect situations where # people have a 32-bit userland running with a 64-bit kernel, we try to ask # the compiler (assumedly gcc) for its default Target:. # We have to set up $TEST_CC manually, since AC_PROG_CC hasn't yet been run (and can't be until AC_CANONICAL_HOST & AC_CANONICAL_BUILD are run) # The purpose of all this is to set up $host_alias/$build_alias in a more # intelligent way than config.guess currently does. TEST_CC="$CC_FOR_BUILD" test -z "$TEST_CC" && TEST_CC="$HOST_CC" test -z "$TEST_CC" && TEST_CC="$CC" if test -n "$TEST_CC" -a -z "$host_alias"; then host_alias="`$TEST_CC -dumpmachine`" if test -z "$build_alias" -a -n "$host_alias"; then build_alias="$host_alias" fi fi unset TEST_CC # checkvm/checkvm.c has no special significance - we just need to pass in a file that # helps autoconf verify that it really has found the source tree. # Keep the top-level directory tidy by putting auxiliary build tools and local # macros in separate subdirectories. 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 # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { 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 if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } case $ac_cv_build in *-*-*) ;; *) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac # Quote the regular expressions case "$host_cpu" in i[3456]86) userSpaceBitness="32" ;; x86_64) userSpaceBitness="64" ;; *) { { echo "$as_me:$LINENO: error: Unknown architecture." >&5 echo "$as_me: error: Unknown architecture." >&2;} { (exit 1); exit 1; }; } ;; esac # Operational arguments. # Check whether --with-root-privileges was given. if test "${with_root_privileges+set}" = set; then withval=$with_root_privileges; else with_root_privileges=yes fi # Kernel arguments. # The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible # to getOsVersion() # Check whether --with-kernel-modules was given. if test "${with_kernel_modules+set}" = set; then withval=$with_kernel_modules; else with_kernel_modules=yes fi # Check whether --with-kernel-release was given. if test "${with_kernel_release+set}" = set; then withval=$with_kernel_release; KERNEL_RELEASE="$withval" else KERNEL_RELEASE=`uname -r` fi # Check whether --with-linuxdir was given. if test "${with_linuxdir+set}" = set; then withval=$with_linuxdir; LINUXDIR="$withval" else LINUXDIR=/lib/modules/$KERNEL_RELEASE fi # Turn the uname output into something we can run comparisons on. getOsVersion() { major_version="`echo $KERNEL_RELEASE | cut -f1 -d. | cut -f1 -d-`" minor_version="`echo $KERNEL_RELEASE | cut -f2 -d. | cut -f1 -d-`" micro_version="`echo $KERNEL_RELEASE | cut -f3 -d. | cut -f1 -d-`" printf '%02d%02d%03d' $major_version $minor_version $micro_version } case "$host_os" in linux*) os="linux" ;; freebsd*) os="freebsd" ;; kfreebsd*-gnu) os="kfreebsd-gnu" ;; solaris*) os="solaris" ;; *) { echo "$as_me:$LINENO: WARNING: This is an untested and unsupported Operating System. Proceed at your own peril." >&5 echo "$as_me: WARNING: This is an untested and unsupported Operating System. Proceed at your own peril." >&2;} ;; esac osVersion="`getOsVersion`" if test "$with_kernel_modules" = "yes"; then case "$os" in linux) if test "$osVersion" -lt 206009; then { { echo "$as_me:$LINENO: error: Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers." >&5 echo "$as_me: error: Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers." >&2;} { (exit 1); exit 1; }; } fi if test ! -d "$LINUXDIR/kernel/"; then { { echo "$as_me:$LINENO: error: $LINUXDIR/kernel does not exist" >&5 echo "$as_me: error: $LINUXDIR/kernel does not exist" >&2;} { (exit 1); exit 1; }; } fi LINUXINCLUDE="$LINUXDIR/build/include" if test ! -d "$LINUXINCLUDE"; then { { echo "$as_me:$LINENO: error: Can't find include dir under $LINUXDIR" >&5 echo "$as_me: error: Can't find include dir under $LINUXDIR" >&2;} { (exit 1); exit 1; }; } fi ;; freebsd) freebsd_sysdir=/usr/src/sys if test -n "$SYSDIR"; then freebsd_sysdir="$SYSDIR" fi if test ! -f "$freebsd_sysdir/conf/kmod.mk"; then { { echo "$as_me:$LINENO: error: FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules." >&5 echo "$as_me: error: FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules." >&2;} { (exit 1); exit 1; }; } fi ;; esac fi # Arguments for disabling individual open-vm-tools features or libraries. # Check whether --enable-multimon was given. if test "${enable_multimon+set}" = set; then enableval=$enable_multimon; enable_multimon="$enableval" else enable_multimon="yes" fi # Check whether --with-gtk2 was given. if test "${with_gtk2+set}" = set; then withval=$with_gtk2; with_gtk2="$withval" else with_gtk2="yes" fi # Check whether --with-gtkmm was given. if test "${with_gtkmm+set}" = set; then withval=$with_gtkmm; with_gtkmm="$withval" else with_gtkmm="yes" fi # Check whether --enable-docs was given. if test "${enable_docs+set}" = set; then enableval=$enable_docs; enable_docs="$enableval" else enable_docs="yes" fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then enableval=$enable_tests; enable_tests="$enableval" else enable_tests="auto" fi am__api_version='1.10' # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 -f 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 { echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if 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 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='open-vm-tools' VERSION='10.0.7' 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-"\$(SHELL) $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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(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 -' ### ### Constants ### # These need to be declared after initialization. # Some of our macro call-sites require changes to # CPPFLAGS/CFLAGS/LDFLAGS. In such places, we save the original value # of CPPFLAGS/CFLAGS/LDFLAGS before the macro call and restore it when # the call is done. We must perform this save at each macro site, # because CPPFLAGS/CFLAGS/LDFLAGS may change over the course of # configuration. # # CPPFLAGS is intended for preprocessor options (-D and -I mainly) # CFLAGS is intended for compiler options (-O, -f, -W, and so forth) CPPFLAGS="$CPPFLAGS -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS" ### ### Programs ### # C preprocessor and compiler. 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 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'` # # List of possible output files, starting from the most likely. # The algorithm is not robust to junk in `.', hence go to wildcards (a.*) # only as a last resort. b.out is created by i960 compilers. ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' # # The IRIX 6 linker writes into existing files which may not be # executable, retaining their permissions. Remove them first so a # subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then 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 # Check that 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' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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_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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag 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 ISO C89" >&5 echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=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 -std 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 -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 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 for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6; } ;; xno) { echo "$as_me:$LINENO: result: unsupported" >&5 echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 # C++ compiler. Note that unlike AC_PROG_CC, this call does not trigger an # error if no C++ compiler was found; it'll just set the variable CXX to 'g++'. ac_ext=cpp 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 -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 g++ c++ gpp aCC CC cxx cc++ cl.exe 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi 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` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { 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 ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag 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 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 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/conftst1.h sub/conftest.Po > /dev/null 2>&1 && 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 # This allows features like per-target compiler flags. I.e., you can compile # one copy of the same sources twice with different flags. (See lib/guestApp # for an example.) if test "x$CC" != xcc; then { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } else { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_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. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { 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; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi # Needed for the various install and uninstall hooks. # 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. 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 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 "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed { 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 for a thread-safe mkdir -p" >&5 echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { echo "$as_me:$LINENO: result: $MKDIR_P" >&5 echo "${ECHO_T}$MKDIR_P" >&6; } # Needed for creating the archives in lib/ and the shared libraries. case `pwd` in *\ * | *\ *) { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. 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 delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { echo "$as_me:$LINENO: checking how to print strings" >&5 echo $ECHO_N "checking how to print strings... $ECHO_C" >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { echo "$as_me:$LINENO: result: printf" >&5 echo "${ECHO_T}printf" >&6; } ;; print*) { echo "$as_me:$LINENO: result: print -r" >&5 echo "${ECHO_T}print -r" >&6; } ;; *) { echo "$as_me:$LINENO: result: cat" >&5 echo "${ECHO_T}cat" >&6; } ;; esac { 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 "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" | sed 99q >conftest.sed $as_unset ac_script || ac_script= # Extract the first word of "sed gsed" to use in msg output if test -z "$SED"; then set dummy sed gsed; ac_prog_name=$2 if test "${ac_cv_path_SED+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST 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_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS fi SED="$ac_cv_path_SED" if test -z "$SED"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in \$PATH" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 echo "${ECHO_T}$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Extract the first word of "grep ggrep" to use in msg output if test -z "$GREP"; then set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS fi GREP="$ac_cv_path_GREP" if test -z "$GREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_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_path_EGREP="$GREP -E" else # Extract the first word of "egrep" to use in msg output if test -z "$EGREP"; then set dummy egrep; ac_prog_name=$2 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS fi EGREP="$ac_cv_path_EGREP" if test -z "$EGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { echo "$as_me:$LINENO: checking for fgrep" >&5 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6; } if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else # Extract the first word of "fgrep" to use in msg output if test -z "$FGREP"; then set dummy fgrep; ac_prog_name=$2 if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS fi FGREP="$ac_cv_path_FGREP" if test -z "$FGREP"; then { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-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 BSD- or MS-compatible name lister (nm)" >&5 echo $ECHO_N "checking for BSD- or MS-compatible name lister (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 : ${lt_cv_path_NM=no} fi fi { echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 echo "${ECHO_T}$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" 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_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { echo "$as_me:$LINENO: result: $DUMPBIN" >&5 echo "${ECHO_T}$DUMPBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" 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_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 echo "${ECHO_T}$ac_ct_DUMPBIN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6; } if test "${lt_cv_nm_interface+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 echo "${ECHO_T}$lt_cv_nm_interface" >&6; } # 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* | cegcc*) # 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; ;; mint*) # On MiNT this can take a long time and run out of memory. 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 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; 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 ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then 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` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # 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. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` 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` fi ;; 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 max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { echo "$as_me:$LINENO: result: $xsi_shell" >&5 echo "${ECHO_T}$xsi_shell" >&6; } { echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { echo "$as_me:$LINENO: result: $lt_shell_append" >&5 echo "${ECHO_T}$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { echo "$as_me:$LINENO: checking how to convert $build file names to $host format" >&5 echo $ECHO_N "checking how to convert $build file names to $host format... $ECHO_C" >&6; } if test "${lt_cv_to_host_file_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { echo "$as_me:$LINENO: result: $lt_cv_to_host_file_cmd" >&5 echo "${ECHO_T}$lt_cv_to_host_file_cmd" >&6; } { echo "$as_me:$LINENO: checking how to convert $build file names to toolchain format" >&5 echo $ECHO_N "checking how to convert $build file names to toolchain format... $ECHO_C" >&6; } if test "${lt_cv_to_tool_file_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { echo "$as_me:$LINENO: result: $lt_cv_to_tool_file_cmd" >&5 echo "${ECHO_T}$lt_cv_to_tool_file_cmd" >&6; } { 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 cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { echo "$as_me:$LINENO: result: $OBJDUMP" >&5 echo "${ECHO_T}$OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; 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_OBJDUMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 echo "${ECHO_T}$ac_ct_OBJDUMP" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 echo $ECHO_N "checking how to recognize 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 aix[4-9]*) 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', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | 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 ;; haiku*) 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])(-bit)?( [LM]SB)? 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 ;; interix[3-9]*) # 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) 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=pass_all ;; 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 ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) 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 ;; tpf*) 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_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi 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 test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { echo "$as_me:$LINENO: result: $DLLTOOL" >&5 echo "${ECHO_T}$DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; 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_DLLTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 echo "${ECHO_T}$ac_ct_DLLTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { echo "$as_me:$LINENO: checking how to associate runtime and link libraries" >&5 echo $ECHO_N "checking how to associate runtime and link libraries... $ECHO_C" >&6; } if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { echo "$as_me:$LINENO: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 echo "${ECHO_T}$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar 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_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar 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_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS 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 test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { echo "$as_me:$LINENO: checking for archiver @FILE support" >&5 echo $ECHO_N "checking for archiver @FILE support... $ECHO_C" >&6; } if test "${lt_cv_ar_at_file+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ar_at_file=no 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { (eval echo "$as_me:$LINENO: \"$lt_ar_try\"") >&5 (eval $lt_ar_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { (eval echo "$as_me:$LINENO: \"$lt_ar_try\"") >&5 (eval $lt_ar_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $lt_cv_ar_at_file" >&5 echo "${ECHO_T}$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 IFS=$as_save_IFS 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 if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' 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 \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # 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 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]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' 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 # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \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\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # 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 # Try without a prefix underscore, 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. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF 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 # 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 <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_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_globsym_save_LIBS CFLAGS=$lt_globsym_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 -rf 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 # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { echo "$as_me:$LINENO: checking for sysroot" >&5 echo $ECHO_N "checking for sysroot... $ECHO_C" >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { echo "$as_me:$LINENO: result: ${with_sysroot}" >&5 echo "${ECHO_T}${with_sysroot}" >&6; } { { echo "$as_me:$LINENO: error: The sysroot must be an absolute path." >&5 echo "$as_me: error: The sysroot must be an absolute path." >&2;} { (exit 1); exit 1; }; } ;; esac { echo "$as_me:$LINENO: result: ${lt_sysroot:-no}" >&5 echo "${ECHO_T}${lt_sysroot:-no}" >&6; } # Check whether --enable-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 '$LINENO' "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-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; 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-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 ;; *-*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*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { echo "$as_me:$LINENO: result: $MANIFEST_TOOL" >&5 echo "${ECHO_T}$MANIFEST_TOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; 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_MANIFEST_TOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_MANIFEST_TOOL" >&5 echo "${ECHO_T}$ac_ct_MANIFEST_TOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { echo "$as_me:$LINENO: checking if $MANIFEST_TOOL is a manifest tool" >&5 echo $ECHO_N "checking if $MANIFEST_TOOL is a manifest tool... $ECHO_C" >&6; } if test "${lt_cv_path_mainfest_tool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_path_mainfest_tool" >&5 echo "${ECHO_T}$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 echo "${ECHO_T}$DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; 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_DSYMUTIL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { echo "$as_me:$LINENO: result: $NMEDIT" >&5 echo "${ECHO_T}$NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; 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_NMEDIT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; 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_LIPO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { echo "$as_me:$LINENO: result: $LIPO" >&5 echo "${ECHO_T}$LIPO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; 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_LIPO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 echo "${ECHO_T}$ac_ct_LIPO" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; 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_OTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { echo "$as_me:$LINENO: result: $OTOOL" >&5 echo "${ECHO_T}$OTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; 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_OTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 echo "${ECHO_T}$ac_ct_OTOOL" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { echo "$as_me:$LINENO: result: $OTOOL64" >&5 echo "${ECHO_T}$OTOOL64" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; 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_OTOOL64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 echo "${ECHO_T}$ac_ct_OTOOL64" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_ld_exported_symbols_list=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } { echo "$as_me:$LINENO: checking for -force_load linker flag" >&5 echo $ECHO_N "checking for -force_load linker flag... $ECHO_C" >&6; } if test "${lt_cv_ld_force_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { echo "$as_me:$LINENO: result: $lt_cv_ld_force_load" >&5 echo "${ECHO_T}$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac { 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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 #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)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 core.conftest.* 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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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` { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_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. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-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 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 --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-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 # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST 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 cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF 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 # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file 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 <<_LT_EOF 1>&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 _LT_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 <<_LT_EOF 1>&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 _LT_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 # Use C for the default configuration in the libtool script 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;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # 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 the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$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 echo "$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 -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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= 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries 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' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # 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 ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; 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 ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # 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' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # 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' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) 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 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 { 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 "${lt_cv_prog_compiler_pic+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # 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_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works=yes fi fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_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 # # 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_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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; } { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # 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_|_GLOBAL__F[ID]_.*' # 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. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # 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 ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = 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>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [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 aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, 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 install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; 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* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' 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 ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' 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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # 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; func_echo_all \"$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' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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 '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; 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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd* | netbsdelf*-gnu) 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 <<_LT_EOF 1>&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. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ;; *) # 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. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' 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 ;; 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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $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 ;; aix[4-9]*) 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 # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". 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") || (\$ 2 == "W")) && (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].*|aix[5-9]*) 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_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' 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 : 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 link_all_deplibs=no 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 export_dynamic_flag_spec='${wl}-bexpall' # 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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath_+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ 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 func_echo_all "${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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath_+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ 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' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) 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 ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # 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. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper 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 `func_echo_all "$deplibs" | $SED '\''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' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=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* | dragonfly*) archive_cmds='$CC -shared $pic_flag -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 $pic_flag ${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 && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${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 hardcode_direct_absolute=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 && test "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${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' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { echo "$as_me:$LINENO: checking if $CC understands -b" >&5 echo $ECHO_N "checking if $CC understands -b... $ECHO_C" >&6; } if test "${lt_cv_prog_compiler__b+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler__b" >&5 echo "${ECHO_T}$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${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 ;; 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_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { echo "$as_me:$LINENO: checking whether the $host_os linker accepts -exported_symbol" >&5 echo $ECHO_N "checking whether the $host_os linker accepts -exported_symbol... $ECHO_C" >&6; } if test "${lt_cv_irix_exported_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_cv_irix_exported_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_irix_exported_symbol" >&5 echo "${ECHO_T}$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd* | netbsdelf*-gnu) 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 ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes 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 else ld_shlibs=no 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' 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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-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; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_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 archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${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 $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) 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' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $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 -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac 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 and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; 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* | sco3.2v5.0.[024]*) 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='${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,$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 ;; 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 if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { echo "$as_me:$LINENO: result: $ld_shlibs" >&5 echo "${ECHO_T}$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # 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; } if test "${lt_cv_archive_cmds_need_lc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $RM conftest* echo "$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 lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # 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. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi 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" 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 # correct to gnu/linux during the next big refactor 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' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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}${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`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then lt_cv_shlibpath_overrides_runpath=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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-existent 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_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 || test "$inherit_rpath" = yes; 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 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* | cegcc*) 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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="-ldld" 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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="-ldld" 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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_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 <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #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 /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 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; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_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 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" old_striplib="$STRIP -S" { 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 # 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 ;; aix[4-9]*) 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; } 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" 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=cpp 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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 nonexistent 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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=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 else _lt_caught_CXX_error=yes fi ac_ext=cpp 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= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # 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 echo "$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 echo "$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 -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS 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++"} CFLAGS=$CXXFLAGS 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 "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when 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 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 $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -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 -v "^Configured with:" | $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 ;; aix[4-9]*) 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].*|aix[5-9]*) 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_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' 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 : 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 export_dynamic_flag_spec_CXX='${wl}-bexpall' # 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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath__CXX+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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 func_echo_all "${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. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if test "${lt_cv_aix_libpath__CXX+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 conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX 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' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi 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* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' 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 ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then 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${_lt_dsymutil}" archive_expsym_cmds_CXX="sed '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${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no 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 ;; freebsd2.*) # 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* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; 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) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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*) ;; *) 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_direct_absolute_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; func_echo_all "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${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 ;; interix[3-9]*) 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" && func_echo_all "-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 $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${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=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) 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; func_echo_all "$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* | ecpc* ) # 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* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols 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' ;; esac 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; func_echo_all \"$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=`func_echo_all "$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; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 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='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # 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' ;; esac ;; 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::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes 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=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | 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. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) 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" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) 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" && func_echo_all "-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' ;; esac 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=`func_echo_all "$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; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac 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 -v "^Configured with:" | $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* | sunCC*) # 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 compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # 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 $pic_flag -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 $pic_flag -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 -v "^Configured with:" | $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 -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac 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. 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='${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,$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' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) 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 ;; 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" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # 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= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac 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 # 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 for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${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 fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} 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 prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$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 CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # 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= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # 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. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # 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*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # 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' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries 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= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # 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 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # 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_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 ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # 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' ;; 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* | 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* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # 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' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; 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* | sunCC*) # 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 ;; 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 ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac 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 { 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 "${lt_cv_prog_compiler_pic_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # 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_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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_pic_works_CXX=yes fi fi $RM conftest* fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_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 # # 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_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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; } { 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 echo "$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:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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 .. $RM -r 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' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # 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 # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". 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") || (\$ 2 == "W")) && (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* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; linux* | k*bsd*-gnu | gnu*) link_all_deplibs_CXX=no ;; *) 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 with_gnu_ld_CXX=$with_gnu_ld # # 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; } if test "${lt_cv_archive_cmds_need_lc_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else $RM conftest* echo "$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 lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_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* fi { echo "$as_me:$LINENO: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 echo "${ECHO_T}$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; 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" 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 # correct to gnu/linux during the next big refactor 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' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) 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=`func_echo_all "$lib" | $SED '\''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' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor 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* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc 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~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' 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}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; 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 dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. 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 # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # 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' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # 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}${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`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; 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[23].*) 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 ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor 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 ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" 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=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' 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' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor 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 # Some binutils ld are patched to set DT_RUNPATH if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then lt_cv_shlibpath_overrides_runpath=yes fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # 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 # 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/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $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' ;; netbsdelf*-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='NetBSD ld.elf_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 # correct to gnu/linux during the next big refactor 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=qnx 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='ldqnx.so' ;; 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" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor 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 # correct to gnu/linux during the next big refactor 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 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 # correct to gnu/linux during the next big refactor 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 shlibpath_overrides_runpath=yes 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' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' 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' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor 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 if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" 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-existent 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_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 || test "$inherit_rpath_CXX" = yes; 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 fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC 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 fi # test "$_lt_caught_CXX_error" != 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 ac_config_commands="$ac_config_commands libtool" # Only expand once: if test "$ac_cv_prog_AR" = false; then { { echo "$as_me:$LINENO: error: The 'ar' utility was not found. Please put ar on the path." >&5 echo "$as_me: error: The 'ar' utility was not found. Please put ar on the path." >&2;} { (exit 1); exit 1; }; } fi # We use pkg-config to set up the cflags and libs for gtk. # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; 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_HAVE_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$HAVE_PKG_CONFIG"; then ac_cv_prog_HAVE_PKG_CONFIG="$HAVE_PKG_CONFIG" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_HAVE_PKG_CONFIG="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_HAVE_PKG_CONFIG" && ac_cv_prog_HAVE_PKG_CONFIG="no" fi fi HAVE_PKG_CONFIG=$ac_cv_prog_HAVE_PKG_CONFIG if test -n "$HAVE_PKG_CONFIG"; then { echo "$as_me:$LINENO: result: $HAVE_PKG_CONFIG" >&5 echo "${ECHO_T}$HAVE_PKG_CONFIG" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$GCC" != "yes"; then { { echo "$as_me:$LINENO: error: Only GCC is currently supported. Please put gcc in the path." >&5 echo "$as_me: error: Only GCC is currently supported. Please put gcc in the path." >&2;} { (exit 1); exit 1; }; } fi ### ### Libraries ### { echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5 echo "$as_me: error: Cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" 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 () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" 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 { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: neither works" >&5 echo "${ECHO_T}neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6; } if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6; } if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6; } if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6; } if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { echo "$as_me:$LINENO: checking for remove" >&5 echo $ECHO_N "checking for remove... $ECHO_C" >&6; } if test "${ac_cv_func_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 echo "${ECHO_T}$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { echo "$as_me:$LINENO: checking for remove in -lposix" >&5 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_posix_remove=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6; } if test $ac_cv_lib_posix_remove = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { echo "$as_me:$LINENO: checking for shmat" >&5 echo $ECHO_N "checking for shmat... $ECHO_C" >&6; } if test "${ac_cv_func_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_func_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 echo "${ECHO_T}$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ipc_shmat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6; } if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_ICE_IceConnectionNumber=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi # # Check for libintl.h. When configuring using "--without-x", /usr/local/include # may not be added to the include path, so code that use glib's i18n functions # would fail to compile because it can't find libintl.h. # if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 libintl.h presence" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then : else have_libintl=no fi if test "$have_libintl" = "no"; then unset ac_cv_header_libintl_h CPPFLAGS="$CPPFLAGS -I/usr/local/include" if test "${ac_cv_header_libintl_h+set}" = set; then { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 libintl.h presence" >&5 echo $ECHO_N "checking libintl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6; } if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6; } fi if test $ac_cv_header_libintl_h = yes; then : else { { echo "$as_me:$LINENO: error: libintl.h not found. Make sure you have the gettext headers installed." >&5 echo "$as_me: error: libintl.h not found. Make sure you have the gettext headers installed." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-deploypkg was given. if test "${enable_deploypkg+set}" = set; then enableval=$enable_deploypkg; else enable_deploypkg=yes fi if test "$enable_deploypkg" = "yes"; then if test -z "mspack"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "MSPACK"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_MSPACK_CPPFLAGS}" || test -n "${CUSTOM_MSPACK_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_MSPACK_LIBS} -lmspack" if test -n "mspack.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_MSPACK_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_mspack_h+set}" = set; then { echo "$as_me:$LINENO: checking for mspack.h" >&5 echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 echo "${ECHO_T}$ac_cv_header_mspack_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking mspack.h usability" >&5 echo $ECHO_N "checking mspack.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 mspack.h presence" >&5 echo $ECHO_N "checking mspack.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: mspack.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: mspack.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: mspack.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: mspack.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: mspack.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: mspack.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: mspack.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for mspack.h" >&5 echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_mspack_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 echo "${ECHO_T}$ac_cv_header_mspack_h" >&6; } fi if test $ac_cv_header_mspack_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_mspack_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lmspack" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lmspack... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmspack $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then MSPACK_CPPFLAGS="${CUSTOM_MSPACK_CPPFLAGS}" MSPACK_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "libmspack"; then if test -n "0.0.20040308alpha"; then { echo "$as_me:$LINENO: checking for libmspack >= 0.0.20040308alpha (via pkg-config)" >&5 echo $ECHO_N "checking for libmspack >= 0.0.20040308alpha (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libmspack >= 0.0.20040308alpha'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for libmspack (via pkg-config)" >&5 echo $ECHO_N "checking for libmspack (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libmspack'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags libmspack`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs libmspack`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } MSPACK_CPPFLAGS="$ac_vmw_cppflags" MSPACK_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then MSPACK_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" MSPACK_LIBS="`$ac_vmw_lib_cfg --ldflags`" else MSPACK_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" MSPACK_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: mspack >= 0.0.20040308alpha is required." >&5 echo "$as_me: error: mspack >= 0.0.20040308alpha is required." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-grabbitmqproxy was given. if test "${enable_grabbitmqproxy+set}" = set; then enableval=$enable_grabbitmqproxy; else enable_grabbitmqproxy=yes fi # # Check for glib 2.6.14 or greater. # if test -z "glib-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GLIB2"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GLIB2_CPPFLAGS}" || test -n "${CUSTOM_GLIB2_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GLIB2_LIBS} -lglib-2.0" if test -n "glib.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GLIB2_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_glib_h+set}" = set; then { echo "$as_me:$LINENO: checking for glib.h" >&5 echo $ECHO_N "checking for glib.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking glib.h usability" >&5 echo $ECHO_N "checking glib.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 glib.h presence" >&5 echo $ECHO_N "checking glib.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: glib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: glib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: glib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: glib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: glib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: glib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: glib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: glib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: glib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: glib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: glib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for glib.h" >&5 echo $ECHO_N "checking for glib.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_glib_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_h" >&6; } fi if test $ac_cv_header_glib_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "g_key_file_new"; then ac_vmw_function=g_key_file_new else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_glib-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lglib-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lglib-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lglib-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GLIB2_CPPFLAGS="${CUSTOM_GLIB2_CPPFLAGS}" GLIB2_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "glib-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for glib-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for glib-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'glib-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for glib-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for glib-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'glib-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags glib-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs glib-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GLIB2_CPPFLAGS="$ac_vmw_cppflags" GLIB2_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GLIB2_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GLIB2_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GLIB2_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GLIB2_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: glib2 >= 2.14.0 is required." >&5 echo "$as_me: error: glib2 >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gmodule-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GMODULE"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GMODULE_CPPFLAGS}" || test -n "${CUSTOM_GMODULE_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GMODULE_LIBS} -lgmodule-2.0" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GMODULE_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gmodule-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgmodule-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgmodule-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgmodule-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GMODULE_CPPFLAGS="${CUSTOM_GMODULE_CPPFLAGS}" GMODULE_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gmodule-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gmodule-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gmodule-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gmodule-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gmodule-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gmodule-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gmodule-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gmodule-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gmodule-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GMODULE_CPPFLAGS="$ac_vmw_cppflags" GMODULE_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GMODULE_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GMODULE_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GMODULE_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GMODULE_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: gmodule >= 2.14.0 is required." >&5 echo "$as_me: error: gmodule >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gobject-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GOBJECT"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GOBJECT_CPPFLAGS}" || test -n "${CUSTOM_GOBJECT_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GOBJECT_LIBS} -lgobject-2.0" if test -n "glib-object.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GOBJECT_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_glib_object_h+set}" = set; then { echo "$as_me:$LINENO: checking for glib-object.h" >&5 echo $ECHO_N "checking for glib-object.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_object_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_object_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_object_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking glib-object.h usability" >&5 echo $ECHO_N "checking glib-object.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 glib-object.h presence" >&5 echo $ECHO_N "checking glib-object.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: glib-object.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: glib-object.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: glib-object.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: glib-object.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: glib-object.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: glib-object.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: glib-object.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: glib-object.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: glib-object.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: glib-object.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: glib-object.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for glib-object.h" >&5 echo $ECHO_N "checking for glib-object.h... $ECHO_C" >&6; } if test "${ac_cv_header_glib_object_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_glib_object_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_glib_object_h" >&5 echo "${ECHO_T}$ac_cv_header_glib_object_h" >&6; } fi if test $ac_cv_header_glib_object_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gobject-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgobject-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgobject-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgobject-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GOBJECT_CPPFLAGS="${CUSTOM_GOBJECT_CPPFLAGS}" GOBJECT_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gobject-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gobject-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gobject-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gobject-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gobject-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gobject-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gobject-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gobject-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gobject-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GOBJECT_CPPFLAGS="$ac_vmw_cppflags" GOBJECT_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GOBJECT_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GOBJECT_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GOBJECT_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GOBJECT_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: gobject >= 2.14.0 is required." >&5 echo "$as_me: error: gobject >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi if test -z "gthread-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTHREAD"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTHREAD_CPPFLAGS}" || test -n "${CUSTOM_GTHREAD_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTHREAD_LIBS} -lgthread-2.0" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTHREAD_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gthread-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgthread-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgthread-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgthread-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTHREAD_CPPFLAGS="${CUSTOM_GTHREAD_CPPFLAGS}" GTHREAD_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gthread-2.0"; then if test -n "2.14.0"; then { echo "$as_me:$LINENO: checking for gthread-2.0 >= 2.14.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gthread-2.0 >= 2.14.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gthread-2.0 >= 2.14.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gthread-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gthread-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gthread-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gthread-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gthread-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTHREAD_CPPFLAGS="$ac_vmw_cppflags" GTHREAD_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTHREAD_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTHREAD_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTHREAD_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTHREAD_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: glib >= 2.14.0 is required." >&5 echo "$as_me: error: glib >= 2.14.0 is required." >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "glib-genmarshal", so it can be a program name with args. set dummy glib-genmarshal; 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_have_genmarshal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_genmarshal"; then ac_cv_prog_have_genmarshal="$have_genmarshal" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_genmarshal="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_genmarshal" && ac_cv_prog_have_genmarshal="no" fi fi have_genmarshal=$ac_cv_prog_have_genmarshal if test -n "$have_genmarshal"; then { echo "$as_me:$LINENO: result: $have_genmarshal" >&5 echo "${ECHO_T}$have_genmarshal" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$have_genmarshal" != "yes"; then { { echo "$as_me:$LINENO: error: glib-genmarshal is required; make sure it's available in your path." >&5 echo "$as_me: error: glib-genmarshal is required; make sure it's available in your path." >&2;} { (exit 1); exit 1; }; } fi # # Check for fuse. # if test -z "fuse"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "FUSE"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_FUSE_CPPFLAGS}" || test -n "${CUSTOM_FUSE_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_FUSE_LIBS} -lfuse" if test -n "fuse.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_FUSE_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_fuse_h+set}" = set; then { echo "$as_me:$LINENO: checking for fuse.h" >&5 echo $ECHO_N "checking for fuse.h... $ECHO_C" >&6; } if test "${ac_cv_header_fuse_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_fuse_h" >&5 echo "${ECHO_T}$ac_cv_header_fuse_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking fuse.h usability" >&5 echo $ECHO_N "checking fuse.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 fuse.h presence" >&5 echo $ECHO_N "checking fuse.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: fuse.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: fuse.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: fuse.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: fuse.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: fuse.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: fuse.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: fuse.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: fuse.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: fuse.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: fuse.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: fuse.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for fuse.h" >&5 echo $ECHO_N "checking for fuse.h... $ECHO_C" >&6; } if test "${ac_cv_header_fuse_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_fuse_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_fuse_h" >&5 echo "${ECHO_T}$ac_cv_header_fuse_h" >&6; } fi if test $ac_cv_header_fuse_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "fuse_main"; then ac_vmw_function=fuse_main else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_fuse_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lfuse" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lfuse... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfuse $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then FUSE_CPPFLAGS="${CUSTOM_FUSE_CPPFLAGS}" FUSE_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "fuse"; then if test -n ""; then { echo "$as_me:$LINENO: checking for fuse >= (via pkg-config)" >&5 echo $ECHO_N "checking for fuse >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'fuse >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for fuse (via pkg-config)" >&5 echo $ECHO_N "checking for fuse (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'fuse'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags fuse`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs fuse`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } FUSE_CPPFLAGS="$ac_vmw_cppflags" FUSE_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then FUSE_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" FUSE_LIBS="`$ac_vmw_lib_cfg --ldflags`" else FUSE_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" FUSE_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_fuse=yes else true have_fuse=no; { echo "$as_me:$LINENO: WARNING: Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled." >&5 echo "$as_me: WARNING: Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled." >&2;} fi # # Check for PAM. # # Check whether --with-pam was given. if test "${with_pam+set}" = set; then withval=$with_pam; else with_pam=yes fi if test "$with_pam" = "yes"; then if test -z "$CUSTOM_PAM_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_PAM_CPPFLAGS="-I/usr/local/include" else CUSTOM_PAM_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_PAM_CPPFLAGS="${CUSTOM_PAM_CPPFLAGS}/" fi fi if test -z "pam"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PAM"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PAM_CPPFLAGS}" || test -n "${CUSTOM_PAM_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PAM_LIBS} -lpam" if test -n "security/pam_appl.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PAM_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_security_pam_appl_h+set}" = set; then { echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 echo $ECHO_N "checking security/pam_appl.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 security/pam_appl.h presence" >&5 echo $ECHO_N "checking security/pam_appl.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: security/pam_appl.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_security_pam_appl_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6; } fi if test $ac_cv_header_security_pam_appl_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "pam_start"; then ac_vmw_function=pam_start else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_pam_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lpam" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lpam... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PAM_CPPFLAGS="${CUSTOM_PAM_CPPFLAGS}" PAM_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PAM_CPPFLAGS="$ac_vmw_cppflags" PAM_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PAM_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PAM_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PAM_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PAM_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true PAM_CPPFLAGS="$PAM_CPPFLAGS -DUSE_PAM" else true feature="" if test -z "$feature"; then feature="PAM" fi { { echo "$as_me:$LINENO: error: Cannot find PAM library. Please configure without $feature (using --without-pam), or install the PAM libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find PAM library. Please configure without $feature (using --without-pam), or install the PAM libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # Check whether --enable-vgauth was given. if test "${enable_vgauth+set}" = set; then enableval=$enable_vgauth; else enable_vgauth=yes fi # # Check for openssl, xerces-c and xml-security-c # # Check whether --with-ssl was given. if test "${with_ssl+set}" = set; then withval=$with_ssl; enable_grabbitmqproxy=no enable_vgauth=no else with_ssl=yes fi # Check whether --with-xmlsecurity was given. if test "${with_xmlsecurity+set}" = set; then withval=$with_xmlsecurity; enable_vgauth=no else with_xmlsecurity=yes fi # Check whether --with-xerces was given. if test "${with_xerces+set}" = set; then withval=$with_xerces; enable_vgauth=no else with_xerces=yes fi if test "$enable_vgauth" = "yes" -o "$enable_grabbitmqproxy" = "yes"; then if test -z "$CUSTOM_SSL_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_SSL_CPPFLAGS="-I/usr/local/include" else CUSTOM_SSL_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_SSL_CPPFLAGS="${CUSTOM_SSL_CPPFLAGS}/" fi fi if test -z "ssl"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "SSL"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_SSL_CPPFLAGS}" || test -n "${CUSTOM_SSL_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_SSL_LIBS} -lssl" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_SSL_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_ssl_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lssl" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lssl... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lssl $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then SSL_CPPFLAGS="${CUSTOM_SSL_CPPFLAGS}" SSL_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } SSL_CPPFLAGS="$ac_vmw_cppflags" SSL_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then SSL_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" SSL_LIBS="`$ac_vmw_lib_cfg --ldflags`" else SSL_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" SSL_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="SSL" fi { { echo "$as_me:$LINENO: error: Cannot find SSL library. Please configure without $feature (using --without-ssl), or install the SSL libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find SSL library. Please configure without $feature (using --without-ssl), or install the SSL libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi if test "$enable_vgauth" = "yes"; then CPPFLAGS="$CPPFLAGS -DUSE_VGAUTH" if test -z "$CUSTOM_XERCES_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_XERCES_CPPFLAGS="-I/usr/local/include" else CUSTOM_XERCES_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_XERCES_CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS}/" fi fi if test -z "xerces-c"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "XERCES"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_XERCES_CPPFLAGS}" || test -n "${CUSTOM_XERCES_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_XERCES_LIBS} -lxerces-c" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_xerces-c_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lxerces-c" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lxerces-c... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxerces-c $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then XERCES_CPPFLAGS="${CUSTOM_XERCES_CPPFLAGS}" XERCES_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } XERCES_CPPFLAGS="$ac_vmw_cppflags" XERCES_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then XERCES_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" XERCES_LIBS="`$ac_vmw_lib_cfg --ldflags`" else XERCES_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" XERCES_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="XERCES" fi { { echo "$as_me:$LINENO: error: Cannot find XERCES library. Please configure without $feature (using --without-xerces-c), or install the XERCES libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find XERCES library. Please configure without $feature (using --without-xerces-c), or install the XERCES libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi if test -z "$CUSTOM_XMLSECURITY_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_XMLSECURITY_CPPFLAGS="-I/usr/local/include" else CUSTOM_XMLSECURITY_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_XMLSECURITY_CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS}/" fi fi if test -z "xml-security-c"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "XMLSECURITY"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_XMLSECURITY_CPPFLAGS}" || test -n "${CUSTOM_XMLSECURITY_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_XMLSECURITY_LIBS} -lxml-security-c" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_xml-security-c_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lxml-security-c" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lxml-security-c... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxml-security-c $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then XMLSECURITY_CPPFLAGS="${CUSTOM_XMLSECURITY_CPPFLAGS}" XMLSECURITY_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } XMLSECURITY_CPPFLAGS="$ac_vmw_cppflags" XMLSECURITY_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then XMLSECURITY_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" XMLSECURITY_LIBS="`$ac_vmw_lib_cfg --ldflags`" else XMLSECURITY_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" XMLSECURITY_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true feature="" if test -z "$feature"; then feature="XMLSECURITY" fi { { echo "$as_me:$LINENO: error: Cannot find XMLSECURITY library. Please configure without $feature (using --without-xml-security-c), or install the XMLSECURITY libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find XMLSECURITY library. Please configure without $feature (using --without-xml-security-c), or install the XMLSECURITY libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # # Check for CUnit and disable test code if not available. # if test "$enable_tests" = "auto" -o "$enable_tests" = "yes"; then if test -z "$CUSTOM_CUNIT_CPPFLAGS"; then if test "$os" = freebsd; then CUSTOM_CUNIT_CPPFLAGS="-I/usr/local/include" else CUSTOM_CUNIT_CPPFLAGS="-I/usr/include" fi if test -n ""; then CUSTOM_CUNIT_CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS}/" fi fi if test -z "cunit"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "CUNIT"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_CUNIT_CPPFLAGS}" || test -n "${CUSTOM_CUNIT_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_CUNIT_LIBS} -lcunit" if test -n "CUnit/CUnit.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then { echo "$as_me:$LINENO: checking for CUnit/CUnit.h" >&5 echo $ECHO_N "checking for CUnit/CUnit.h... $ECHO_C" >&6; } if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_CUnit_CUnit_h" >&5 echo "${ECHO_T}$ac_cv_header_CUnit_CUnit_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking CUnit/CUnit.h usability" >&5 echo $ECHO_N "checking CUnit/CUnit.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 CUnit/CUnit.h presence" >&5 echo $ECHO_N "checking CUnit/CUnit.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: CUnit/CUnit.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: CUnit/CUnit.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: CUnit/CUnit.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for CUnit/CUnit.h" >&5 echo $ECHO_N "checking for CUnit/CUnit.h... $ECHO_C" >&6; } if test "${ac_cv_header_CUnit_CUnit_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_CUnit_CUnit_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_CUnit_CUnit_h" >&5 echo "${ECHO_T}$ac_cv_header_CUnit_CUnit_h" >&6; } fi if test $ac_cv_header_CUnit_CUnit_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "CU_initialize_registry"; then ac_vmw_function=CU_initialize_registry else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_cunit_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lcunit" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lcunit... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcunit $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then CUNIT_CPPFLAGS="${CUSTOM_CUNIT_CPPFLAGS}" CUNIT_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } CUNIT_CPPFLAGS="$ac_vmw_cppflags" CUNIT_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then CUNIT_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" CUNIT_LIBS="`$ac_vmw_lib_cfg --ldflags`" else CUNIT_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" CUNIT_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_cunit=yes else true have_cunit=no fi if test "$have_cunit" = "no"; then if test "$enable_tests" = "yes"; then feature="" if test -z "$feature"; then feature="CUNIT" fi { { echo "$as_me:$LINENO: error: Cannot find CUNIT library. Please configure without $feature (using --without-cunit), or install the CUNIT libraries and devel package(s)." >&5 echo "$as_me: error: Cannot find CUNIT library. Please configure without $feature (using --without-cunit), or install the CUNIT libraries and devel package(s)." >&2;} { (exit 1); exit 1; }; } else { echo "$as_me:$LINENO: WARNING: CUnit not found, tests won't be compiled." >&5 echo "$as_me: WARNING: CUnit not found, tests won't be compiled." >&2;} fi fi fi # If the user explicitly disables X11, then don't try to detect the X-related libraries if test "$have_x" = "disabled"; then enable_multimon="no" elif test "$have_x" != "yes"; then { { echo "$as_me:$LINENO: error: The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s)." >&5 echo "$as_me: error: The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s)." >&2;} { (exit 1); exit 1; }; } else CPPFLAGS="$CPPFLAGS $X_CFLAGS" COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" { echo "$as_me:$LINENO: checking for XeviQueryVersion in -lXext" >&5 echo $ECHO_N "checking for XeviQueryVersion in -lXext... $ECHO_C" >&6; } if test "${ac_cv_lib_Xext_XeviQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XeviQueryVersion (); int main () { return XeviQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xext_XeviQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XeviQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XeviQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xext_XeviQueryVersion" >&6; } if test $ac_cv_lib_Xext_XeviQueryVersion = yes; then COMMON_XLIBS="-lXext $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s)." >&5 echo "$as_me: error: libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for X11/extensions/extutil.h" >&5 echo $ECHO_N "checking for X11/extensions/extutil.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_extensions_extutil_h+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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_X11_extensions_extutil_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_X11_extensions_extutil_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_extutil_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_extensions_extutil_h" >&6; } if test $ac_cv_header_X11_extensions_extutil_h = yes; then : else { { echo "$as_me:$LINENO: error: X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x)." >&5 echo "$as_me: error: X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x)." >&2;} { (exit 1); exit 1; }; } fi if test "$enable_multimon" != "no"; then { echo "$as_me:$LINENO: checking for XineramaQueryVersion in -lXinerama" >&5 echo $ECHO_N "checking for XineramaQueryVersion in -lXinerama... $ECHO_C" >&6; } if test "${ac_cv_lib_Xinerama_XineramaQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XineramaQueryVersion (); int main () { return XineramaQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xinerama_XineramaQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xinerama_XineramaQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaQueryVersion" >&6; } if test $ac_cv_lib_Xinerama_XineramaQueryVersion = yes; then COMMON_XLIBS="-lXinerama $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s)." >&5 echo "$as_me: error: libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi { echo "$as_me:$LINENO: checking for XOpenDevice in -lXi" >&5 echo $ECHO_N "checking for XOpenDevice in -lXi... $ECHO_C" >&6; } if test "${ac_cv_lib_Xi_XOpenDevice+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXi $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDevice (); int main () { return XOpenDevice (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xi_XOpenDevice=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xi_XOpenDevice=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xi_XOpenDevice" >&5 echo "${ECHO_T}$ac_cv_lib_Xi_XOpenDevice" >&6; } if test $ac_cv_lib_Xi_XOpenDevice = yes; then COMMON_XLIBS="-lXi $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s)." >&5 echo "$as_me: error: libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 echo $ECHO_N "checking for XRenderQueryVersion in -lXrender... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRenderQueryVersion (); int main () { return XRenderQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrender_XRenderQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrender_XRenderQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryVersion" >&6; } if test $ac_cv_lib_Xrender_XRenderQueryVersion = yes; then COMMON_XLIBS="-lXrender $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s)." >&5 echo "$as_me: error: libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XRRQueryVersion in -lXrandr" >&5 echo $ECHO_N "checking for XRRQueryVersion in -lXrandr... $ECHO_C" >&6; } if test "${ac_cv_lib_Xrandr_XRRQueryVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XRRQueryVersion (); int main () { return XRRQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xrandr_XRRQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xrandr_XRRQueryVersion=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryVersion" >&5 echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRQueryVersion" >&6; } if test $ac_cv_lib_Xrandr_XRRQueryVersion = yes; then COMMON_XLIBS="-lXrandr $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s)." >&5 echo "$as_me: error: libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for XTestQueryExtension in -lXtst" >&5 echo $ECHO_N "checking for XTestQueryExtension in -lXtst... $ECHO_C" >&6; } if test "${ac_cv_lib_Xtst_XTestQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXtst $COMMON_XLIBS $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XTestQueryExtension (); int main () { return XTestQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xtst_XTestQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xtst_XTestQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xtst_XTestQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xtst_XTestQueryExtension" >&6; } if test $ac_cv_lib_Xtst_XTestQueryExtension = yes; then COMMON_XLIBS="-lXtst $COMMON_XLIBS" else { { echo "$as_me:$LINENO: error: libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s)." >&5 echo "$as_me: error: libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s)." >&2;} { (exit 1); exit 1; }; } fi { echo "$as_me:$LINENO: checking for SmcOpenConnection in -lSM" >&5 echo $ECHO_N "checking for SmcOpenConnection in -lSM... $ECHO_C" >&6; } if test "${ac_cv_lib_SM_SmcOpenConnection+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSM $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SmcOpenConnection (); int main () { return SmcOpenConnection (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_SM_SmcOpenConnection=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_SM_SmcOpenConnection=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_SM_SmcOpenConnection" >&5 echo "${ECHO_T}$ac_cv_lib_SM_SmcOpenConnection" >&6; } if test $ac_cv_lib_SM_SmcOpenConnection = yes; then XSM_LIBS="-lSM -lICE" && have_xsm_lib="yes" else -lICE fi for ac_header in X11/SM/SMlib.h X11/ICE/ICElib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 have_xsm_header="yes" fi done if test "$have_xsm_lib" = "yes" -a "$have_xsm_header" = "yes"; then have_xsm="yes" fi { echo "$as_me:$LINENO: checking for XCompositeQueryExtension in -lXcomposite" >&5 echo $ECHO_N "checking for XCompositeQueryExtension in -lXcomposite... $ECHO_C" >&6; } if test "${ac_cv_lib_Xcomposite_XCompositeQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXcomposite $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XCompositeQueryExtension (); int main () { return XCompositeQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_Xcomposite_XCompositeQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xcomposite_XCompositeQueryExtension=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&5 echo "${ECHO_T}$ac_cv_lib_Xcomposite_XCompositeQueryExtension" >&6; } if test $ac_cv_lib_Xcomposite_XCompositeQueryExtension = yes; then XCOMPOSITE_LIBS="-lXcomposite" else have_xcomposite="no" fi for ac_header in X11/extensions/Xcomposite.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 else have_xcomposite="no" fi done if test "$have_xcomposite" != "no"; then have_xcomposite="yes" fi # Check whether we have gtk+ 2.0. if test "$with_gtk2" != "no"; then # gdk_display_get_default_group (added in gtk+ 2.4.0) is function currently # needed by vmware-user. if test -z "gtk-x11-2.0"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTK"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTK_CPPFLAGS}" || test -n "${CUSTOM_GTK_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTK_LIBS} -lgtk-x11-2.0" if test -n "gtk/gtk.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTK_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_gtk_gtk_h+set}" = set; then { echo "$as_me:$LINENO: checking for gtk/gtk.h" >&5 echo $ECHO_N "checking for gtk/gtk.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtk_gtk_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtk_gtk_h" >&5 echo "${ECHO_T}$ac_cv_header_gtk_gtk_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gtk/gtk.h usability" >&5 echo $ECHO_N "checking gtk/gtk.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 gtk/gtk.h presence" >&5 echo $ECHO_N "checking gtk/gtk.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gtk/gtk.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gtk/gtk.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gtk/gtk.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gtk/gtk.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gtk/gtk.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gtk/gtk.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gtk/gtk.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gtk/gtk.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gtk/gtk.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gtk/gtk.h" >&5 echo $ECHO_N "checking for gtk/gtk.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtk_gtk_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gtk_gtk_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtk_gtk_h" >&5 echo "${ECHO_T}$ac_cv_header_gtk_gtk_h" >&6; } fi if test $ac_cv_header_gtk_gtk_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "gdk_display_get_default_group"; then ac_vmw_function=gdk_display_get_default_group else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gtk-x11-2.0_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgtk-x11-2.0" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgtk-x11-2.0... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtk-x11-2.0 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTK_CPPFLAGS="${CUSTOM_GTK_CPPFLAGS}" GTK_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gtk+-2.0"; then if test -n "2.4.0"; then { echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtk+-2.0 >= 2.4.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtk+-2.0 >= 2.4.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gtk+-2.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtk+-2.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtk+-2.0'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gtk+-2.0`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gtk+-2.0`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTK_CPPFLAGS="$ac_vmw_cppflags" GTK_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTK_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTK_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTK_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTK_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" else true { { echo "$as_me:$LINENO: error: Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package." >&5 echo "$as_me: error: Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package." >&2;} { (exit 1); exit 1; }; } fi fi # # Check for gtkmm 2.4.0 or greater. # if test "$with_gtkmm" != "no"; then CUSTOM_GTKMM_CPPFLAGS="$CUSTOM_GTKMM_CPPFLAGS $GTK_CPPFLAGS" ac_ext=cpp 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 -z "gtkmm-2.4"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "GTKMM"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_GTKMM_CPPFLAGS}" || test -n "${CUSTOM_GTKMM_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_GTKMM_LIBS} -lgtkmm-2.4" if test -n "gtkmm.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_GTKMM_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_gtkmm_h+set}" = set; then { echo "$as_me:$LINENO: checking for gtkmm.h" >&5 echo $ECHO_N "checking for gtkmm.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtkmm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtkmm_h" >&5 echo "${ECHO_T}$ac_cv_header_gtkmm_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking gtkmm.h usability" >&5 echo $ECHO_N "checking gtkmm.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 gtkmm.h presence" >&5 echo $ECHO_N "checking gtkmm.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: gtkmm.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: gtkmm.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: gtkmm.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: gtkmm.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: gtkmm.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: gtkmm.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: gtkmm.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: gtkmm.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: gtkmm.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: gtkmm.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: gtkmm.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for gtkmm.h" >&5 echo $ECHO_N "checking for gtkmm.h... $ECHO_C" >&6; } if test "${ac_cv_header_gtkmm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_gtkmm_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_gtkmm_h" >&5 echo "${ECHO_T}$ac_cv_header_gtkmm_h" >&6; } fi if test $ac_cv_header_gtkmm_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_gtkmm-2.4_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lgtkmm-2.4" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lgtkmm-2.4... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgtkmm-2.4 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then GTKMM_CPPFLAGS="${CUSTOM_GTKMM_CPPFLAGS}" GTKMM_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "gtkmm-2.4"; then if test -n "2.4.0"; then { echo "$as_me:$LINENO: checking for gtkmm-2.4 >= 2.4.0 (via pkg-config)" >&5 echo $ECHO_N "checking for gtkmm-2.4 >= 2.4.0 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtkmm-2.4 >= 2.4.0'; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for gtkmm-2.4 (via pkg-config)" >&5 echo $ECHO_N "checking for gtkmm-2.4 (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'gtkmm-2.4'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags gtkmm-2.4`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs gtkmm-2.4`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } GTKMM_CPPFLAGS="$ac_vmw_cppflags" GTKMM_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then GTKMM_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" GTKMM_LIBS="`$ac_vmw_lib_cfg --ldflags`" else GTKMM_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" GTKMM_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM" else true { { echo "$as_me:$LINENO: error: gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm." >&5 echo "$as_me: error: gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm." >&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 fi fi # End of checks for X libraries { echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6; } if test "${ac_cv_lib_crypt_crypt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char crypt (); int main () { return crypt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_crypt_crypt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6; } if test $ac_cv_lib_crypt_crypt = yes; then HAVE_CRYPT="yes" else { { echo "$as_me:$LINENO: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&5 echo "$as_me: error: libcrypt not found. Please install the libc/libcrypt devel package(s)." >&2;} { (exit 1); exit 1; }; } fi for ac_func in dlopen 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else { 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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 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 VIX_LIBADD="$VIX_LIBADD -ldl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -ldl" VGAUTH_LIBADD="$VGAUTH_LIBADD -ldl" else { { echo "$as_me:$LINENO: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&5 echo "$as_me: error: dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor." >&2;} { (exit 1); exit 1; }; } fi fi done for ac_func in ecvt 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 for ac_func in fcvt 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 { as_var=$as_ac_var; eval "test \"\${$as_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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif 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 #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_var'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 if test "$os" = "freebsd" -a "$osVersion" -ge 600000; then { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lthr" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lthr... $ECHO_C" >&6; } if test "${ac_cv_lib_thr_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthr $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_thr_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thr_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_thr_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_thr_pthread_mutex_init" >&6; } if test $ac_cv_lib_thr_pthread_mutex_init = yes; then THREAD_LIB=-lthr else { { echo "$as_me:$LINENO: error: Unable to locate required threading library libthr." >&5 echo "$as_me: error: Unable to locate required threading library libthr." >&2;} { (exit 1); exit 1; }; } fi else { echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_mutex_init (); int main () { return pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6; } if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then THREAD_LIB=-lpthread else { { echo "$as_me:$LINENO: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&5 echo "$as_me: error: libpthread not found. Please install the libc/libpthread devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi # PAM prefix # Check whether --with-pam-prefix was given. if test "${with_pam_prefix+set}" = set; then withval=$with_pam_prefix; PAM_PREFIX="$withval" else PAM_PREFIX='$(sysconfdir)' fi if test "$os" = "linux"; then # Check whether --with-procps was given. if test "${with_procps+set}" = set; then withval=$with_procps; else with_procps=yes fi else with_procps="no" fi if test "$with_procps" = "yes"; then have_procps=no if test -z "$CUSTOM_PROCPS_NAME" && test -z "$CUSTOM_PROCPS_LIBS"; then # See if we have procps-ng (that finally supports pkg-config). if test -z "procps-ng"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lprocps-ng" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_procps-ng_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lprocps-ng" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lprocps-ng... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lprocps-ng $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n "libprocps"; then if test -n ""; then { echo "$as_me:$LINENO: checking for libprocps >= (via pkg-config)" >&5 echo $ECHO_N "checking for libprocps >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libprocps >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for libprocps (via pkg-config)" >&5 echo $ECHO_N "checking for libprocps (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists 'libprocps'; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags libprocps`" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs libprocps`" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then # Let's see if there is an older procps version, one that does not # support pkg-config. if test -z "$CUSTOM_PROCPS_NAME"; then CUSTOM_PROCPS_NAME=proc fi # XXX: no pkg-config and no procps-config means we need to # hard-code a sensible default. if test -z "$CUSTOM_PROCPS_LIBS"; then CUSTOM_PROCPS_LIBS="-L/lib" fi # Some distros provide libproc-${version}.so only, others provide the # libproc.so symlink. Try both to see what sticks (but only try the 3.2.7 # and 3.2.8 versions - adding every possible version here would be a mess). # # Users can help by providing CUSTOM_PROCPS_NAME / CUSTOM_PROCPS_LIBS if # necessary. if test -z "$CUSTOM_PROCPS_NAME"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -l$CUSTOM_PROCPS_NAME" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_$CUSTOM_PROCPS_NAME''_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -l$CUSTOM_PROCPS_NAME" >&5 echo $ECHO_N "checking for $ac_vmw_function in -l$CUSTOM_PROCPS_NAME... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$CUSTOM_PROCPS_NAME $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then if test -z "proc-3.2.8"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lproc-3.2.8" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_proc-3.2.8_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lproc-3.2.8" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lproc-3.2.8... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproc-3.2.8 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_procps=yes; else true fi fi if test "$have_procps" = "no"; then if test -z "proc-3.2.7"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "PROCPS"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_PROCPS_CPPFLAGS}" || test -n "${CUSTOM_PROCPS_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_PROCPS_LIBS} -lproc-3.2.7" if test -n ""; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_+set}" = set; then { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking usability" >&5 echo $ECHO_N "checking 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 <> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 presence" >&5 echo $ECHO_N "checking 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 <> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: : accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: : accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the compiler's result" >&5 echo "$as_me: WARNING: : proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: : present but cannot be compiled" >&5 echo "$as_me: WARNING: : present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: : check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: : check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: : see the Autoconf documentation" >&5 echo "$as_me: WARNING: : see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: : section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: : section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: : proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: : proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: : in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: : in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for " >&5 echo $ECHO_N "checking for ... $ECHO_C" >&6; } if test "${ac_cv_header_+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_" >&5 echo "${ECHO_T}$ac_cv_header_" >&6; } fi if test $ac_cv_header_ = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "getstat"; then ac_vmw_function=getstat else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_proc-3.2.7_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -lproc-3.2.7" >&5 echo $ECHO_N "checking for $ac_vmw_function in -lproc-3.2.7... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lproc-3.2.7 $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then PROCPS_CPPFLAGS="${CUSTOM_PROCPS_CPPFLAGS}" PROCPS_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } PROCPS_CPPFLAGS="$ac_vmw_cppflags" PROCPS_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n ""; then # Extract the first word of "", so it can be a program name with args. set dummy ; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --ldflags`" else PROCPS_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" PROCPS_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true else true { { echo "$as_me:$LINENO: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&5 echo "$as_me: error: libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net" >&2;} { (exit 1); exit 1; }; } fi fi fi if test "$with_procps" != "yes"; then cat >>confdefs.h <<\_ACEOF #define NO_PROCPS 1 _ACEOF fi # Check whether --with-dnet was given. if test "${with_dnet+set}" = set; then withval=$with_dnet; else with_dnet=yes fi have_dnet="no" if test "$with_dnet" = "yes"; then # On Debian, dnet is installed via the libdumbnet package. We need to # detect this so that our source files include dumbnet.h instead of # dnet.h, which is part of a different package altogether. if test -z "dumbnet"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "DNET"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_DNET_CPPFLAGS}" || test -n "${CUSTOM_DNET_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_DNET_LIBS} -ldumbnet" if test -n "dumbnet.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_DNET_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_dumbnet_h+set}" = set; then { echo "$as_me:$LINENO: checking for dumbnet.h" >&5 echo $ECHO_N "checking for dumbnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dumbnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dumbnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dumbnet_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dumbnet.h usability" >&5 echo $ECHO_N "checking dumbnet.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 dumbnet.h presence" >&5 echo $ECHO_N "checking dumbnet.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: dumbnet.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dumbnet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dumbnet.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dumbnet.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dumbnet.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dumbnet.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dumbnet.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dumbnet.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dumbnet.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dumbnet.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dumbnet.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for dumbnet.h" >&5 echo $ECHO_N "checking for dumbnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dumbnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dumbnet_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dumbnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dumbnet_h" >&6; } fi if test $ac_cv_header_dumbnet_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "intf_open"; then ac_vmw_function=intf_open else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_dumbnet_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -ldumbnet" >&5 echo $ECHO_N "checking for $ac_vmw_function in -ldumbnet... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldumbnet $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then DNET_CPPFLAGS="${CUSTOM_DNET_CPPFLAGS}" DNET_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DNET_CPPFLAGS="$ac_vmw_cppflags" DNET_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "dumbnet-config"; then # Extract the first word of "dumbnet-config", so it can be a program name with args. set dummy dumbnet-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" DNET_LIBS="`$ac_vmw_lib_cfg --ldflags`" else DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" DNET_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_dnet="yes"; cat >>confdefs.h <<\_ACEOF #define DNET_IS_DUMBNET 1 _ACEOF else true fi if test $have_dnet = "no"; then if test -z "dnet"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "DNET"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_DNET_CPPFLAGS}" || test -n "${CUSTOM_DNET_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_DNET_LIBS} -ldnet" if test -n "dnet.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_DNET_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_dnet_h+set}" = set; then { echo "$as_me:$LINENO: checking for dnet.h" >&5 echo $ECHO_N "checking for dnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_dnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dnet_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking dnet.h usability" >&5 echo $ECHO_N "checking dnet.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 dnet.h presence" >&5 echo $ECHO_N "checking dnet.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: dnet.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dnet.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dnet.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dnet.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dnet.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dnet.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dnet.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dnet.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dnet.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dnet.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dnet.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for dnet.h" >&5 echo $ECHO_N "checking for dnet.h... $ECHO_C" >&6; } if test "${ac_cv_header_dnet_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dnet_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_dnet_h" >&5 echo "${ECHO_T}$ac_cv_header_dnet_h" >&6; } fi if test $ac_cv_header_dnet_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n "intf_open"; then ac_vmw_function=intf_open else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_dnet_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -ldnet" >&5 echo $ECHO_N "checking for $ac_vmw_function in -ldnet... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then DNET_CPPFLAGS="${CUSTOM_DNET_CPPFLAGS}" DNET_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } DNET_CPPFLAGS="$ac_vmw_cppflags" DNET_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "dnet-config"; then # Extract the first word of "dnet-config", so it can be a program name with args. set dummy dnet-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" DNET_LIBS="`$ac_vmw_lib_cfg --ldflags`" else DNET_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" DNET_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true have_dnet="yes" else true fi fi if test $have_dnet = "no"; then { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&5 echo "$as_me: error: dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net" >&2;} { (exit 1); exit 1; }; } fi fi if test "$with_dnet" != "yes"; then cat >>confdefs.h <<\_ACEOF #define NO_DNET 1 _ACEOF fi # Check whether --with-icu was given. if test "${with_icu+set}" = set; then withval=$with_icu; else with_icu=yes fi if test "$have_x" = "yes" -o "$with_icu" = "yes"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$CXX", so it can be a program name with args. set dummy ${ac_tool_prefix}$CXX; 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_have_cxx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_cxx"; then ac_cv_prog_have_cxx="$have_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_cxx="${ac_tool_prefix}$CXX" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi have_cxx=$ac_cv_prog_have_cxx if test -n "$have_cxx"; then { echo "$as_me:$LINENO: result: $have_cxx" >&5 echo "${ECHO_T}$have_cxx" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi if test -z "$ac_cv_prog_have_cxx"; then ac_ct_have_cxx=$have_cxx # Extract the first word of "$CXX", so it can be a program name with args. set dummy $CXX; 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_have_cxx+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_have_cxx"; then ac_cv_prog_ac_ct_have_cxx="$ac_ct_have_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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_have_cxx="$CXX" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_have_cxx=$ac_cv_prog_ac_ct_have_cxx if test -n "$ac_ct_have_cxx"; then { echo "$as_me:$LINENO: result: $ac_ct_have_cxx" >&5 echo "${ECHO_T}$ac_ct_have_cxx" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_have_cxx" = x; then have_cxx="no" else case $cross_compiling:$ac_tool_warned in yes:) { echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac have_cxx=$ac_ct_have_cxx fi else have_cxx="$ac_cv_prog_have_cxx" fi if test "$have_cxx" = "no"; then { { echo "$as_me:$LINENO: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu)." >&5 echo "$as_me: error: C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu)." >&2;} { (exit 1); exit 1; }; } fi fi if test "$with_icu" = "yes"; then ac_ext=cpp 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 -z "icuuc"; then { { echo "$as_me:$LINENO: error: 'library' parameter is required.'" >&5 echo "$as_me: error: 'library' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi if test -z "ICU"; then { { echo "$as_me:$LINENO: error: 'lvar' parameter is required.'" >&5 echo "$as_me: error: 'lvar' parameter is required.'" >&2;} { (exit 1); exit 1; }; } fi ac_vmw_have_lib=0 ac_vmw_have_lib_func=0 ac_vmw_have_lib_header=0 ac_vmw_custom_libs= # # First, try any user-defined CUSTOM_* flags. # if test -n "${CUSTOM_ICU_CPPFLAGS}" || test -n "${CUSTOM_ICU_LIBS}"; then ac_vmw_custom_libs="${CUSTOM_ICU_LIBS} -licuuc" if test -n "unicode/utf.h"; then ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="${CUSTOM_ICU_CPPFLAGS} $CPPFLAGS" if test "${ac_cv_header_unicode_utf_h+set}" = set; then { echo "$as_me:$LINENO: checking for unicode/utf.h" >&5 echo $ECHO_N "checking for unicode/utf.h... $ECHO_C" >&6; } if test "${ac_cv_header_unicode_utf_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_unicode_utf_h" >&5 echo "${ECHO_T}$ac_cv_header_unicode_utf_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking unicode/utf.h usability" >&5 echo $ECHO_N "checking unicode/utf.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 unicode/utf.h presence" >&5 echo $ECHO_N "checking unicode/utf.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.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_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: unicode/utf.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: unicode/utf.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: unicode/utf.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: unicode/utf.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: unicode/utf.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: unicode/utf.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: unicode/utf.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: unicode/utf.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: unicode/utf.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: unicode/utf.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: unicode/utf.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for unicode/utf.h" >&5 echo $ECHO_N "checking for unicode/utf.h... $ECHO_C" >&6; } if test "${ac_cv_header_unicode_utf_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_unicode_utf_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_unicode_utf_h" >&5 echo "${ECHO_T}$ac_cv_header_unicode_utf_h" >&6; } fi if test $ac_cv_header_unicode_utf_h = yes; then ac_vmw_have_lib_header=1 fi CPPFLAGS="$ORIGINAL_CPPFLAGS" else ac_vmw_have_lib_header=1 fi # Check a specific function in the library if requested. # If it hasn't, just pick a random function from libc, just to make # sure the linker can find the library being tested. if test $ac_vmw_have_lib_header -eq 1; then if test -n ""; then ac_vmw_function= else ac_vmw_function=strlen fi as_ac_Lib=`echo "ac_cv_lib_icuuc_$ac_vmw_function" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_vmw_function in -licuuc" >&5 echo $ECHO_N "checking for $ac_vmw_function in -licuuc... $ECHO_C" >&6; } if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-licuuc $ac_vmw_custom_libs $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_vmw_function (); int main () { return $ac_vmw_function (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Lib=no" fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi ac_res=`eval echo '${'$as_ac_Lib'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Lib'}'` = yes; then ac_vmw_have_lib_func=1 fi fi if test $ac_vmw_have_lib_func -eq 1 && test $ac_vmw_have_lib_header -eq 1; then ICU_CPPFLAGS="${CUSTOM_ICU_CPPFLAGS}" ICU_LIBS="$ac_vmw_custom_libs" ac_vmw_have_lib=1 fi fi # If that didn't work, try with pkg-config. if test $ac_vmw_have_lib -eq 0 && test "$HAVE_PKG_CONFIG" = "yes" && test -n ""; then if test -n ""; then { echo "$as_me:$LINENO: checking for >= (via pkg-config)" >&5 echo $ECHO_N "checking for >= (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ' >= '; then ac_vmw_have_lib=1 fi else { echo "$as_me:$LINENO: checking for (via pkg-config)" >&5 echo $ECHO_N "checking for (via pkg-config)... $ECHO_C" >&6; } if pkg-config --exists ''; then ac_vmw_have_lib=1 fi fi if test $ac_vmw_have_lib -eq 1; then # Sometimes pkg-config might fail; for example, "pkg-config gtk+-2.0 --cflags" # fails on OpenSolaris B71. So be pessimistic. ac_vmw_cppflags="`pkg-config --cflags `" ac_vmw_ret1=$? ac_vmw_libs="`pkg-config --libs `" ac_vmw_ret2=$? if test $ac_vmw_ret1 -eq 0 && test $ac_vmw_ret2 -eq 0; then { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } ICU_CPPFLAGS="$ac_vmw_cppflags" ICU_LIBS="$ac_vmw_libs" else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi fi # If we still haven't found the lib, try with the library's custom "config" script. # Before checking, flush the AC_PATH_PROG cached variable. unset ac_cv_path_ac_vmw_lib_cfg unset ac_vmw_lib_cfg if test $ac_vmw_have_lib -eq 0 && test -n "icu-config"; then # Extract the first word of "icu-config", so it can be a program name with args. set dummy icu-config; 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_path_ac_vmw_lib_cfg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_vmw_lib_cfg in [\\/]* | ?:[\\/]*) ac_cv_path_ac_vmw_lib_cfg="$ac_vmw_lib_cfg" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_vmw_lib_cfg="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_ac_vmw_lib_cfg" && ac_cv_path_ac_vmw_lib_cfg="no" ;; esac fi ac_vmw_lib_cfg=$ac_cv_path_ac_vmw_lib_cfg if test -n "$ac_vmw_lib_cfg"; then { echo "$as_me:$LINENO: result: $ac_vmw_lib_cfg" >&5 echo "${ECHO_T}$ac_vmw_lib_cfg" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$ac_vmw_lib_cfg" != "no"; then # XXX: icu-config does not follow the "--cflags" and "--libs" convention, # so single it out here to avoid having to replicate all the rest of the # logic elsewhere. if test `basename "$ac_vmw_lib_cfg"` = "icu-config"; then ICU_CPPFLAGS="`$ac_vmw_lib_cfg --cppflags`" ICU_LIBS="`$ac_vmw_lib_cfg --ldflags`" else ICU_CPPFLAGS="`$ac_vmw_lib_cfg --cflags`" ICU_LIBS="`$ac_vmw_lib_cfg --libs`" fi ac_vmw_have_lib=1 fi fi # Finish by executing the user provided action. The call to "true" is needed # because the actions are optional, and we need something inside the block. if test $ac_vmw_have_lib -eq 1; then true ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU" else true { { echo "$as_me:$LINENO: error: ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 echo "$as_me: error: ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&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 # Check whether we have ICU >= 3.8. ac_ext=cpp 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 for ucasemap_utf8ToTitle in ICU" >&5 echo $ECHO_N "checking for ucasemap_utf8ToTitle in ICU... $ECHO_C" >&6; } ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" 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 () { (void) &ucasemap_utf8ToTitle; return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$ORIGINAL_CPPFLAGS" 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 # Easier to give all modules the ICU defines/includes... CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" else CPPFLAGS="$CPPFLAGS -DNO_ICU" fi # Extract the first word of "rpcgen", so it can be a program name with args. set dummy rpcgen; 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_path_RPCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RPCGEN in [\\/]* | ?:[\\/]*) ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RPCGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_RPCGEN" && ac_cv_path_RPCGEN=" { { echo "$as_me:$LINENO: error: rpcgen not found. Please install the libc devel package." >&5 echo "$as_me: error: rpcgen not found. Please install the libc devel package." >&2;} { (exit 1); exit 1; }; } " ;; esac fi RPCGEN=$ac_cv_path_RPCGEN if test -n "$RPCGEN"; then { echo "$as_me:$LINENO: result: $RPCGEN" >&5 echo "${ECHO_T}$RPCGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi ### ### Headers ### for ac_header in crypt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdint.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in wchar.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/inttypes.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/io.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 # Required to make the sys/user.h check work correctly on FreeBSD for ac_header in sys/sysinfo.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/types.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/user.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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ #ifdef HAVE_SYS_PARAM_H # include #endif #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 sys/vfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in syslimits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in unwind.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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 open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval echo '${'$as_ac_Header'}'` { echo "$as_me:$LINENO: result: $ac_res" >&5 echo "${ECHO_T}$ac_res" >&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 if test "${ac_cv_header_wchar_h+set}" = set; then { echo "$as_me:$LINENO: checking for wchar.h" >&5 echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking wchar.h usability" >&5 echo $ECHO_N "checking wchar.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 wchar.h presence" >&5 echo $ECHO_N "checking wchar.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for wchar.h" >&5 echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } fi if test $ac_cv_header_wchar_h = yes; then HAVE_WCHAR_H="yes" else HAVE_WCHAR_H="no" fi if test "$os" = "linux"; then # Make sure kernel-headers package is installed. if test "${ac_cv_header_linux_unistd_h+set}" = set; then { echo "$as_me:$LINENO: checking for linux/unistd.h" >&5 echo $ECHO_N "checking for linux/unistd.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_unistd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_unistd_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_unistd_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking linux/unistd.h usability" >&5 echo $ECHO_N "checking linux/unistd.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 linux/unistd.h presence" >&5 echo $ECHO_N "checking linux/unistd.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: linux/unistd.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: linux/unistd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: linux/unistd.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: linux/unistd.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: linux/unistd.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: linux/unistd.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: linux/unistd.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: linux/unistd.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: linux/unistd.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: linux/unistd.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: linux/unistd.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for linux/unistd.h" >&5 echo $ECHO_N "checking for linux/unistd.h... $ECHO_C" >&6; } if test "${ac_cv_header_linux_unistd_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_linux_unistd_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_linux_unistd_h" >&5 echo "${ECHO_T}$ac_cv_header_linux_unistd_h" >&6; } fi if test $ac_cv_header_linux_unistd_h = yes; then : else { { echo "$as_me:$LINENO: error: linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package." >&5 echo "$as_me: error: linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package." >&2;} { (exit 1); exit 1; }; } fi fi if test "$enable_multimon" != "no"; then { echo "$as_me:$LINENO: checking for X11/extensions/panoramiXproto.h" >&5 echo $ECHO_N "checking for X11/extensions/panoramiXproto.h... $ECHO_C" >&6; } if test "${ac_cv_header_X11_extensions_panoramiXproto_h+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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_X11_extensions_panoramiXproto_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_X11_extensions_panoramiXproto_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_panoramiXproto_h" >&5 echo "${ECHO_T}$ac_cv_header_X11_extensions_panoramiXproto_h" >&6; } if test $ac_cv_header_X11_extensions_panoramiXproto_h = yes; then : else { { echo "$as_me:$LINENO: error: panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s)." >&5 echo "$as_me: error: panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s)." >&2;} { (exit 1); exit 1; }; } fi fi bsdPrintfWrappers=no if test "$os" = "linux"; then { echo "$as_me:$LINENO: checking for ecvt in -lc" >&5 echo $ECHO_N "checking for ecvt in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_ecvt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $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 GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ecvt (); int main () { return ecvt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then ac_cv_lib_c_ecvt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_ecvt=no fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { echo "$as_me:$LINENO: result: $ac_cv_lib_c_ecvt" >&5 echo "${ECHO_T}$ac_cv_lib_c_ecvt" >&6; } if test $ac_cv_lib_c_ecvt = yes; then bsdPrintfWrappers=yes fi fi ### ### Typdefs, structs, and compiler quarks. ### { echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6; } if test "${ac_cv_header_stdbool_h+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 #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6; } { echo "$as_me:$LINENO: checking for _Bool" >&5 echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } if test "${ac_cv_type__Bool+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 typedef _Bool ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 echo "${ECHO_T}$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _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 cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* 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"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 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; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 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 inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6; } if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_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. */ $ac_includes_default typedef mode_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi { echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_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. */ $ac_includes_default typedef off_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6; } if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { echo "$as_me:$LINENO: checking for pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_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. */ $ac_includes_default typedef pid_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi { echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } if test "${ac_cv_type_size_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. */ $ac_includes_default typedef size_t ac__type_new_; int main () { if ((ac__type_new_ *) 0) return 0; if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi { echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_rdev+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 int main () { static struct stat ac_aggr; if (ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 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 int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+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 int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+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 int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF #define TM_IN_SYS_TIME 1 _ACEOF fi { echo "$as_me:$LINENO: checking for working volatile" >&5 echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } if test "${ac_cv_c_volatile+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 () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_volatile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $ac_cv_c_volatile" >&5 echo "${ECHO_T}$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then cat >>confdefs.h <<\_ACEOF #define volatile _ACEOF fi ### ### Specific features and OS/arch flags / actions ### ### General flags / actions CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Werror" # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' # in Xlib.h on OpenSolaris. # Glib2 keep changing mutex APIs so we also need to disable 'deprecated' # warnings for now (-Wno-deprecated-declarations). for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations; do { echo "$as_me:$LINENO: checking for GCC flag $TEST_CFLAG" >&5 echo $ECHO_N "checking for GCC flag $TEST_CFLAG... $ECHO_C" >&6; } ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" NEW_CFLAG="" 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; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then NEW_CFLAG=" $TEST_CFLAG" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG" done CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS" CPPFLAGS="$CPPFLAGS" # -fvisibility is used by "core service" plugins, but not required. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" { echo "$as_me:$LINENO: checking for GCC flag -fvisibility" >&5 echo $ECHO_N "checking for GCC flag -fvisibility... $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. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then PLUGIN_CPPFLAGS="-fvisibility=hidden -DGCC_EXPLICIT_EXPORT"; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS" # Detect "unused-but-set-variable" gcc warning and disable it. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-but-set-variable" { echo "$as_me:$LINENO: checking for GCC flag -Wno-unused-but-set-variable" >&5 echo $ECHO_N "checking for GCC flag -Wno-unused-but-set-variable... $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. */ int main () { return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ORIGINAL_CFLAGS="$ORIGINAL_CFLAGS -Wno-unused-but-set-variable"; { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ORIGINAL_CFLAGS" BUILDDIR="`pwd`" INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" BLD_INCLUDE_DIR="$BUILDDIR/lib/include" CPPFLAGS="-I$INCLUDE_DIR -I$BLD_INCLUDE_DIR $CPPFLAGS" ### ### Documentation. ### if test "$enable_docs" = "yes"; then # Extract the first word of "doxygen", so it can be a program name with args. set dummy doxygen; 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_have_doxygen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$have_doxygen"; then ac_cv_prog_have_doxygen="$have_doxygen" # 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_have_doxygen="yes" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_have_doxygen" && ac_cv_prog_have_doxygen="no" fi fi have_doxygen=$ac_cv_prog_have_doxygen if test -n "$have_doxygen"; then { echo "$as_me:$LINENO: result: $have_doxygen" >&5 echo "${ECHO_T}$have_doxygen" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$have_doxygen" = "no"; then { echo "$as_me:$LINENO: WARNING: doxygen not found; API documentation will not be generated." >&5 echo "$as_me: WARNING: doxygen not found; API documentation will not be generated." >&2;} else # Extract the first word of "dot", so it can be a program name with args. set dummy dot; 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_path_DOT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DOT in [\\/]* | ?:[\\/]*) ac_cv_path_DOT="$DOT" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi DOT=$ac_cv_path_DOT if test -n "$DOT"; then { echo "$as_me:$LINENO: result: $DOT" >&5 echo "${ECHO_T}$DOT" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$DOT" = ""; then HAVE_DOT=NO else DOT=`dirname $DOT` HAVE_DOT=YES fi # Extract the first word of "mscgen", so it can be a program name with args. set dummy mscgen; 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_path_MSCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSCGEN in [\\/]* | ?:[\\/]*) ac_cv_path_MSCGEN="$MSCGEN" # Let the user override the test with a path. ;; *) 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSCGEN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_MSCGEN" && ac_cv_path_MSCGEN="no" ;; esac fi MSCGEN=$ac_cv_path_MSCGEN if test -n "$MSCGEN"; then { echo "$as_me:$LINENO: result: $MSCGEN" >&5 echo "${ECHO_T}$MSCGEN" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi if test "$MSCGEN" != "no"; then MSCGEN_DIR="`dirname $MSCGEN`" else MSCGEN_DIR= fi fi fi ### ### OS/arch-specific flags / actions ### MODULES="" MODULES_OS="$os" TARGET_OS="$os" MODULES_DIR="" buildHgfsmounter=no if test "$os" = "linux"; then MODULES_DIR="$LINUXDIR/kernel/" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE" CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrt" # vmxnet is not supported for kernels 3.3.0 and newer if test "$osVersion" -lt 303000; then MODULES="$MODULES vmxnet" fi # See if we need vmhgfs module. Starting with 4.0.0 we use FUSE if test "$osVersion" -lt 400000; then MODULES="$MODULES vmhgfs" fi # See if we need vmci and vsock modules. Starting with 3.9 they made # their way into mainline kernel. if test "$osVersion" -lt 309000; then MODULES="$MODULES vmci vsock" fi if test "$osVersion" -lt 300000; then MODULES="$MODULES vmblock vmsync" fi buildHgfsmounter=yes fi if test "$os" = "freebsd" || test "$os" = "kfreebsd-gnu"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm" MODULES_DIR="/boot/modules" if test "$osVersion" -ge 302000; then MODULES="$MODULES vmmemctl" fi if test "$osVersion" -ge 409000; then MODULES="$MODULES vmxnet" fi if test "$osVersion" -ge 600000; then MODULES="$MODULES vmblock" fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building FreeBSD kernel modules. Make sure you use " echo " 'make' to build open-vm-tools, and not GNU make ('gmake'). " echo "****************************************************************" fi fi if test "$os" = "solaris"; then LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lsocket" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lnsl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lresolv" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrpcsvc" # Setup defines to identify the OS version. if test "$osVersion" -eq 509000; then CPPFLAGS="$CPPFLAGS -DSOL9" fi if test "$osVersion" -eq 510000; then CPPFLAGS="$CPPFLAGS -DSOL10" fi if test "$osVersion" -eq 511000; then CPPFLAGS="$CPPFLAGS -DSOL11" fi MODULES="$MODULES vmxnet vmmemctl" # HGFS and vmblock need Solaris 10 at least. if test "$osVersion" -ge 510000; then MODULES="$MODULES vmhgfs vmblock" fi # vmxnet3 is built on Solaris 10 / 11 only if GLDv3 is installed. if test "$osVersion" -gt 510000; then if test "${ac_cv_header_sys_mac_h+set}" = set; then { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } else # Is the header compilable? { echo "$as_me:$LINENO: checking sys/mac.h usability" >&5 echo $ECHO_N "checking sys/mac.h 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 _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; 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 core 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 sys/mac.h presence" >&5 echo $ECHO_N "checking sys/mac.h 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 _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.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: sys/mac.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/mac.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/mac.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/mac.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/mac.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/mac.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/mac.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/mac.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/mac.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mac.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mac.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------------- ## ## Report this to open-vm-tools-devel@lists.sourceforge.net ## ## -------------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { echo "$as_me:$LINENO: checking for sys/mac.h" >&5 echo $ECHO_N "checking for sys/mac.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mac_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mac_h=$ac_header_preproc fi { echo "$as_me:$LINENO: result: $ac_cv_header_sys_mac_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mac_h" >&6; } fi if test $ac_cv_header_sys_mac_h = yes; then MODULES="$MODULES vmxnet3" else { echo "$as_me:$LINENO: WARNING: GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled." >&5 echo "$as_me: WARNING: GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled." >&2;} fi fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building Solaris kernel modules. Make sure you use " echo " GNU make to build open-vm-tools. " echo "****************************************************************" fi fi if test "$buildHgfsmounter" = "yes"; then BUILD_HGFSMOUNTER_TRUE= BUILD_HGFSMOUNTER_FALSE='#' else BUILD_HGFSMOUNTER_TRUE='#' BUILD_HGFSMOUNTER_FALSE= fi if test "$os" = "linux"; then LINUX_TRUE= LINUX_FALSE='#' else LINUX_TRUE='#' LINUX_FALSE= fi if test "$os" = "solaris"; then SOLARIS_TRUE= SOLARIS_FALSE='#' else SOLARIS_TRUE='#' SOLARIS_FALSE= fi if test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu"; then FREEBSD_TRUE= FREEBSD_FALSE='#' else FREEBSD_TRUE='#' FREEBSD_FALSE= fi if test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR"; then FREEBSD_CUSTOM_SYSDIR_TRUE= FREEBSD_CUSTOM_SYSDIR_FALSE='#' else FREEBSD_CUSTOM_SYSDIR_TRUE='#' FREEBSD_CUSTOM_SYSDIR_FALSE= fi if test "$userSpaceBitness" = "32"; then THIRTY_TWO_BIT_USERSPACE_TRUE= THIRTY_TWO_BIT_USERSPACE_FALSE='#' else THIRTY_TWO_BIT_USERSPACE_TRUE='#' THIRTY_TWO_BIT_USERSPACE_FALSE= fi if test "$have_x" = "yes"; then HAVE_X11_TRUE= HAVE_X11_FALSE='#' else HAVE_X11_TRUE='#' HAVE_X11_FALSE= fi if test "$with_icu" = "yes"; then HAVE_ICU_TRUE= HAVE_ICU_FALSE='#' else HAVE_ICU_TRUE='#' HAVE_ICU_FALSE= fi if test "$with_kernel_modules" = "yes"; then WITH_KERNEL_MODULES_TRUE= WITH_KERNEL_MODULES_FALSE='#' else WITH_KERNEL_MODULES_TRUE='#' WITH_KERNEL_MODULES_FALSE= fi if test "$have_xsm" = "yes"; then HAVE_XSM_TRUE= HAVE_XSM_FALSE='#' else HAVE_XSM_TRUE='#' HAVE_XSM_FALSE= fi if test "$have_xcomposite" = "yes"; then HAVE_XCOMPOSITE_TRUE= HAVE_XCOMPOSITE_FALSE='#' else HAVE_XCOMPOSITE_TRUE='#' HAVE_XCOMPOSITE_FALSE= fi if test "$have_cunit" = "yes"; then ENABLE_TESTS_TRUE= ENABLE_TESTS_FALSE='#' else ENABLE_TESTS_TRUE='#' ENABLE_TESTS_FALSE= fi if test "$with_root_privileges" = "yes"; then WITH_ROOT_PRIVILEGES_TRUE= WITH_ROOT_PRIVILEGES_FALSE='#' else WITH_ROOT_PRIVILEGES_TRUE='#' WITH_ROOT_PRIVILEGES_FALSE= fi if test "$have_dnet" = "yes"; then HAVE_DNET_TRUE= HAVE_DNET_FALSE='#' else HAVE_DNET_TRUE='#' HAVE_DNET_FALSE= fi if test "$have_doxygen" = "yes"; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' else HAVE_DOXYGEN_TRUE='#' HAVE_DOXYGEN_FALSE= fi if test "$have_fuse" = "yes"; then HAVE_FUSE_TRUE= HAVE_FUSE_FALSE='#' else HAVE_FUSE_TRUE='#' HAVE_FUSE_FALSE= fi if test "$with_gnu_ld" = "yes"; then HAVE_GNU_LD_TRUE= HAVE_GNU_LD_FALSE='#' else HAVE_GNU_LD_TRUE='#' HAVE_GNU_LD_FALSE= fi if test "$have_x" = "yes" -a "$with_gtkmm" = "yes"; then HAVE_GTKMM_TRUE= HAVE_GTKMM_FALSE='#' else HAVE_GTKMM_TRUE='#' HAVE_GTKMM_FALSE= fi if test "$with_pam" = "yes"; then HAVE_PAM_TRUE= HAVE_PAM_FALSE='#' else HAVE_PAM_TRUE='#' HAVE_PAM_FALSE= fi if test "$os" = "linux"; then USE_SLASH_PROC_TRUE= USE_SLASH_PROC_FALSE='#' else USE_SLASH_PROC_TRUE='#' USE_SLASH_PROC_FALSE= fi if test "$bsdPrintfWrappers" = "yes"; then USE_PRINTF_WRAPPERS_TRUE= USE_PRINTF_WRAPPERS_FALSE='#' else USE_PRINTF_WRAPPERS_TRUE='#' USE_PRINTF_WRAPPERS_FALSE= fi if test "$enable_deploypkg" = "yes"; then ENABLE_DEPLOYPKG_TRUE= ENABLE_DEPLOYPKG_FALSE='#' else ENABLE_DEPLOYPKG_TRUE='#' ENABLE_DEPLOYPKG_FALSE= fi if test "$enable_grabbitmqproxy" = "yes"; then ENABLE_GRABBITMQPROXY_TRUE= ENABLE_GRABBITMQPROXY_FALSE='#' else ENABLE_GRABBITMQPROXY_TRUE='#' ENABLE_GRABBITMQPROXY_FALSE= fi if test "$enable_vgauth" = "yes"; then ENABLE_VGAUTH_TRUE= ENABLE_VGAUTH_FALSE='#' else ENABLE_VGAUTH_TRUE='#' ENABLE_VGAUTH_FALSE= fi if test "$os" = "linux"; then HAVE_VSOCK_TRUE= HAVE_VSOCK_FALSE='#' else HAVE_VSOCK_TRUE='#' HAVE_VSOCK_FALSE= fi if test "$have_xsm" != "yes"; then cat >>confdefs.h <<\_ACEOF #define NO_XSM 1 _ACEOF fi if test "$have_xcomposite" != "yes"; then cat >>confdefs.h <<\_ACEOF #define NO_XCOMPOSITE 1 _ACEOF fi ### Feature-specific flags / actions # Combine where possible # If control reaches this point and multimon is still enabled, then we know # all of the tests for required components have passed and it's safe to allow # multimon. Otherwise, it should be disabled. if test "$enable_multimon" = "no"; then # XXX: For consistency, change this to ENABLE_MULTIMON. This will require # some additional code cleanup. cat >>confdefs.h <<\_ACEOF #define NO_MULTIMON 1 _ACEOF fi LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS $PAM_CPPFLAGS" if test "$HAVE_CRYPT" = "yes"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lcrypt" VIX_LIBADD="$VIX_LIBADD -lcrypt" fi LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $THREAD_LIB" VIX_LIBADD="$VIX_LIBADD $THREAD_LIB" ### Core Services definitions. HGFS_LIBS="$BUILDDIR/libhgfs/libhgfs.la" VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS" VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS" PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS" PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -shared -module -avoid-version" # In Solaris, the XDR-related functions are not in libc like in Linux and # FreeBSD, so binaries need to be linked to some extra libraries. XDR_LIBS= if test "$os" = "solaris"; then XDR_LIBS="-lnsl -lrpcsvc" fi # Installation directories for core services plugins. TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common VMSVC_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmsvc VMUSR_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmusr # General definitions INSTVMSG='$(SHELL) $(top_srcdir)/scripts/build/instvmsg.sh' RPCGEN_WRAPPER='$(SHELL) $(top_builddir)/scripts/build/rpcgen_wrapper.sh' ### General substs if test "$os" = "freebsd" -a -n "$SYSDIR"; then # If SYSDIR is not defined, AC_SUBST expands to nothing, so we need something # inside this block. true fi ### Lib substs ### Program substs ### ### Create the Makefiles ### ac_config_files="$ac_config_files Makefile lib/Makefile lib/appUtil/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/asyncsocket/Makefile lib/sslDirect/Makefile lib/pollGtk/Makefile lib/poll/Makefile lib/dataMap/Makefile lib/hashMap/Makefile lib/dict/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/glibUtils/Makefile lib/guestApp/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsHelper/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/hgfsUri/Makefile lib/impersonate/Makefile lib/lock/Makefile lib/message/Makefile lib/misc/Makefile lib/netUtil/Makefile lib/nicInfo/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/procMgr/Makefile lib/rpcChannel/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcVmx/Makefile lib/slashProc/Makefile lib/string/Makefile lib/stubs/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/unicode/Makefile lib/user/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile lib/xdg/Makefile services/Makefile services/vmtoolsd/Makefile services/plugins/Makefile services/plugins/desktopEvents/Makefile services/plugins/dndcp/Makefile services/plugins/grabbitmqProxy/Makefile services/plugins/guestInfo/Makefile services/plugins/hgfsServer/Makefile services/plugins/powerOps/Makefile services/plugins/resolutionSet/Makefile services/plugins/timeSync/Makefile services/plugins/vix/Makefile services/plugins/vmbackup/Makefile services/plugins/deployPkg/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile rpctool/Makefile namespacetool/Makefile guestproxycerttool/Makefile vgauth/Makefile vgauth/lib/Makefile vgauth/cli/Makefile vgauth/service/Makefile libguestlib/Makefile libguestlib/vmguestlib.pc libDeployPkg/Makefile libDeployPkg/libDeployPkg.pc libhgfs/Makefile libvmtools/Makefile xferlogs/Makefile modules/Makefile vmblock-fuse/Makefile vmhgfs-fuse/Makefile vmblockmounter/Makefile tests/Makefile tests/vmrpcdbg/Makefile tests/testDebug/Makefile tests/testPlugin/Makefile tests/testVmblock/Makefile docs/Makefile docs/api/Makefile scripts/Makefile scripts/build/rpcgen_wrapper.sh" ### ### Output ### 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, we kill variables containing newlines. # 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. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end 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 "$as_me:$LINENO: updating cache $cache_file" >&5 echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 echo "$as_me: not updating unwritable cache $cache_file" >&6;} 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}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.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_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs 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__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 "${BUILD_HGFSMOUNTER_TRUE}" && test -z "${BUILD_HGFSMOUNTER_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_HGFSMOUNTER\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"BUILD_HGFSMOUNTER\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${LINUX_TRUE}" && test -z "${LINUX_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"LINUX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${SOLARIS_TRUE}" && test -z "${SOLARIS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREEBSD_TRUE}" && test -z "${FREEBSD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${FREEBSD_CUSTOM_SYSDIR_TRUE}" && test -z "${FREEBSD_CUSTOM_SYSDIR_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"FREEBSD_CUSTOM_SYSDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"FREEBSD_CUSTOM_SYSDIR\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${THIRTY_TWO_BIT_USERSPACE_TRUE}" && test -z "${THIRTY_TWO_BIT_USERSPACE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"THIRTY_TWO_BIT_USERSPACE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"THIRTY_TWO_BIT_USERSPACE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_X11_TRUE}" && test -z "${HAVE_X11_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_ICU_TRUE}" && test -z "${HAVE_ICU_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_ICU\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_ICU\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_KERNEL_MODULES_TRUE}" && test -z "${WITH_KERNEL_MODULES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_KERNEL_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_KERNEL_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XSM_TRUE}" && test -z "${HAVE_XSM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XSM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_XSM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XCOMPOSITE_TRUE}" && test -z "${HAVE_XCOMPOSITE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_XCOMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_XCOMPOSITE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_TESTS_TRUE}" && test -z "${ENABLE_TESTS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WITH_ROOT_PRIVILEGES_TRUE}" && test -z "${WITH_ROOT_PRIVILEGES_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"WITH_ROOT_PRIVILEGES\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"WITH_ROOT_PRIVILEGES\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DNET_TRUE}" && test -z "${HAVE_DNET_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_DNET\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_DNET\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_FUSE_TRUE}" && test -z "${HAVE_FUSE_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_FUSE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GNU_LD_TRUE}" && test -z "${HAVE_GNU_LD_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GNU_LD\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GTKMM_TRUE}" && test -z "${HAVE_GTKMM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GTKMM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GTKMM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_PAM_TRUE}" && test -z "${HAVE_PAM_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_PAM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_SLASH_PROC_TRUE}" && test -z "${USE_SLASH_PROC_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_SLASH_PROC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_SLASH_PROC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${USE_PRINTF_WRAPPERS_TRUE}" && test -z "${USE_PRINTF_WRAPPERS_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"USE_PRINTF_WRAPPERS\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"USE_PRINTF_WRAPPERS\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_DEPLOYPKG_TRUE}" && test -z "${ENABLE_DEPLOYPKG_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_DEPLOYPKG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_DEPLOYPKG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_GRABBITMQPROXY_TRUE}" && test -z "${ENABLE_GRABBITMQPROXY_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_GRABBITMQPROXY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_GRABBITMQPROXY\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_VGAUTH_TRUE}" && test -z "${ENABLE_VGAUTH_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"ENABLE_VGAUTH\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"ENABLE_VGAUTH\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_VSOCK_TRUE}" && test -z "${HAVE_VSOCK_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_VSOCK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_VSOCK\" 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 more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh 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 # PATH needs CR # 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 # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) as_nl=' ' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. 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 IFS=$as_save_IFS ;; 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_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done 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) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # 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 after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, 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 # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\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 sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' 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$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # 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'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by open-vm-tools $as_me 10.0.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF 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 and configuration settings, 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 Configuration files: $config_files Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ open-vm-tools config.status 10.0.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' _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 ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { 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" ac_need_defaults=false ;; 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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 CONFIG_SHELL=$SHELL export CONFIG_SHELL exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # 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 sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "lib/appUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/appUtil/Makefile" ;; "lib/auth/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auth/Makefile" ;; "lib/backdoor/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/Makefile" ;; "lib/asyncsocket/Makefile") CONFIG_FILES="$CONFIG_FILES lib/asyncsocket/Makefile" ;; "lib/sslDirect/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sslDirect/Makefile" ;; "lib/pollGtk/Makefile") CONFIG_FILES="$CONFIG_FILES lib/pollGtk/Makefile" ;; "lib/poll/Makefile") CONFIG_FILES="$CONFIG_FILES lib/poll/Makefile" ;; "lib/dataMap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dataMap/Makefile" ;; "lib/hashMap/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hashMap/Makefile" ;; "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; "lib/glibUtils/Makefile") CONFIG_FILES="$CONFIG_FILES lib/glibUtils/Makefile" ;; "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; "lib/guestRpc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestRpc/Makefile" ;; "lib/hgfs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfs/Makefile" ;; "lib/hgfsBd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsBd/Makefile" ;; "lib/hgfsHelper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsHelper/Makefile" ;; "lib/hgfsServer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServer/Makefile" ;; "lib/hgfsServerManagerGuest/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServerManagerGuest/Makefile" ;; "lib/hgfsServerPolicyGuest/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsServerPolicyGuest/Makefile" ;; "lib/hgfsUri/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsUri/Makefile" ;; "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; "lib/lock/Makefile") CONFIG_FILES="$CONFIG_FILES lib/lock/Makefile" ;; "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; "lib/nicInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/nicInfo/Makefile" ;; "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; "lib/rpcChannel/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcChannel/Makefile" ;; "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; "lib/slashProc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/slashProc/Makefile" ;; "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; "lib/vmCheck/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmCheck/Makefile" ;; "lib/vmSignal/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmSignal/Makefile" ;; "lib/wiper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/wiper/Makefile" ;; "lib/xdg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/xdg/Makefile" ;; "services/Makefile") CONFIG_FILES="$CONFIG_FILES services/Makefile" ;; "services/vmtoolsd/Makefile") CONFIG_FILES="$CONFIG_FILES services/vmtoolsd/Makefile" ;; "services/plugins/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/Makefile" ;; "services/plugins/desktopEvents/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/desktopEvents/Makefile" ;; "services/plugins/dndcp/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/dndcp/Makefile" ;; "services/plugins/grabbitmqProxy/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/grabbitmqProxy/Makefile" ;; "services/plugins/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/guestInfo/Makefile" ;; "services/plugins/hgfsServer/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/hgfsServer/Makefile" ;; "services/plugins/powerOps/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/powerOps/Makefile" ;; "services/plugins/resolutionSet/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/resolutionSet/Makefile" ;; "services/plugins/timeSync/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/timeSync/Makefile" ;; "services/plugins/vix/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/vix/Makefile" ;; "services/plugins/vmbackup/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/vmbackup/Makefile" ;; "services/plugins/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES services/plugins/deployPkg/Makefile" ;; "vmware-user-suid-wrapper/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user-suid-wrapper/Makefile" ;; "toolbox/Makefile") CONFIG_FILES="$CONFIG_FILES toolbox/Makefile" ;; "hgfsclient/Makefile") CONFIG_FILES="$CONFIG_FILES hgfsclient/Makefile" ;; "hgfsmounter/Makefile") CONFIG_FILES="$CONFIG_FILES hgfsmounter/Makefile" ;; "checkvm/Makefile") CONFIG_FILES="$CONFIG_FILES checkvm/Makefile" ;; "rpctool/Makefile") CONFIG_FILES="$CONFIG_FILES rpctool/Makefile" ;; "namespacetool/Makefile") CONFIG_FILES="$CONFIG_FILES namespacetool/Makefile" ;; "guestproxycerttool/Makefile") CONFIG_FILES="$CONFIG_FILES guestproxycerttool/Makefile" ;; "vgauth/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/Makefile" ;; "vgauth/lib/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/lib/Makefile" ;; "vgauth/cli/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/cli/Makefile" ;; "vgauth/service/Makefile") CONFIG_FILES="$CONFIG_FILES vgauth/service/Makefile" ;; "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; "libguestlib/vmguestlib.pc") CONFIG_FILES="$CONFIG_FILES libguestlib/vmguestlib.pc" ;; "libDeployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES libDeployPkg/Makefile" ;; "libDeployPkg/libDeployPkg.pc") CONFIG_FILES="$CONFIG_FILES libDeployPkg/libDeployPkg.pc" ;; "libhgfs/Makefile") CONFIG_FILES="$CONFIG_FILES libhgfs/Makefile" ;; "libvmtools/Makefile") CONFIG_FILES="$CONFIG_FILES libvmtools/Makefile" ;; "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; "vmblock-fuse/Makefile") CONFIG_FILES="$CONFIG_FILES vmblock-fuse/Makefile" ;; "vmhgfs-fuse/Makefile") CONFIG_FILES="$CONFIG_FILES vmhgfs-fuse/Makefile" ;; "vmblockmounter/Makefile") CONFIG_FILES="$CONFIG_FILES vmblockmounter/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests/vmrpcdbg/Makefile") CONFIG_FILES="$CONFIG_FILES tests/vmrpcdbg/Makefile" ;; "tests/testDebug/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testDebug/Makefile" ;; "tests/testPlugin/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testPlugin/Makefile" ;; "tests/testVmblock/Makefile") CONFIG_FILES="$CONFIG_FILES tests/testVmblock/Makefile" ;; "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; "docs/api/Makefile") CONFIG_FILES="$CONFIG_FILES docs/api/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/build/rpcgen_wrapper.sh") CONFIG_FILES="$CONFIG_FILES scripts/build/rpcgen_wrapper.sh" ;; *) { { 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_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 against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$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 "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # # Set up the sed scripts for 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 _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF SHELL!$SHELL$ac_delim PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim PACKAGE_NAME!$PACKAGE_NAME$ac_delim PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim PACKAGE_STRING!$PACKAGE_STRING$ac_delim PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim exec_prefix!$exec_prefix$ac_delim prefix!$prefix$ac_delim program_transform_name!$program_transform_name$ac_delim bindir!$bindir$ac_delim sbindir!$sbindir$ac_delim libexecdir!$libexecdir$ac_delim datarootdir!$datarootdir$ac_delim datadir!$datadir$ac_delim sysconfdir!$sysconfdir$ac_delim sharedstatedir!$sharedstatedir$ac_delim localstatedir!$localstatedir$ac_delim includedir!$includedir$ac_delim oldincludedir!$oldincludedir$ac_delim docdir!$docdir$ac_delim infodir!$infodir$ac_delim htmldir!$htmldir$ac_delim dvidir!$dvidir$ac_delim pdfdir!$pdfdir$ac_delim psdir!$psdir$ac_delim libdir!$libdir$ac_delim localedir!$localedir$ac_delim mandir!$mandir$ac_delim DEFS!$DEFS$ac_delim ECHO_C!$ECHO_C$ac_delim ECHO_N!$ECHO_N$ac_delim ECHO_T!$ECHO_T$ac_delim LIBS!$LIBS$ac_delim build_alias!$build_alias$ac_delim host_alias!$host_alias$ac_delim target_alias!$target_alias$ac_delim build!$build$ac_delim build_cpu!$build_cpu$ac_delim build_vendor!$build_vendor$ac_delim build_os!$build_os$ac_delim host!$host$ac_delim host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim am__isrc!$am__isrc$ac_delim CYGPATH_W!$CYGPATH_W$ac_delim PACKAGE!$PACKAGE$ac_delim VERSION!$VERSION$ac_delim ACLOCAL!$ACLOCAL$ac_delim AUTOCONF!$AUTOCONF$ac_delim AUTOMAKE!$AUTOMAKE$ac_delim AUTOHEADER!$AUTOHEADER$ac_delim MAKEINFO!$MAKEINFO$ac_delim install_sh!$install_sh$ac_delim STRIP!$STRIP$ac_delim INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim mkdir_p!$mkdir_p$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim am__leading_dot!$am__leading_dot$ac_delim AMTAR!$AMTAR$ac_delim am__tar!$am__tar$ac_delim am__untar!$am__untar$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim CPPFLAGS!$CPPFLAGS$ac_delim ac_ct_CC!$ac_ct_CC$ac_delim EXEEXT!$EXEEXT$ac_delim OBJEXT!$OBJEXT$ac_delim DEPDIR!$DEPDIR$ac_delim am__include!$am__include$ac_delim am__quote!$am__quote$ac_delim AMDEP_TRUE!$AMDEP_TRUE$ac_delim AMDEP_FALSE!$AMDEP_FALSE$ac_delim AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim CCDEPMODE!$CCDEPMODE$ac_delim am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim ac_ct_CXX!$ac_ct_CXX$ac_delim CXXDEPMODE!$CXXDEPMODE$ac_delim am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim SED!$SED$ac_delim LN_S!$LN_S$ac_delim LIBTOOL!$LIBTOOL$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim FGREP!$FGREP$ac_delim LD!$LD$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF DUMPBIN!$DUMPBIN$ac_delim ac_ct_DUMPBIN!$ac_ct_DUMPBIN$ac_delim NM!$NM$ac_delim OBJDUMP!$OBJDUMP$ac_delim DLLTOOL!$DLLTOOL$ac_delim AR!$AR$ac_delim ac_ct_AR!$ac_ct_AR$ac_delim RANLIB!$RANLIB$ac_delim MANIFEST_TOOL!$MANIFEST_TOOL$ac_delim DSYMUTIL!$DSYMUTIL$ac_delim NMEDIT!$NMEDIT$ac_delim LIPO!$LIPO$ac_delim OTOOL!$OTOOL$ac_delim OTOOL64!$OTOOL64$ac_delim CXXCPP!$CXXCPP$ac_delim HAVE_PKG_CONFIG!$HAVE_PKG_CONFIG$ac_delim XMKMF!$XMKMF$ac_delim X_CFLAGS!$X_CFLAGS$ac_delim X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim ac_vmw_lib_cfg!$ac_vmw_lib_cfg$ac_delim MSPACK_CPPFLAGS!$MSPACK_CPPFLAGS$ac_delim MSPACK_LIBS!$MSPACK_LIBS$ac_delim GLIB2_CPPFLAGS!$GLIB2_CPPFLAGS$ac_delim GLIB2_LIBS!$GLIB2_LIBS$ac_delim GMODULE_CPPFLAGS!$GMODULE_CPPFLAGS$ac_delim GMODULE_LIBS!$GMODULE_LIBS$ac_delim GOBJECT_CPPFLAGS!$GOBJECT_CPPFLAGS$ac_delim GOBJECT_LIBS!$GOBJECT_LIBS$ac_delim GTHREAD_CPPFLAGS!$GTHREAD_CPPFLAGS$ac_delim GTHREAD_LIBS!$GTHREAD_LIBS$ac_delim have_genmarshal!$have_genmarshal$ac_delim FUSE_CPPFLAGS!$FUSE_CPPFLAGS$ac_delim FUSE_LIBS!$FUSE_LIBS$ac_delim PAM_CPPFLAGS!$PAM_CPPFLAGS$ac_delim PAM_LIBS!$PAM_LIBS$ac_delim SSL_CPPFLAGS!$SSL_CPPFLAGS$ac_delim SSL_LIBS!$SSL_LIBS$ac_delim XERCES_CPPFLAGS!$XERCES_CPPFLAGS$ac_delim XERCES_LIBS!$XERCES_LIBS$ac_delim XMLSECURITY_CPPFLAGS!$XMLSECURITY_CPPFLAGS$ac_delim XMLSECURITY_LIBS!$XMLSECURITY_LIBS$ac_delim CUNIT_CPPFLAGS!$CUNIT_CPPFLAGS$ac_delim CUNIT_LIBS!$CUNIT_LIBS$ac_delim GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim GTK_LIBS!$GTK_LIBS$ac_delim GTKMM_CPPFLAGS!$GTKMM_CPPFLAGS$ac_delim GTKMM_LIBS!$GTKMM_LIBS$ac_delim PROCPS_CPPFLAGS!$PROCPS_CPPFLAGS$ac_delim PROCPS_LIBS!$PROCPS_LIBS$ac_delim DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim DNET_LIBS!$DNET_LIBS$ac_delim have_cxx!$have_cxx$ac_delim ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim ICU_LIBS!$ICU_LIBS$ac_delim RPCGEN!$RPCGEN$ac_delim have_doxygen!$have_doxygen$ac_delim DOT!$DOT$ac_delim HAVE_DOT!$HAVE_DOT$ac_delim MSCGEN!$MSCGEN$ac_delim MSCGEN_DIR!$MSCGEN_DIR$ac_delim BUILD_HGFSMOUNTER_TRUE!$BUILD_HGFSMOUNTER_TRUE$ac_delim BUILD_HGFSMOUNTER_FALSE!$BUILD_HGFSMOUNTER_FALSE$ac_delim LINUX_TRUE!$LINUX_TRUE$ac_delim LINUX_FALSE!$LINUX_FALSE$ac_delim SOLARIS_TRUE!$SOLARIS_TRUE$ac_delim SOLARIS_FALSE!$SOLARIS_FALSE$ac_delim FREEBSD_TRUE!$FREEBSD_TRUE$ac_delim FREEBSD_FALSE!$FREEBSD_FALSE$ac_delim FREEBSD_CUSTOM_SYSDIR_TRUE!$FREEBSD_CUSTOM_SYSDIR_TRUE$ac_delim FREEBSD_CUSTOM_SYSDIR_FALSE!$FREEBSD_CUSTOM_SYSDIR_FALSE$ac_delim THIRTY_TWO_BIT_USERSPACE_TRUE!$THIRTY_TWO_BIT_USERSPACE_TRUE$ac_delim THIRTY_TWO_BIT_USERSPACE_FALSE!$THIRTY_TWO_BIT_USERSPACE_FALSE$ac_delim HAVE_X11_TRUE!$HAVE_X11_TRUE$ac_delim HAVE_X11_FALSE!$HAVE_X11_FALSE$ac_delim HAVE_ICU_TRUE!$HAVE_ICU_TRUE$ac_delim HAVE_ICU_FALSE!$HAVE_ICU_FALSE$ac_delim WITH_KERNEL_MODULES_TRUE!$WITH_KERNEL_MODULES_TRUE$ac_delim WITH_KERNEL_MODULES_FALSE!$WITH_KERNEL_MODULES_FALSE$ac_delim HAVE_XSM_TRUE!$HAVE_XSM_TRUE$ac_delim HAVE_XSM_FALSE!$HAVE_XSM_FALSE$ac_delim HAVE_XCOMPOSITE_TRUE!$HAVE_XCOMPOSITE_TRUE$ac_delim HAVE_XCOMPOSITE_FALSE!$HAVE_XCOMPOSITE_FALSE$ac_delim ENABLE_TESTS_TRUE!$ENABLE_TESTS_TRUE$ac_delim ENABLE_TESTS_FALSE!$ENABLE_TESTS_FALSE$ac_delim WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim HAVE_DNET_TRUE!$HAVE_DNET_TRUE$ac_delim HAVE_DNET_FALSE!$HAVE_DNET_FALSE$ac_delim HAVE_DOXYGEN_TRUE!$HAVE_DOXYGEN_TRUE$ac_delim HAVE_DOXYGEN_FALSE!$HAVE_DOXYGEN_FALSE$ac_delim HAVE_FUSE_TRUE!$HAVE_FUSE_TRUE$ac_delim HAVE_FUSE_FALSE!$HAVE_FUSE_FALSE$ac_delim HAVE_GNU_LD_TRUE!$HAVE_GNU_LD_TRUE$ac_delim HAVE_GNU_LD_FALSE!$HAVE_GNU_LD_FALSE$ac_delim HAVE_GTKMM_TRUE!$HAVE_GTKMM_TRUE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF CEOF$ac_eof _ACEOF ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF HAVE_GTKMM_FALSE!$HAVE_GTKMM_FALSE$ac_delim HAVE_PAM_TRUE!$HAVE_PAM_TRUE$ac_delim HAVE_PAM_FALSE!$HAVE_PAM_FALSE$ac_delim USE_SLASH_PROC_TRUE!$USE_SLASH_PROC_TRUE$ac_delim USE_SLASH_PROC_FALSE!$USE_SLASH_PROC_FALSE$ac_delim USE_PRINTF_WRAPPERS_TRUE!$USE_PRINTF_WRAPPERS_TRUE$ac_delim USE_PRINTF_WRAPPERS_FALSE!$USE_PRINTF_WRAPPERS_FALSE$ac_delim ENABLE_DEPLOYPKG_TRUE!$ENABLE_DEPLOYPKG_TRUE$ac_delim ENABLE_DEPLOYPKG_FALSE!$ENABLE_DEPLOYPKG_FALSE$ac_delim ENABLE_GRABBITMQPROXY_TRUE!$ENABLE_GRABBITMQPROXY_TRUE$ac_delim ENABLE_GRABBITMQPROXY_FALSE!$ENABLE_GRABBITMQPROXY_FALSE$ac_delim ENABLE_VGAUTH_TRUE!$ENABLE_VGAUTH_TRUE$ac_delim ENABLE_VGAUTH_FALSE!$ENABLE_VGAUTH_FALSE$ac_delim HAVE_VSOCK_TRUE!$HAVE_VSOCK_TRUE$ac_delim HAVE_VSOCK_FALSE!$HAVE_VSOCK_FALSE$ac_delim HGFS_LIBS!$HGFS_LIBS$ac_delim TOOLS_VERSION!$TOOLS_VERSION$ac_delim TARGET_OS!$TARGET_OS$ac_delim KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim LINUXINCLUDE!$LINUXINCLUDE$ac_delim MODULES_OS!$MODULES_OS$ac_delim MODULES_DIR!$MODULES_DIR$ac_delim MODULES!$MODULES$ac_delim COMMON_XLIBS!$COMMON_XLIBS$ac_delim XSM_LIBS!$XSM_LIBS$ac_delim XCOMPOSITE_LIBS!$XCOMPOSITE_LIBS$ac_delim PAM_PREFIX!$PAM_PREFIX$ac_delim PLUGIN_CPPFLAGS!$PLUGIN_CPPFLAGS$ac_delim PLUGIN_LDFLAGS!$PLUGIN_LDFLAGS$ac_delim VMTOOLS_CPPFLAGS!$VMTOOLS_CPPFLAGS$ac_delim VMTOOLS_LIBS!$VMTOOLS_LIBS$ac_delim RPCGENFLAGS!$RPCGENFLAGS$ac_delim XDR_LIBS!$XDR_LIBS$ac_delim TEST_PLUGIN_INSTALLDIR!$TEST_PLUGIN_INSTALLDIR$ac_delim COMMON_PLUGIN_INSTALLDIR!$COMMON_PLUGIN_INSTALLDIR$ac_delim VMSVC_PLUGIN_INSTALLDIR!$VMSVC_PLUGIN_INSTALLDIR$ac_delim VMUSR_PLUGIN_INSTALLDIR!$VMUSR_PLUGIN_INSTALLDIR$ac_delim SYSDIR!$SYSDIR$ac_delim INSTVMSG!$INSTVMSG$ac_delim RPCGEN_WRAPPER!$RPCGEN_WRAPPER$ac_delim LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim LIBVMTOOLS_LIBADD!$LIBVMTOOLS_LIBADD$ac_delim VIX_LIBADD!$VIX_LIBADD$ac_delim VGAUTH_LIBADD!$VGAUTH_LIBADD$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 48; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` if test -n "$ac_eof"; then ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` ac_eof=`expr $ac_eof + 1` fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-3.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g s/^/s,@/; s/!/@,|#_!!_#|/ :n t n s/'"$ac_delim"'$/,g/; t s/$/\\/; p N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF :end s/|#_!!_#|//g CEOF$ac_eof _ACEOF # 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 cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" for ac_tag in :F $CONFIG_FILES :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac ac_file_inputs="$ac_file_inputs $ac_f" done # 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. */ configure_input="Generated from "`IFS=: echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} fi case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $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'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= case `sed -n '/datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? 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&@top_builddir@&$ac_top_builddir_sub&;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&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" | sed -f "$tmp/subs-3.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out"; rm -f "$tmp/out";; *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $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=`$as_dirname -- "$file" || $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'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $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'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "libtool":C) # 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 cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool 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. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # 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 # 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//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # 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 # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # 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 # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # 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 # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # 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 # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # 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 # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # 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 a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # 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 # 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 DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # 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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # 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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_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 _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # 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) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { echo "$as_me:$LINENO: WARNING: Unable to substitute extended shell functions in $ofile" >&5 echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # 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 a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # 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 # 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 DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag { (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 open-vm-tools-10.0.7-3227872/configure.ac0000644000000000000000000012361212660700525016146 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### Configure script for building the VMware OSS Tools. ### ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ ################################################################################ # In addition to the usual environment variables and command line # arguments that a configure script usually takes (CFLAGS, LDFLAGS, # etc.), this script also accepts variables of the form: # # CUSTOM_LIB_CPPFLAGS: compile-time flags for LIB # CUSTOM_LIB_LIBS: link-time flags for LIB # RPCGENFLAGS: extra flags to pass to rpcgen # # The following libraries are currently tested: DNET, FUSE, GLIB2, GMODULE, # GOBJECT, GTHREAD, GTK, GTKMM, ICU, LIBPNG, PAM, PROCPS, URIPARSER, ZLIB # # For the procps library: you can provide the name of the procps library on # your system by defining CUSTOM_PROCPS_NAME. By default the configure script # will try both "-lproc" and "-lproc-3.2.7". ################################################################################ ### ### Initialization ### TOOLS_VERSION="10.0.7" AC_INIT( [open-vm-tools], [10.0.7], [open-vm-tools-devel@lists.sourceforge.net]) # In order to make this configure script auto-detect situations where # people have a 32-bit userland running with a 64-bit kernel, we try to ask # the compiler (assumedly gcc) for its default Target:. # We have to set up $TEST_CC manually, since AC_PROG_CC hasn't yet been run (and can't be until AC_CANONICAL_HOST & AC_CANONICAL_BUILD are run) # The purpose of all this is to set up $host_alias/$build_alias in a more # intelligent way than config.guess currently does. TEST_CC="$CC_FOR_BUILD" test -z "$TEST_CC" && TEST_CC="$HOST_CC" test -z "$TEST_CC" && TEST_CC="$CC" if test -n "$TEST_CC" -a -z "$host_alias"; then host_alias="`$TEST_CC -dumpmachine`" if test -z "$build_alias" -a -n "$host_alias"; then build_alias="$host_alias" fi fi unset TEST_CC # checkvm/checkvm.c has no special significance - we just need to pass in a file that # helps autoconf verify that it really has found the source tree. AC_CONFIG_SRCDIR([checkvm/checkvm.c]) # Keep the top-level directory tidy by putting auxiliary build tools and local # macros in separate subdirectories. AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AC_CANONICAL_BUILD # Quote the regular expressions case "$host_cpu" in [i[3456]86]) userSpaceBitness="32" ;; [x86_64]) userSpaceBitness="64" ;; [*]) AC_MSG_ERROR([Unknown architecture.]) ;; esac # Operational arguments. AC_ARG_WITH([root-privileges], [AS_HELP_STRING([--without-root-privileges], [does not perform any operations that require root privileges])], [], [with_root_privileges=yes]) # Kernel arguments. # The kernel args have to go here otherwise the KERNEL_RELEASE won't be visible # to getOsVersion() AC_ARG_WITH([kernel-modules], [AS_HELP_STRING([--without-kernel-modules], [does not compile or install the kernel modules])], [], [with_kernel_modules=yes]) AC_ARG_WITH([kernel-release], [AS_HELP_STRING([--with-kernel-release], [specifies the kernel release you want to build against])], [KERNEL_RELEASE="$withval"], [KERNEL_RELEASE=`uname -r`]) AC_ARG_WITH([linuxdir], [AS_HELP_STRING([--with-linuxdir], [specifies the Linux directory you want to use])], [LINUXDIR="$withval"], [LINUXDIR=/lib/modules/$KERNEL_RELEASE]) # Turn the uname output into something we can run comparisons on. getOsVersion() { major_version="`echo $KERNEL_RELEASE | cut -f1 -d. | cut -f1 -d-`" minor_version="`echo $KERNEL_RELEASE | cut -f2 -d. | cut -f1 -d-`" micro_version="`echo $KERNEL_RELEASE | cut -f3 -d. | cut -f1 -d-`" printf '%02d%02d%03d' $major_version $minor_version $micro_version } case "$host_os" in [linux*]) os="linux" ;; [freebsd*]) os="freebsd" ;; [kfreebsd*-gnu]) os="kfreebsd-gnu" ;; [solaris*]) os="solaris" ;; [*]) AC_MSG_WARN([This is an untested and unsupported Operating System. Proceed at your own peril.]) ;; esac osVersion="`getOsVersion`" if test "$with_kernel_modules" = "yes"; then case "$os" in linux) if test "$osVersion" -lt 206009; then AC_MSG_ERROR([Kernels prior to 2.6.9 are not supported in this release of open-vm-tools. Configure using --without-kernel-modules to suppress building kernel drivers.]) fi if test ! -d "$LINUXDIR/kernel/"; then AC_MSG_ERROR([$LINUXDIR/kernel does not exist]) fi LINUXINCLUDE="$LINUXDIR/build/include" if test ! -d "$LINUXINCLUDE"; then AC_MSG_ERROR([Can't find include dir under $LINUXDIR]) fi ;; freebsd) freebsd_sysdir=/usr/src/sys if test -n "$SYSDIR"; then freebsd_sysdir="$SYSDIR" fi if test ! -f "$freebsd_sysdir/conf/kmod.mk"; then AC_MSG_ERROR([FreeBSD kernel tree not found. Please install the kernel sources (or provide the location using SYSDIR) or configure using --without-kernel-modules.]) fi ;; esac fi # Arguments for disabling individual open-vm-tools features or libraries. AC_ARG_ENABLE( multimon, AS_HELP_STRING( [--disable-multimon], [disables multimon, enabled by default]), [enable_multimon="$enableval"], [enable_multimon="yes"]) AC_ARG_WITH( gtk2, AS_HELP_STRING( [--without-gtk2], [compiles without Gtk 2.0]), [with_gtk2="$withval"], [with_gtk2="yes"]) AC_ARG_WITH( gtkmm, AS_HELP_STRING( [--without-gtkmm], [compiles without Gtkmm, sigc++, and related libs]), [with_gtkmm="$withval"], [with_gtkmm="yes"]) AC_ARG_ENABLE( docs, AS_HELP_STRING( [--disable-docs], [disables generation of API documentation; by default, docs are built if doxygen is available.]), [enable_docs="$enableval"], [enable_docs="yes"]) AC_ARG_ENABLE( tests, AS_HELP_STRING( [--disable-tests], [disable compilation of test code.]), [enable_tests="$enableval"], [enable_tests="auto"]) AM_INIT_AUTOMAKE ### ### Constants ### # These need to be declared after initialization. # Some of our macro call-sites require changes to # CPPFLAGS/CFLAGS/LDFLAGS. In such places, we save the original value # of CPPFLAGS/CFLAGS/LDFLAGS before the macro call and restore it when # the call is done. We must perform this save at each macro site, # because CPPFLAGS/CFLAGS/LDFLAGS may change over the course of # configuration. # # CPPFLAGS is intended for preprocessor options (-D and -I mainly) # CFLAGS is intended for compiler options (-O, -f, -W, and so forth) CPPFLAGS="$CPPFLAGS -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS" ### ### Programs ### # C preprocessor and compiler. AC_PROG_CPP AC_PROG_CC # C++ compiler. Note that unlike AC_PROG_CC, this call does not trigger an # error if no C++ compiler was found; it'll just set the variable CXX to 'g++'. AC_PROG_CXX # This allows features like per-target compiler flags. I.e., you can compile # one copy of the same sources twice with different flags. (See lib/guestApp # for an example.) AM_PROG_CC_C_O # Needed for the various install and uninstall hooks. AC_PROG_INSTALL AC_PROG_SED AC_PROG_LN_S AC_PROG_MKDIR_P # Needed for creating the archives in lib/ and the shared libraries. AC_PROG_LIBTOOL if test "$ac_cv_prog_AR" = false; then AC_MSG_ERROR([The 'ar' utility was not found. Please put ar on the path.]) fi # We use pkg-config to set up the cflags and libs for gtk. AC_CHECK_PROG( [HAVE_PKG_CONFIG], [pkg-config], [yes], [no]) if test "$GCC" != "yes"; then AC_MSG_ERROR([Only GCC is currently supported. Please put gcc in the path.]) fi ### ### Libraries ### AC_PATH_XTRA # # Check for libintl.h. When configuring using "--without-x", /usr/local/include # may not be added to the include path, so code that use glib's i18n functions # would fail to compile because it can't find libintl.h. # AC_CHECK_HEADER([libintl.h], [], [have_libintl=no], []) if test "$have_libintl" = "no"; then unset ac_cv_header_libintl_h CPPFLAGS="$CPPFLAGS -I/usr/local/include" AC_CHECK_HEADER([libintl.h], [], [AC_MSG_ERROR([libintl.h not found. Make sure you have the gettext headers installed.])], []) fi AC_ARG_ENABLE([deploypkg], [AS_HELP_STRING([--disable-deploypkg], [do not build deploypkg plugin.])], [], [enable_deploypkg=yes]) if test "$enable_deploypkg" = "yes"; then AC_VMW_CHECK_LIB([mspack], [MSPACK], [libmspack], [], [0.0.20040308alpha], [mspack.h], [], [], [AC_MSG_ERROR([mspack >= 0.0.20040308alpha is required.])]) fi AC_ARG_ENABLE([grabbitmqproxy], [AS_HELP_STRING([--disable-grabbitmqproxy], [do not build grabbitmqproxy plugin.])], [], [enable_grabbitmqproxy=yes]) # # Check for glib 2.6.14 or greater. # AC_VMW_CHECK_LIB([glib-2.0], [GLIB2], [glib-2.0], [], [2.14.0], [glib.h], [g_key_file_new], [], [AC_MSG_ERROR([glib2 >= 2.14.0 is required.])]) AC_VMW_CHECK_LIB([gmodule-2.0], [GMODULE], [gmodule-2.0], [], [2.14.0], [], [], [], [AC_MSG_ERROR([gmodule >= 2.14.0 is required.])]) AC_VMW_CHECK_LIB([gobject-2.0], [GOBJECT], [gobject-2.0], [], [2.14.0], [glib-object.h], [], [], [AC_MSG_ERROR([gobject >= 2.14.0 is required.])]) AC_VMW_CHECK_LIB([gthread-2.0], [GTHREAD], [gthread-2.0], [], [2.14.0], [], [], [], [AC_MSG_ERROR([glib >= 2.14.0 is required.])]) AC_CHECK_PROG([have_genmarshal], [glib-genmarshal], [yes], [no]) if test "$have_genmarshal" != "yes"; then AC_MSG_ERROR([glib-genmarshal is required; make sure it's available in your path.]) fi # # Check for fuse. # AC_VMW_CHECK_LIB([fuse], [FUSE], [fuse], [], [], [fuse.h], [fuse_main], [have_fuse=yes], [have_fuse=no; AC_MSG_WARN([Fuse is missing, vmblock-fuse/vmhgfs-fuse will be disabled.])]) # # Check for PAM. # AC_ARG_WITH([pam], [AS_HELP_STRING([--without-pam], [compiles without PAM support.])], [], [with_pam=yes]) if test "$with_pam" = "yes"; then AC_VMW_DEFAULT_FLAGS([PAM]) AC_VMW_CHECK_LIB([pam], [PAM], [], [], [], [security/pam_appl.h], [pam_start], [PAM_CPPFLAGS="$PAM_CPPFLAGS -DUSE_PAM"], [AC_VMW_LIB_ERROR([PAM], [pam])]) fi AC_ARG_ENABLE([vgauth], [AS_HELP_STRING([--disable-vgauth], [do not build vgauth.])], [], [enable_vgauth=yes]) # # Check for openssl, xerces-c and xml-security-c # AC_ARG_WITH([ssl], [AS_HELP_STRING([--without-ssl], [compiles without openssl support (disables grabbitmqproxy and vgauth).])], [ enable_grabbitmqproxy=no enable_vgauth=no ], [with_ssl=yes]) AC_ARG_WITH([xmlsecurity], [AS_HELP_STRING([--without-xmlsecurity], [compiles without xml-security-c support (disables vgauth).])], [enable_vgauth=no], [with_xmlsecurity=yes]) AC_ARG_WITH([xerces], [AS_HELP_STRING([--without-xerces], [compiles without xerces support (disables vgauth).])], [enable_vgauth=no], [with_xerces=yes]) if test "$enable_vgauth" = "yes" -o "$enable_grabbitmqproxy" = "yes"; then AC_VMW_DEFAULT_FLAGS([SSL]) AC_VMW_CHECK_LIB([ssl], [SSL], [], [], [], [], [], [], [AC_VMW_LIB_ERROR([SSL], [ssl])]) fi if test "$enable_vgauth" = "yes"; then CPPFLAGS="$CPPFLAGS -DUSE_VGAUTH" AC_VMW_DEFAULT_FLAGS([XERCES]) AC_VMW_CHECK_LIB([xerces-c], [XERCES], [], [], [], [], [], [], [AC_VMW_LIB_ERROR([XERCES], [xerces-c])]) AC_VMW_DEFAULT_FLAGS([XMLSECURITY]) AC_VMW_CHECK_LIB([xml-security-c], [XMLSECURITY], [], [], [], [], [], [], [AC_VMW_LIB_ERROR([XMLSECURITY], [xml-security-c])]) fi # # Check for CUnit and disable test code if not available. # if test "$enable_tests" = "auto" -o "$enable_tests" = "yes"; then AC_VMW_DEFAULT_FLAGS([CUNIT]) AC_VMW_CHECK_LIB([cunit], [CUNIT], [], [], [], [CUnit/CUnit.h], [CU_initialize_registry], [have_cunit=yes], [have_cunit=no]) if test "$have_cunit" = "no"; then if test "$enable_tests" = "yes"; then AC_VMW_LIB_ERROR([CUNIT], [cunit]) else AC_MSG_WARN([CUnit not found, tests won't be compiled.]) fi fi fi # If the user explicitly disables X11, then don't try to detect the X-related libraries if test "$have_x" = "disabled"; then enable_multimon="no" elif test "$have_x" != "yes"; then AC_MSG_ERROR( [The X11 libraries were not found. Please configure without X11 (using --without-x), or install the libX11 devel package(s).]) else CPPFLAGS="$CPPFLAGS $X_CFLAGS" COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" AC_CHECK_LIB( [Xext], [XeviQueryVersion], [COMMON_XLIBS="-lXext $COMMON_XLIBS"], [AC_MSG_ERROR( [libXext not found. Please configure without X11 (using --without-x), or install the libXext devel package(s).])], [$COMMON_XLIBS]) AC_CHECK_HEADER( [X11/extensions/extutil.h], [], [AC_MSG_ERROR( [X11/extensions/extutil.h header not found - you're probably on Solaris 10 or older. Please copy that header file onto your system manually, or configure without X11 (using --without-x).])], [#include #include ]) if test "$enable_multimon" != "no"; then AC_CHECK_LIB( [Xinerama], [XineramaQueryVersion], [COMMON_XLIBS="-lXinerama $COMMON_XLIBS"], [AC_MSG_ERROR( [libXinerama not found. Please configure without multimon (using --disable-multimon), configure without X11 (using --without-x), or install the libXinerama devel package(s).])], [$COMMON_XLIBS]) fi AC_CHECK_LIB( [Xi], [XOpenDevice], [COMMON_XLIBS="-lXi $COMMON_XLIBS"], [AC_MSG_ERROR( [libXi not found. Please configure without X11 (using --without-x), or install the libXi devel package(s).])], [$COMMON_XLIBS]) AC_CHECK_LIB( [Xrender], [XRenderQueryVersion], [COMMON_XLIBS="-lXrender $COMMON_XLIBS"], [AC_MSG_ERROR( [libXrender not found. Please configure without X11 (using --without-x), or install the libXrender devel package(s).])], [$COMMON_XLIBS]) AC_CHECK_LIB( [Xrandr], [XRRQueryVersion], [COMMON_XLIBS="-lXrandr $COMMON_XLIBS"], [AC_MSG_ERROR( [libXrandr not found. Please configure without X11 (using --without-x) or install the libXrandr devel package(s).])], [$COMMON_XLIBS]) AC_CHECK_LIB( [Xtst], [XTestQueryExtension], [COMMON_XLIBS="-lXtst $COMMON_XLIBS"], [AC_MSG_ERROR( [libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s).])], [$COMMON_XLIBS]) AC_CHECK_LIB( [SM], [SmcOpenConnection], [XSM_LIBS="-lSM -lICE" && have_xsm_lib="yes"], [] [-lICE]) AC_CHECK_HEADERS([X11/SM/SMlib.h X11/ICE/ICElib.h], [have_xsm_header="yes"], [], []) if test "$have_xsm_lib" = "yes" -a "$have_xsm_header" = "yes"; then have_xsm="yes" fi AC_CHECK_LIB( [Xcomposite], [XCompositeQueryExtension], [XCOMPOSITE_LIBS="-lXcomposite"], [have_xcomposite="no"] []) AC_CHECK_HEADERS([X11/extensions/Xcomposite.h], [], [have_xcomposite="no"], []) if test "$have_xcomposite" != "no"; then have_xcomposite="yes" fi # Check whether we have gtk+ 2.0. if test "$with_gtk2" != "no"; then # gdk_display_get_default_group (added in gtk+ 2.4.0) is function currently # needed by vmware-user. AC_VMW_CHECK_LIB([gtk-x11-2.0], [GTK], [gtk+-2.0], [], [2.4.0], [gtk/gtk.h], [gdk_display_get_default_group], [GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2"], [AC_MSG_ERROR([Gtk+ 2.0 library not found or too old. Please configure without Gtk+ support (using --without-gtk2) or install the Gtk+ 2.0 devel package.])]) fi # # Check for gtkmm 2.4.0 or greater. # if test "$with_gtkmm" != "no"; then CUSTOM_GTKMM_CPPFLAGS="$CUSTOM_GTKMM_CPPFLAGS $GTK_CPPFLAGS" AC_VMW_CHECK_LIBXX([gtkmm-2.4], [GTKMM], [gtkmm-2.4], [], [2.4.0], [gtkmm.h], [], [GTKMM_CPPFLAGS="$GTKMM_CPPFLAGS -DHAVE_GTKMM"], [AC_MSG_ERROR([gtkmm library not found. Please install the libgtkmm devel package(s), or re-configure using --without-gtkmm.])]) fi fi # End of checks for X libraries AC_CHECK_LIB( [crypt], [crypt], [HAVE_CRYPT="yes"], [AC_MSG_ERROR( [libcrypt not found. Please install the libc/libcrypt devel package(s).])]) AC_CHECK_FUNCS( dlopen, , [AC_CHECK_LIB( dl, dlopen, [VIX_LIBADD="$VIX_LIBADD -ldl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -ldl" VGAUTH_LIBADD="$VGAUTH_LIBADD -ldl" ], [AC_MSG_ERROR( [dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor.])])]) AC_CHECK_FUNCS([ecvt]) AC_CHECK_FUNCS([fcvt]) if test "$os" = "freebsd" -a "$osVersion" -ge 600000; then AC_CHECK_LIB( [thr], [pthread_mutex_init], [THREAD_LIB=-lthr], [AC_MSG_ERROR( [Unable to locate required threading library libthr.])]) else AC_CHECK_LIB( [pthread], [pthread_mutex_init], [THREAD_LIB=-lpthread], [AC_MSG_ERROR( [libpthread not found. Please install the libc/libpthread devel package(s).])]) fi # PAM prefix AC_ARG_WITH([pam-prefix], [AS_HELP_STRING([--with-pam-prefix], [specifies where pam files go. Default is $(sysconfdir)])], [PAM_PREFIX="$withval"], [PAM_PREFIX='$(sysconfdir)']) if test "$os" = "linux"; then AC_ARG_WITH([procps], [AS_HELP_STRING([--without-procps], [compiles without libproc (disables support for meminfo)])], [], [with_procps=yes]) else with_procps="no" fi if test "$with_procps" = "yes"; then have_procps=no if test -z "$CUSTOM_PROCPS_NAME" && test -z "$CUSTOM_PROCPS_LIBS"; then # See if we have procps-ng (that finally supports pkg-config). AC_VMW_CHECK_LIB([procps-ng], [PROCPS], [libprocps], [], [], [], [], [ have_procps=yes; ], []) fi if test "$have_procps" = "no"; then # Let's see if there is an older procps version, one that does not # support pkg-config. if test -z "$CUSTOM_PROCPS_NAME"; then CUSTOM_PROCPS_NAME=proc fi # XXX: no pkg-config and no procps-config means we need to # hard-code a sensible default. if test -z "$CUSTOM_PROCPS_LIBS"; then CUSTOM_PROCPS_LIBS="-L/lib" fi # Some distros provide libproc-${version}.so only, others provide the # libproc.so symlink. Try both to see what sticks (but only try the 3.2.7 # and 3.2.8 versions - adding every possible version here would be a mess). # # Users can help by providing CUSTOM_PROCPS_NAME / CUSTOM_PROCPS_LIBS if # necessary. AC_VMW_CHECK_LIB([$CUSTOM_PROCPS_NAME], [PROCPS], [], [], [], [], [getstat], [ have_procps=yes; ], []) fi if test "$have_procps" = "no"; then AC_VMW_CHECK_LIB([proc-3.2.8], [PROCPS], [], [], [], [], [getstat], [ have_procps=yes; ], []) fi if test "$have_procps" = "no"; then AC_VMW_CHECK_LIB([proc-3.2.7], [PROCPS], [], [], [], [], [getstat], [], [AC_MSG_ERROR([libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])]) fi fi if test "$with_procps" != "yes"; then AC_DEFINE([NO_PROCPS], 1, [Define to 1 if building without procps.]) fi AC_ARG_WITH([dnet], [AS_HELP_STRING([--without-dnet], [compiles without libdnet (disables support for nicinfo)])], [], [with_dnet=yes]) have_dnet="no" if test "$with_dnet" = "yes"; then # On Debian, dnet is installed via the libdumbnet package. We need to # detect this so that our source files include dumbnet.h instead of # dnet.h, which is part of a different package altogether. AC_VMW_CHECK_LIB([dumbnet], [DNET], [], [dumbnet-config], [], [dumbnet.h], [intf_open], [have_dnet="yes"; AC_DEFINE([DNET_IS_DUMBNET], 1, [Define to 1 if substituting Debian's libdumbnet for libdnet.])], []) if test $have_dnet = "no"; then AC_VMW_CHECK_LIB([dnet], [DNET], [], [dnet-config], [], [dnet.h], [intf_open], [have_dnet="yes"], []) fi if test $have_dnet = "no"; then AC_MSG_ERROR( [dnet-config was not found on your PATH. Please configure without dnet (using --without-dnet) or install dnet - http://libdnet.sourceforge.net]) fi fi if test "$with_dnet" != "yes"; then AC_DEFINE([NO_DNET], 1, [Define to 1 if building without libdnet.]) fi AC_ARG_WITH([icu], [AS_HELP_STRING([--without-icu], [disables support for ICU])], [], [with_icu=yes]) if test "$have_x" = "yes" -o "$with_icu" = "yes"; then AC_CHECK_TOOL([have_cxx], [$CXX], [no]) if test "$have_cxx" = "no"; then AC_MSG_ERROR([C++ compiler not found. Make sure you have a C++ compiler installed or configure without X11 (using --without-x) and without ICU (using --without-icu).]) fi fi if test "$with_icu" = "yes"; then AC_VMW_CHECK_LIBXX([icuuc], [ICU], [], [icu-config], [], [unicode/utf.h], [], [ICU_CPPFLAGS="$ICU_CPPFLAGS -DUSE_ICU"], [AC_MSG_ERROR([ICU library not found. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org])]) # Check whether we have ICU >= 3.8. AC_LANG_PUSH([C++]) AC_MSG_CHECKING([for ucasemap_utf8ToTitle in ICU]) ORIGINAL_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" AC_TRY_COMPILE([#include ], [ (void) &ucasemap_utf8ToTitle; return 0; ], [ ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" AC_MSG_RESULT([yes]) ], [AC_MSG_RESULT([no])]) CPPFLAGS="$ORIGINAL_CPPFLAGS" AC_LANG_POP([C++]) # Easier to give all modules the ICU defines/includes... CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" else CPPFLAGS="$CPPFLAGS -DNO_ICU" fi AC_PATH_PROG( [RPCGEN], [rpcgen], [ AC_MSG_ERROR([rpcgen not found. Please install the libc devel package.]) ]) ### ### Headers ### AC_CHECK_HEADERS([crypt.h]) AC_CHECK_HEADERS([inttypes.h]) AC_CHECK_HEADERS([stdint.h]) AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([wchar.h]) AC_CHECK_HEADERS([sys/inttypes.h]) AC_CHECK_HEADERS([sys/io.h]) AC_CHECK_HEADERS([sys/param.h]) # Required to make the sys/user.h check work correctly on FreeBSD AC_CHECK_HEADERS([sys/sysinfo.h]) AC_CHECK_HEADERS([sys/types.h]) AC_CHECK_HEADERS([sys/user.h], [], [], [ #ifdef HAVE_SYS_PARAM_H # include #endif ]) AC_CHECK_HEADERS([sys/vfs.h]) AC_CHECK_HEADERS([syslimits.h]) AC_CHECK_HEADERS([unwind.h]) AC_CHECK_HEADER( [wchar.h], [HAVE_WCHAR_H="yes"], [HAVE_WCHAR_H="no"]) if test "$os" = "linux"; then # Make sure kernel-headers package is installed. AC_CHECK_HEADER( [linux/unistd.h], [], [AC_MSG_ERROR(linux/unistd.h is not found. Please install kernel-headers/linux-userspace-headers/linux-libc-dev package.)]) fi if test "$enable_multimon" != "no"; then AC_CHECK_HEADER( [X11/extensions/panoramiXproto.h], [], [AC_MSG_ERROR( [panoramiXproto.h not found. Please configure without multimon (using --disable-multimon) or install the libXinerama devel package(s).])], [#include #include ]) fi bsdPrintfWrappers=no if test "$os" = "linux"; then AC_CHECK_LIB([c], [ecvt], [bsdPrintfWrappers=yes], []) fi ### ### Typdefs, structs, and compiler quarks. ### AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_UID_T AC_C_INLINE AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_HEADER_TIME AC_STRUCT_TM AC_C_VOLATILE ### ### Specific features and OS/arch flags / actions ### ### General flags / actions CFLAGS="$CFLAGS -Wall" CFLAGS="$CFLAGS -Werror" # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' # in Xlib.h on OpenSolaris. # Glib2 keep changing mutex APIs so we also need to disable 'deprecated' # warnings for now (-Wno-deprecated-declarations). for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized -Wno-deprecated-declarations; do AC_MSG_CHECKING([for GCC flag $TEST_CFLAG]) ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" NEW_CFLAG="" AC_TRY_COMPILE( [], [ return 0; ], [NEW_CFLAG=" $TEST_CFLAG" AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG" done CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS" CPPFLAGS="$CPPFLAGS" # -fvisibility is used by "core service" plugins, but not required. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fvisibility=hidden" AC_MSG_CHECKING([for GCC flag -fvisibility]) AC_TRY_COMPILE([], [return 0;], [PLUGIN_CPPFLAGS="-fvisibility=hidden -DGCC_EXPLICIT_EXPORT"; AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CFLAGS="$ORIGINAL_CFLAGS" # Detect "unused-but-set-variable" gcc warning and disable it. ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wno-unused-but-set-variable" AC_MSG_CHECKING([for GCC flag -Wno-unused-but-set-variable]) AC_TRY_COMPILE([], [return 0;], [ORIGINAL_CFLAGS="$ORIGINAL_CFLAGS -Wno-unused-but-set-variable"; AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) CFLAGS="$ORIGINAL_CFLAGS" BUILDDIR="`pwd`" INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" BLD_INCLUDE_DIR="$BUILDDIR/lib/include" CPPFLAGS="-I$INCLUDE_DIR -I$BLD_INCLUDE_DIR $CPPFLAGS" ### ### Documentation. ### if test "$enable_docs" = "yes"; then AC_CHECK_PROG([have_doxygen], [doxygen], [yes], [no]) if test "$have_doxygen" = "no"; then AC_MSG_WARN([doxygen not found; API documentation will not be generated.]) else AC_PATH_PROG([DOT], [dot], []) if test "$DOT" = ""; then HAVE_DOT=NO else DOT=`dirname $DOT` HAVE_DOT=YES fi AC_SUBST([DOT]) AC_SUBST([HAVE_DOT]) AC_PATH_PROG([MSCGEN], [mscgen], [no]) if test "$MSCGEN" != "no"; then MSCGEN_DIR="`dirname $MSCGEN`" else MSCGEN_DIR= fi AC_SUBST([MSCGEN_DIR]) fi fi ### ### OS/arch-specific flags / actions ### MODULES="" MODULES_OS="$os" TARGET_OS="$os" MODULES_DIR="" buildHgfsmounter=no if test "$os" = "linux"; then MODULES_DIR="$LINUXDIR/kernel/" CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64" CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500" CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" CPPFLAGS="$CPPFLAGS -D_SVID_SOURCE" CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrt" # vmxnet is not supported for kernels 3.3.0 and newer if test "$osVersion" -lt 303000; then MODULES="$MODULES vmxnet" fi # See if we need vmhgfs module. Starting with 4.0.0 we use FUSE if test "$osVersion" -lt 400000; then MODULES="$MODULES vmhgfs" fi # See if we need vmci and vsock modules. Starting with 3.9 they made # their way into mainline kernel. if test "$osVersion" -lt 309000; then MODULES="$MODULES vmci vsock" fi if test "$osVersion" -lt 300000; then MODULES="$MODULES vmblock vmsync" fi buildHgfsmounter=yes fi if test "$os" = "freebsd" || test "$os" = "kfreebsd-gnu"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lkvm" MODULES_DIR="/boot/modules" if test "$osVersion" -ge 302000; then MODULES="$MODULES vmmemctl" fi if test "$osVersion" -ge 409000; then MODULES="$MODULES vmxnet" fi if test "$osVersion" -ge 600000; then MODULES="$MODULES vmblock" fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building FreeBSD kernel modules. Make sure you use " echo " 'make' to build open-vm-tools, and not GNU make ('gmake'). " echo "****************************************************************" fi fi if test "$os" = "solaris"; then LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lsocket" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lnsl" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lresolv" LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lrpcsvc" # Setup defines to identify the OS version. if test "$osVersion" -eq 509000; then CPPFLAGS="$CPPFLAGS -DSOL9" fi if test "$osVersion" -eq 510000; then CPPFLAGS="$CPPFLAGS -DSOL10" fi if test "$osVersion" -eq 511000; then CPPFLAGS="$CPPFLAGS -DSOL11" fi MODULES="$MODULES vmxnet vmmemctl" # HGFS and vmblock need Solaris 10 at least. if test "$osVersion" -ge 510000; then MODULES="$MODULES vmhgfs vmblock" fi # vmxnet3 is built on Solaris 10 / 11 only if GLDv3 is installed. if test "$osVersion" -gt 510000; then AC_CHECK_HEADER( [sys/mac.h], [MODULES="$MODULES vmxnet3"], [AC_MSG_WARN([GLDv3 (sys/mac.h) is not installed, vmxnet3 will not be compiled.])]) fi if test "$with_kernel_modules" = "yes"; then echo "****************************************************************" echo " You are building Solaris kernel modules. Make sure you use " echo " GNU make to build open-vm-tools. " echo "****************************************************************" fi fi AM_CONDITIONAL(BUILD_HGFSMOUNTER, test "$buildHgfsmounter" = "yes") AM_CONDITIONAL(LINUX, test "$os" = "linux") AM_CONDITIONAL(SOLARIS, test "$os" = "solaris") AM_CONDITIONAL(FREEBSD, test "$os" = "freebsd" -o "$os" = "kfreebsd-gnu") AM_CONDITIONAL(FREEBSD_CUSTOM_SYSDIR, test \( "$os" = "freebsd" -o "$os" = "kfreebsd-gnu" \) -a -n "$SYSDIR") AM_CONDITIONAL(THIRTY_TWO_BIT_USERSPACE, test "$userSpaceBitness" = "32") AM_CONDITIONAL(HAVE_X11, test "$have_x" = "yes") AM_CONDITIONAL(HAVE_ICU, test "$with_icu" = "yes") AM_CONDITIONAL(WITH_KERNEL_MODULES, test "$with_kernel_modules" = "yes") AM_CONDITIONAL(HAVE_XSM, test "$have_xsm" = "yes") AM_CONDITIONAL(HAVE_XCOMPOSITE, test "$have_xcomposite" = "yes") AM_CONDITIONAL(ENABLE_TESTS, test "$have_cunit" = "yes") AM_CONDITIONAL(WITH_ROOT_PRIVILEGES, test "$with_root_privileges" = "yes") AM_CONDITIONAL(HAVE_DNET, test "$have_dnet" = "yes") AM_CONDITIONAL(HAVE_DOXYGEN, test "$have_doxygen" = "yes") AM_CONDITIONAL(HAVE_FUSE, test "$have_fuse" = "yes") AM_CONDITIONAL(HAVE_GNU_LD, test "$with_gnu_ld" = "yes") AM_CONDITIONAL(HAVE_GTKMM, test "$have_x" = "yes" -a "$with_gtkmm" = "yes") AM_CONDITIONAL(HAVE_PAM, test "$with_pam" = "yes") AM_CONDITIONAL(USE_SLASH_PROC, test "$os" = "linux") AM_CONDITIONAL(USE_PRINTF_WRAPPERS, test "$bsdPrintfWrappers" = "yes") AM_CONDITIONAL(ENABLE_DEPLOYPKG, test "$enable_deploypkg" = "yes") AM_CONDITIONAL(ENABLE_GRABBITMQPROXY, test "$enable_grabbitmqproxy" = "yes") AM_CONDITIONAL(ENABLE_VGAUTH, test "$enable_vgauth" = "yes") AM_CONDITIONAL(HAVE_VSOCK, test "$os" = "linux") if test "$have_xsm" != "yes"; then AC_DEFINE([NO_XSM], 1, []) fi if test "$have_xcomposite" != "yes"; then AC_DEFINE([NO_XCOMPOSITE]) fi ### Feature-specific flags / actions # Combine where possible # If control reaches this point and multimon is still enabled, then we know # all of the tests for required components have passed and it's safe to allow # multimon. Otherwise, it should be disabled. if test "$enable_multimon" = "no"; then # XXX: For consistency, change this to ENABLE_MULTIMON. This will require # some additional code cleanup. AC_DEFINE([NO_MULTIMON], 1, [Define to 1 if building without multimon support.]) fi LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS $PAM_CPPFLAGS" if test "$HAVE_CRYPT" = "yes"; then LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD -lcrypt" VIX_LIBADD="$VIX_LIBADD -lcrypt" fi LIBVMTOOLS_LIBADD="$LIBVMTOOLS_LIBADD $THREAD_LIB" VIX_LIBADD="$VIX_LIBADD $THREAD_LIB" ### Core Services definitions. HGFS_LIBS="$BUILDDIR/libhgfs/libhgfs.la" VMTOOLS_LIBS="$BUILDDIR/libvmtools/libvmtools.la $GLIB2_LIBS" VMTOOLS_CPPFLAGS="-DVMTOOLS_USE_GLIB $GLIB2_CPPFLAGS" PLUGIN_CPPFLAGS="$VMTOOLS_CPPFLAGS $PLUGIN_CPPFLAGS" PLUGIN_LDFLAGS="-Wl,-z,defs -Wl,-lc -shared -module -avoid-version" # In Solaris, the XDR-related functions are not in libc like in Linux and # FreeBSD, so binaries need to be linked to some extra libraries. XDR_LIBS= if test "$os" = "solaris"; then XDR_LIBS="-lnsl -lrpcsvc" fi # Installation directories for core services plugins. TEST_PLUGIN_INSTALLDIR=$datadir/open-vm-tools/tests COMMON_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/common VMSVC_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmsvc VMUSR_PLUGIN_INSTALLDIR=$libdir/open-vm-tools/plugins/vmusr # General definitions INSTVMSG='$(SHELL) $(top_srcdir)/scripts/build/instvmsg.sh' RPCGEN_WRAPPER='$(SHELL) $(top_builddir)/scripts/build/rpcgen_wrapper.sh' ### General substs AC_SUBST([HGFS_LIBS]) AC_SUBST([TOOLS_VERSION]) AC_SUBST([TARGET_OS]) AC_SUBST([KERNEL_RELEASE]) AC_SUBST([LINUXINCLUDE]) AC_SUBST([MODULES_OS]) AC_SUBST([MODULES_DIR]) AC_SUBST([MODULES]) AC_SUBST([COMMON_XLIBS]) AC_SUBST([XSM_LIBS]) AC_SUBST([XCOMPOSITE_LIBS]) AC_SUBST([PAM_PREFIX]) AC_SUBST([PLUGIN_CPPFLAGS]) AC_SUBST([PLUGIN_LDFLAGS]) AC_SUBST([VMTOOLS_CPPFLAGS]) AC_SUBST([VMTOOLS_LIBS]) AC_SUBST([RPCGENFLAGS]) AC_SUBST([XDR_LIBS]) AC_SUBST([TEST_PLUGIN_INSTALLDIR]) AC_SUBST([COMMON_PLUGIN_INSTALLDIR]) AC_SUBST([VMSVC_PLUGIN_INSTALLDIR]) AC_SUBST([VMUSR_PLUGIN_INSTALLDIR]) if test "$os" = "freebsd" -a -n "$SYSDIR"; then # If SYSDIR is not defined, AC_SUBST expands to nothing, so we need something # inside this block. true AC_SUBST([SYSDIR]) fi AC_SUBST([INSTVMSG]) AC_SUBST([RPCGEN_WRAPPER]) ### Lib substs AC_SUBST([LIB_AUTH_CPPFLAGS]) AC_SUBST([LIB_IMPERSONATE_CPPFLAGS]) AC_SUBST([LIB_USER_CPPFLAGS]) AC_SUBST([LIBVMTOOLS_LIBADD]) ### Program substs AC_SUBST([VIX_LIBADD]) AC_SUBST([VGAUTH_LIBADD]) ### ### Create the Makefiles ### AC_CONFIG_FILES([ \ Makefile \ lib/Makefile \ lib/appUtil/Makefile \ lib/auth/Makefile \ lib/backdoor/Makefile \ lib/asyncsocket/Makefile \ lib/sslDirect/Makefile \ lib/pollGtk/Makefile \ lib/poll/Makefile \ lib/dataMap/Makefile \ lib/hashMap/Makefile \ lib/dict/Makefile \ lib/dynxdr/Makefile \ lib/err/Makefile \ lib/file/Makefile \ lib/foundryMsg/Makefile \ lib/glibUtils/Makefile \ lib/guestApp/Makefile \ lib/guestRpc/Makefile \ lib/hgfs/Makefile \ lib/hgfsBd/Makefile \ lib/hgfsHelper/Makefile \ lib/hgfsServer/Makefile \ lib/hgfsServerManagerGuest/Makefile \ lib/hgfsServerPolicyGuest/Makefile \ lib/hgfsUri/Makefile \ lib/impersonate/Makefile \ lib/lock/Makefile \ lib/message/Makefile \ lib/misc/Makefile \ lib/netUtil/Makefile \ lib/nicInfo/Makefile \ lib/panic/Makefile \ lib/panicDefault/Makefile \ lib/procMgr/Makefile \ lib/rpcChannel/Makefile \ lib/rpcIn/Makefile \ lib/rpcOut/Makefile \ lib/rpcVmx/Makefile \ lib/slashProc/Makefile \ lib/string/Makefile \ lib/stubs/Makefile \ lib/syncDriver/Makefile \ lib/system/Makefile \ lib/unicode/Makefile \ lib/user/Makefile \ lib/vmCheck/Makefile \ lib/vmSignal/Makefile \ lib/wiper/Makefile \ lib/xdg/Makefile \ services/Makefile \ services/vmtoolsd/Makefile \ services/plugins/Makefile \ services/plugins/desktopEvents/Makefile \ services/plugins/dndcp/Makefile \ services/plugins/grabbitmqProxy/Makefile \ services/plugins/guestInfo/Makefile \ services/plugins/hgfsServer/Makefile \ services/plugins/powerOps/Makefile \ services/plugins/resolutionSet/Makefile \ services/plugins/timeSync/Makefile \ services/plugins/vix/Makefile \ services/plugins/vmbackup/Makefile \ services/plugins/deployPkg/Makefile \ vmware-user-suid-wrapper/Makefile \ toolbox/Makefile \ hgfsclient/Makefile \ hgfsmounter/Makefile \ checkvm/Makefile \ rpctool/Makefile \ namespacetool/Makefile \ guestproxycerttool/Makefile \ vgauth/Makefile \ vgauth/lib/Makefile \ vgauth/cli/Makefile \ vgauth/service/Makefile \ libguestlib/Makefile \ libguestlib/vmguestlib.pc \ libDeployPkg/Makefile \ libDeployPkg/libDeployPkg.pc \ libhgfs/Makefile \ libvmtools/Makefile \ xferlogs/Makefile \ modules/Makefile \ vmblock-fuse/Makefile \ vmhgfs-fuse/Makefile \ vmblockmounter/Makefile \ tests/Makefile \ tests/vmrpcdbg/Makefile \ tests/testDebug/Makefile \ tests/testPlugin/Makefile \ tests/testVmblock/Makefile \ docs/Makefile \ docs/api/Makefile \ scripts/Makefile \ scripts/build/rpcgen_wrapper.sh \ ]) ### ### Output ### AC_OUTPUT open-vm-tools-10.0.7-3227872/COPYING0000644000000000000000000006347112660700525014721 0ustar rootroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! open-vm-tools-10.0.7-3227872/docs/0000755000000000000000000000000012660700525014603 5ustar rootrootopen-vm-tools-10.0.7-3227872/docs/api/0000755000000000000000000000000012660700525015354 5ustar rootrootopen-vm-tools-10.0.7-3227872/docs/api/services/0000755000000000000000000000000012660700525017177 5ustar rootrootopen-vm-tools-10.0.7-3227872/docs/api/services/debug.txt0000644000000000000000000000576112660700525021037 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *********************************************************/ /** @defgroup vmtools_debug Debugging Tools Plugins @brief Defines functions and interfaces for debugging Tools plugins. This module provides functions for writing "debug plugins" - plugins which provide functionality for driving the Tools Services when they're running in "debug mode". Debug plugins are dynamically loaded by providing specific command-line options to the Tools service process. @section vmtools_debug_how How debug plugins work Currently, there's only support for GuestRPC-based debug plugins. The debug library implements an RPC channel that can be driven by a debug plugin, according to information provided by the plugin at load time. The debug plugin can provide two types of information: - RPCs to be sent to the application: these are input to the application, and can be tied to a validation function to make sure the response from the application is correct. - Validation functions for "outgoing" RPCs: these are functions called in response to RPCs initiated by the applications; they can be mapped to specific RPC command strings, to make writing the plugin easier. For more details, check the RpcDebugPlugin data structure. Plugins that depend on events that are not only responses to RPC messages (such as timer-based outgoing RPCs) should make sure they tell the library that it should not stop running by incrementing its ref count (see RpcDebug_IncRef()). When the test is complete, the code can then call RpcDebug_DecRef() and, when the ref count reaches zero, the main application loop will be stopped. */ open-vm-tools-10.0.7-3227872/docs/api/services/guestrpc.txt0000644000000000000000000000311112660700525021570 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *********************************************************/ /** @defgroup vmtools_guestrpc GuestRPC functions @brief Functions related to reading and writing data on a GuestRPC channel. */ open-vm-tools-10.0.7-3227872/docs/api/services/main.doxy0000644000000000000000000000400112660700525021023 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *********************************************************/ /** @mainpage VMware Tools Core API The Tools Core API provides functionality for extending Tools by building plugins, and loading them as part of the existing Tools services or by creating new plugin containers. @section tc_main_plugins Basic Plugin Functionality - @ref vmtools_plugins - @ref vmtools_guestrpc - @ref vmtools_vmcf @section tc_main_utils Miscelaneous Utilities - @ref vmtools_utils - @ref vmtools_logging - @ref vmtools_threads - @ref vmtools_i18n @section tc_main_debug Debugging Support - @ref vmtools_debug */ open-vm-tools-10.0.7-3227872/docs/api/services/plugins.txt0000644000000000000000000000414012660700525021420 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *********************************************************/ /** @defgroup vmtools_plugins VMware Tools Plugins @brief Defines the API used by the Tools Services for dynamically loading plugins. Plugins are dynamically loaded into the Tools service process, and may provide applications that hook into the functionality provided by the service, such as the glib main loop and the GuestRPC channel. Plugins that want to remain loaded by the service should always return registration data when their registration function (ToolsPluginOnLoad()) is called. The registration data, defined by the ToolsPluginData data structure, provides information about what events the plugin is interested in (for example, incoming RPCs). */ open-vm-tools-10.0.7-3227872/docs/api/Makefile.am0000644000000000000000000000535612660700525017421 0ustar rootroot################################################################################ ### Copyright (C) 2009-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ DOXYGEN_INPUT = DOXYGEN_INPUT += $(top_srcdir)/docs/api DOXYGEN_INPUT += $(top_srcdir)/docs/api/services DOXYGEN_INPUT += $(top_srcdir)/lib/include/vmware/tools DOXYGEN_INPUT += $(top_srcdir)/libvmtools DOXYGEN_INPUT += $(top_srcdir)/tests/vmrpcdbg DOXYGEN_CPP_PREDEFINED = DOXYGEN_CPP_PREDEFINED += G_LOCK_DEFINE_STATIC(x) DOXYGEN_CPP_PREDEFINED += G_LOG_DOMAIN= DOXYGEN_CPP_EXPAND = DOXYGEN_EXTRA_PATTERNS = DOXYGEN_EXTRA_PATTERNS += *.c DOXYGEN_EXTRA_PATTERNS += *.doxy DOXYGEN_EXTRA_PATTERNS += *.h DOXYGEN_EXTRA_PATTERNS += *.txt # This rule has no dependencies, so it's executed every time. Not optimal, # but generation of the docs is pretty quick, and having the right dependencies # here is very non-trivial. build/index.html: mkdir -p build sed \ -e 's,##{BUILD_DIR}##,$(top_builddir),' \ -e 's,##{BUILD_OUTPUT}##,build,' \ -e 's,##{CLIENT_ROOT}##,$(top_srcdir),' \ -e 's,##{CPP_EXPAND}##,$(DOXYGEN_CPP_EXPAND),' \ -e 's,##{CPP_PREDEFINED}##,$(DOXYGEN_CPP_PREDEFINED),' \ -e 's,##{DOT}##,@DOT@,' \ -e 's,##{FILE_PATTERNS}##,$(DOXYGEN_EXTRA_PATTERNS),' \ -e 's,##{HAVE_DOT}##,@HAVE_DOT@,' \ -e 's,##{INCLUDE_PATHS}##,$(top_srcdir)/lib/include,' \ -e 's,##{INPUT_PATHS}##,$(DOXYGEN_INPUT),' \ -e 's,##{MSCGEN_DIR}##,@MSCGEN_DIR@,' \ -e 's,##{PERL}##,,' \ -e 's,##{PROJECT_NAME}##,@PACKAGE_STRING@,' \ -e 's,##{PROJECT_VERSION}##,@TOOLS_VERSION@,' \ -e 's,##{WARNING_LOG}##,warnings.log,' \ $(top_srcdir)/docs/api/doxygen.conf > doxygen.parsed.conf doxygen doxygen.parsed.conf > /dev/null all-local: build/index.html install-data-local: mkdir -p $(DESTDIR)$(docdir)/api cp -r build/* $(DESTDIR)$(docdir)/api open-vm-tools-10.0.7-3227872/docs/api/doxygen.conf0000644000000000000000000001115612660700525017704 0ustar rootroot### ### profile-api.conf - "Public API" Doxygen profile. Includes only non-static ### functions and non-internal documentation. ### #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "##{PROJECT_NAME}##" PROJECT_NUMBER = "##{PROJECT_VERSION}##" OUTPUT_DIRECTORY = ##{BUILD_OUTPUT}## TAB_SIZE = 3 OPTIMIZE_OUTPUT_FOR_C = YES FULL_PATH_NAMES = YES STRIP_FROM_PATH = ##{CLIENT_ROOT}## #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_LOCAL_CLASSES = NO #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = YES WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = ##{WARNING_LOG}## #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ##{INPUT_PATHS}## FILE_PATTERNS = ##{FILE_PATTERNS}## #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = YES INCLUDE_PATH = ##{INCLUDE_PATHS}## PREDEFINED = ##{CPP_PREDEFINED}## EXPAND_AS_DEFINED = ##{CPP_EXPAND}## #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = ##{PERL}## #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES MSCGEN_PATH = ##{MSCGEN_DIR}## HIDE_UNDOC_RELATIONS = YES HAVE_DOT = ##{HAVE_DOT}## CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO CALLER_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = ##{DOT}## DOTFILE_DIRS = DOT_GRAPH_MAX_NODES = 50 MAX_DOT_GRAPH_DEPTH = 0 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = NO #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO open-vm-tools-10.0.7-3227872/docs/api/Makefile.in0000644000000000000000000003312712660700525017427 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2009-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = docs/api DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ DOXYGEN_INPUT = $(top_srcdir)/docs/api $(top_srcdir)/docs/api/services \ $(top_srcdir)/lib/include/vmware/tools \ $(top_srcdir)/libvmtools $(top_srcdir)/tests/vmrpcdbg DOXYGEN_CPP_PREDEFINED = G_LOCK_DEFINE_STATIC(x) G_LOG_DOMAIN= DOXYGEN_CPP_EXPAND = DOXYGEN_EXTRA_PATTERNS = *.c *.doxy *.h *.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(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 docs/api/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/api/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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 all-local 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 dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: all all-am all-local 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-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am 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 # This rule has no dependencies, so it's executed every time. Not optimal, # but generation of the docs is pretty quick, and having the right dependencies # here is very non-trivial. build/index.html: mkdir -p build sed \ -e 's,##{BUILD_DIR}##,$(top_builddir),' \ -e 's,##{BUILD_OUTPUT}##,build,' \ -e 's,##{CLIENT_ROOT}##,$(top_srcdir),' \ -e 's,##{CPP_EXPAND}##,$(DOXYGEN_CPP_EXPAND),' \ -e 's,##{CPP_PREDEFINED}##,$(DOXYGEN_CPP_PREDEFINED),' \ -e 's,##{DOT}##,@DOT@,' \ -e 's,##{FILE_PATTERNS}##,$(DOXYGEN_EXTRA_PATTERNS),' \ -e 's,##{HAVE_DOT}##,@HAVE_DOT@,' \ -e 's,##{INCLUDE_PATHS}##,$(top_srcdir)/lib/include,' \ -e 's,##{INPUT_PATHS}##,$(DOXYGEN_INPUT),' \ -e 's,##{MSCGEN_DIR}##,@MSCGEN_DIR@,' \ -e 's,##{PERL}##,,' \ -e 's,##{PROJECT_NAME}##,@PACKAGE_STRING@,' \ -e 's,##{PROJECT_VERSION}##,@TOOLS_VERSION@,' \ -e 's,##{WARNING_LOG}##,warnings.log,' \ $(top_srcdir)/docs/api/doxygen.conf > doxygen.parsed.conf doxygen doxygen.parsed.conf > /dev/null all-local: build/index.html install-data-local: mkdir -p $(DESTDIR)$(docdir)/api cp -r build/* $(DESTDIR)$(docdir)/api # 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: open-vm-tools-10.0.7-3227872/docs/Makefile.am0000644000000000000000000000165612660700525016647 0ustar rootroot################################################################################ ### Copyright (C) 2009-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ SUBDIRS = if HAVE_DOXYGEN SUBDIRS += api endif open-vm-tools-10.0.7-3227872/docs/Makefile.in0000644000000000000000000004261212660700525016655 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2009-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ @HAVE_DOXYGEN_TRUE@am__append_1 = api subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = api DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = $(am__append_1) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(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 docs/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu docs/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # 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" $(RECURSIVE_CLEAN_TARGETS): @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) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done 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 Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-exec-am: install-html: install-html-recursive install-info: install-info-recursive install-man: install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -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: .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic clean-libtool \ ctags ctags-recursive distclean 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-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-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: open-vm-tools-10.0.7-3227872/guestproxycerttool/0000755000000000000000000000000012660700525017660 5ustar rootrootopen-vm-tools-10.0.7-3227872/guestproxycerttool/Makefile.am0000644000000000000000000000342512660700525021720 0ustar rootroot################################################################################ ### Copyright (C) 2014-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ bin_PROGRAMS = vmware-guestproxycerttool vmware_guestproxycerttool_LDADD = vmware_guestproxycerttool_LDADD += @SSL_LIBS@ vmware_guestproxycerttool_LDADD += -lcrypto vmware_guestproxycerttool_LDADD += @GLIB2_LIBS@ vmware_guestproxycerttool_CPPFLAGS = vmware_guestproxycerttool_CPPFLAGS += @SSL_CPPFLAGS@ vmware_guestproxycerttool_CPPFLAGS += @GLIB2_CPPFLAGS@ vmware_guestproxycerttool_SOURCES = vmware_guestproxycerttool_SOURCES += cert_key.c vmware_guestproxycerttool_SOURCES += cert_util.c vmware_guestproxycerttool_SOURCES += cert_tool.c if HAVE_ICU vmware_guestproxycerttool_LDADD += @ICU_LIBS@ vmware_guestproxycerttool_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXX) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ else vmware_guestproxycerttool_LINK = $(LINK) endif open-vm-tools-10.0.7-3227872/guestproxycerttool/cert_util.h0000644000000000000000000000445412660700525022032 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _CERT_UTIL_H_ #define _CERT_UTIL_H_ #include #include /* *---------------------------------------------------------------------- * * Error -- * * Prefix the error message with the program name and output the * message to the standard error. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ #ifdef _WIN32 #define Error(fmt, ...) \ fprintf(stderr, "%s: " fmt, g_get_prgname(), __VA_ARGS__); #else #define Error(fmt, args...) \ fprintf(stderr, "%s: " fmt, g_get_prgname(), ##args); #endif gchar * CertUtil_CreateCertFileName(const gchar *certDir, // IN const gchar *hash, // IN int version); // IN gboolean CertUtil_FindCert(const gchar *certFile, // IN const gchar *certDir, // IN const gchar *hash, // IN int *num, // OUT int *last); // OUT gboolean CertUtil_CopyFile(const gchar *src, // IN const gchar *dst); // IN gboolean CertUtil_RemoveDir(const gchar *dirToRemove); // IN const gchar *CertUtil_GetToolDir(void); gboolean CheckRootPriv(void); #endif // #ifndef _CERT_UTIL_H_ open-vm-tools-10.0.7-3227872/guestproxycerttool/cert_tool.c0000644000000000000000000004146212660700525022025 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * cert_tool.c -- * * Utility to manage the certificates for 'rabbitmqproxy' * plugin in 'VMware Tools'. */ #include #include #include #include #ifndef _WIN32 #include #endif #include #include "cert_util.h" #include "cert_key.h" #include "cert_tool_version.h" #ifdef _WIN32 #include "common_win.h" #endif #include "vm_version.h" #include "embed_version.h" VM_EMBED_VERSION(GUESTPROXYCERTTOOL_VERSION_STRING); /* * The following variables are set up during the validation of system * environment. They are initialized only once and are not freed until * the program exits. */ static gboolean initialized = FALSE; static gchar *guestProxyDir; static gchar *guestProxyServerDir; static gchar *guestProxyTrustedDir; static gchar *guestProxySslConf; #define RSA_KEY_LENGTH 2048 #define CERT_EXPIRED_IN_DAYS (365 * 10) gboolean gIsLogEnabled = FALSE; /* *---------------------------------------------------------------------- * * PrintUsage -- * * Print command usage information. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void PrintUsage(const gchar *cmd) // IN { fprintf(stderr, "Guest Proxy Certificate Management Tool.\n"); fprintf(stderr, "Usage: %s [OPTION] [ARGUMENTS]\n\n", cmd); fprintf(stderr, "Options\n" " -h, --help Prints the usage information.\n\n" " -v, --verbose Prints additional log messages.\n\n" " -f, --force Forces to regenerate the new server key/cert\n" " when used with -g.\n\n" " -g, --generate_key_cert Generates the server key/cert if they don't\n" " exist. Use with -f to force the regeneration.\n\n" " -a, --add_trust_cert \n" " Adds the client cert to the trusted\n" " certificates directory.\n\n" " -r, --remove_trust_cert \n" " Removes the client cert from the trusted\n" " certificates directory.\n\n" " -d, --display_server_cert []\n" " Prints the server's certificate to the\n" " standard output. If the file path is\n" " specified, then the server's certificate\n" " is stored in the file.\n\n"); } static void InitProxyPaths(const gchar *toolDir) { guestProxyDir = g_build_filename(toolDir, "GuestProxyData", NULL); guestProxyServerDir = g_build_filename(guestProxyDir, "server", NULL); guestProxyTrustedDir = g_build_filename(guestProxyDir, "trusted", NULL); guestProxySslConf = g_build_filename(toolDir, "guestproxy-ssl.conf", NULL); } #ifndef _WIN32 /* *---------------------------------------------------------------------- * * CheckRootPriv -- * * Check if the effect user id is root. * * Results: * TRUE if it is, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ gboolean CheckRootPriv(void) { if (geteuid() != 0) { Error("Please re-run this program as the super user to execute " "this operation.\n"); return FALSE; } return TRUE; } #endif /* *---------------------------------------------------------------------- * * ValidateEnvironment -- * * Initialize command and directory paths, which are used to hold * key and certificate files, and find commands to operate on them. * * Results: * TRUE if successfully find all the paths. Otherwise FALSE. * * Side effects: * Path global variables are set accordingly and guest proxy data * directories are created on-demand. * *---------------------------------------------------------------------- */ static gboolean ValidateEnvironment(gboolean requireRootPriv) // IN { gboolean ret = FALSE; if (requireRootPriv && !CheckRootPriv()) { Error("Current user has insufficient privileges.\n"); goto exit; } if (!initialized) { CertKey_InitOpenSSLLib(); initialized = TRUE; } if (!g_file_test(guestProxySslConf, G_FILE_TEST_IS_REGULAR)) { Error("Couldn't find the GuestProxy Config file at '%s'.\n", guestProxySslConf); goto exit; } /* Create guest proxy data directories on-demand */ if (!g_file_test(guestProxyDir, G_FILE_TEST_IS_DIR)) { if (g_mkdir(guestProxyDir, 0755) < 0) { Error("Couldn't create the directory '%s'.\n", guestProxyDir); goto exit; } } if (!g_file_test(guestProxyServerDir, G_FILE_TEST_IS_DIR)) { if (g_mkdir(guestProxyServerDir, 0755) < 0) { Error("Couldn't create the directory '%s'.\n", guestProxyServerDir); goto exit; } } if (!g_file_test(guestProxyTrustedDir, G_FILE_TEST_IS_DIR)) { if (g_mkdir(guestProxyTrustedDir, 0700) < 0) { Error("Couldn't create the directory '%s'.\n", guestProxyTrustedDir); goto exit; } } ret = TRUE; exit: return ret; } /* *---------------------------------------------------------------------- * * AddTrustCert -- * * Add the supplied certificate file (clientCertPemFile) to the * trusted certificate directory. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean AddTrustCert(const gchar *clientCertPemFile) // IN { gboolean ret = FALSE; int last, num; gchar *hash = NULL; gchar *path = NULL; if (!ValidateEnvironment(TRUE)) { goto exit; } if (!g_file_test(clientCertPemFile, G_FILE_TEST_IS_REGULAR)) { Error("No certificate file found at %s.\n", clientCertPemFile); goto exit; } hash = CertKey_ComputeCertPemFileHash(clientCertPemFile); if (!hash) { goto exit; } if (CertUtil_FindCert(clientCertPemFile, guestProxyTrustedDir, hash, &num, &last) && num >= 0) { Error("The specified certificate file already exists: %s.%d.\n", hash, num); goto exit; } path = CertUtil_CreateCertFileName(guestProxyTrustedDir, hash, last + 1); if (!CertUtil_CopyFile(clientCertPemFile, path)) { Error("Unable to add %s to the trusted certificate store.\n", clientCertPemFile); goto exit; } printf("Successfully added the %s to the trusted certificate store.\n", clientCertPemFile); ret = TRUE; exit: g_free(hash); g_free(path); return ret; } /* *---------------------------------------------------------------------- * * DisplayServerCert -- * * Display the server certificate file to console. If a file name * (serverCertPemFile) is supplied, write to that file instead. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean DisplayServerCert(const gchar *serverCertPemFile) // IN { gboolean ret = FALSE; gchar *cert = NULL; FILE *file = NULL; GMappedFile *fmap = NULL; if (!ValidateEnvironment(FALSE)) { goto exit; } cert = g_build_filename(guestProxyServerDir, "cert.pem", NULL); if (!g_file_test(cert, G_FILE_TEST_IS_REGULAR)) { Error("Couldn't find the server certificate file: %s.\n", cert); goto exit; } if (serverCertPemFile && strlen(serverCertPemFile)) { printf("Copying the server certificate to %s.\n", serverCertPemFile); if (!CertUtil_CopyFile(cert, serverCertPemFile)) { Error("Failed to copy the certificate file to the file.\n"); goto exit; } printf("Successfully copied the server certificate.\n"); } else { fmap = g_mapped_file_new(cert, FALSE, NULL); if (fmap) { const gchar *content = g_mapped_file_get_contents(fmap); gsize length = g_mapped_file_get_length(fmap); if (fwrite(content, 1, length, stdout) < length) { Error("Failed to display %s: %s.\n", cert, strerror(errno)); goto exit; } } else { Error("Couldn't open the server certificate file.\n"); goto exit; } } ret = TRUE; exit: g_free(cert); if (file) { fclose(file); } if (fmap) { g_mapped_file_unref(fmap); } return ret; } /* *---------------------------------------------------------------------- * * CreateKeyCert -- * * Create the server key and certificate files. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean CreateKeyCert(gboolean force) { gboolean ret = FALSE; gchar *cert = NULL; gchar *key = NULL; if (!ValidateEnvironment(TRUE)) { goto exit; } key = g_build_filename(guestProxyServerDir, "key.pem", NULL); cert = g_build_filename(guestProxyServerDir, "cert.pem", NULL); /* * If both server key and certificate files already exist and the * program is not asked to create them by force, print an warning * message about server key/cert files not regenerating. */ if (g_file_test(key, G_FILE_TEST_IS_REGULAR) && g_file_test(cert, G_FILE_TEST_IS_REGULAR) && !force) { printf("\nNOTE: both %s and \n %s already exist.\n" " They are not generated again. To regenerate " "them by force,\n use the \"%s -g -f\" command.\n\n", key, cert, g_get_prgname()); ret = TRUE; goto exit; } printf("Generating the key and certificate files.\n"); if (!CertKey_GenerateKeyCert(RSA_KEY_LENGTH, CERT_EXPIRED_IN_DAYS, guestProxySslConf, key, cert)) { goto exit; } ret = TRUE; printf("Successfully generated the key and certificate files.\n"); exit: g_free(key); g_free(cert); return ret; } /* *---------------------------------------------------------------------- * * RemoveTrustCert -- * * Remove the specified certificate from the trusted certificate * store. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean RemoveTrustCert(const gchar *clientCertPemFile) { gboolean ret = FALSE; int last, num; gchar *hash = NULL; gchar *src = NULL; gchar *dst = NULL; if (!ValidateEnvironment(TRUE)) { goto exit; } if (!g_file_test(clientCertPemFile, G_FILE_TEST_IS_REGULAR)) { Error("No certificate file found at %s.\n", clientCertPemFile); goto exit; } hash = CertKey_ComputeCertPemFileHash(clientCertPemFile); if (!hash) { goto exit; } if (!CertUtil_FindCert(clientCertPemFile, guestProxyTrustedDir, hash, &num, &last) || num < 0) { Error("Couldn't find any certificate in the trusted directory.\n"); goto exit; } dst = CertUtil_CreateCertFileName(guestProxyTrustedDir, hash, num); if (last != num) { src = CertUtil_CreateCertFileName(guestProxyTrustedDir, hash, last); if (rename(src, dst) != 0) { Error("Failed to rename %s to %s with error: %s.", src, dst, strerror(errno)); goto exit; } } else { if (unlink(dst) != 0) { Error("Failed to remove %s with error: %s.", dst, strerror(errno)); goto exit; } } ret = TRUE; printf("Successfully removed the certificate.\n"); exit: g_free(hash); g_free(src); g_free(dst); return ret; } /* " -e, --erase_proxy_data Erases the trusted and server directories,\n" " and their contents including server key/cert.\n\n" */ /* *---------------------------------------------------------------------- * * EraseProxyData -- * * Delete the guest proxy data diectory and its contents. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean EraseProxyData(void) { gboolean ret = FALSE; if (!CheckRootPriv()) { goto exit; } if (g_file_test(guestProxyDir, G_FILE_TEST_IS_DIR)) { if (!CertUtil_RemoveDir(guestProxyDir)) { Error("Fail to remove the directory '%s'.\n", guestProxyDir); goto exit; } } ret = TRUE; exit: return ret; } /* * Aggregation of command options. */ static struct _options { gchar *addCert; gchar *deleteCert; gchar *outputCert; gboolean displayCert; gboolean generateCert; gboolean usage; gboolean verbose; gboolean force; gboolean erase; } options = { NULL, NULL, NULL, FALSE, FALSE, FALSE, FALSE}; static gboolean ParseDisplayCert(const gchar* name, const gchar* value, gpointer data, GError **error) { options.displayCert = TRUE; if (value) { options.outputCert = g_strdup(value); } return TRUE; } static GOptionEntry cmdOptions[] = { { "help", 'h', 0, G_OPTION_ARG_NONE, &options.usage, NULL, NULL }, { "verbose", 'v', 0, G_OPTION_ARG_NONE, &options.verbose, NULL, NULL }, { "erase_proxy_data", 'e', 0, G_OPTION_ARG_NONE, &options.erase, NULL, NULL }, { "force", 'f', 0, G_OPTION_ARG_NONE, &options.force, NULL, NULL }, { "generate_key_cert", 'g', 0, G_OPTION_ARG_NONE, &options.generateCert, NULL, NULL }, { "add_trust_cert", 'a', 0, G_OPTION_ARG_FILENAME, &options.addCert, NULL, NULL }, { "remove_trust_cert", 'r', 0, G_OPTION_ARG_FILENAME, &options.deleteCert, NULL, NULL }, { "display_server_cert", 'd', G_OPTION_FLAG_OPTIONAL_ARG, G_OPTION_ARG_CALLBACK, ParseDisplayCert, NULL, NULL }, { NULL } }; /* *---------------------------------------------------------------------- * * ParseOptions -- * * Parse command options. * * Results: * Recognized options are saved into the options variable. * * Side effects: * Both argc and argv are updated to remove those already * recognized options. * *---------------------------------------------------------------------- */ static void ParseOptions(int *argc, // IN/OUT char ***argv) // IN/OUT { GError *error = NULL; GOptionContext *context; context = g_option_context_new(NULL); g_option_context_add_main_entries(context, cmdOptions, NULL); /* * Turn off glib option parser help message in order to provide the * complete help messages compatible to those from the original perl * implementation script. */ g_option_context_set_help_enabled(context, FALSE); if (!g_option_context_parse(context, argc, argv, &error)) { printf("Option parsing failed: %s\n", error->message); PrintUsage(g_get_prgname()); exit(1); } g_option_context_free(context); } int main(int argc, char **argv) { ParseOptions(&argc, &argv); if (options.usage) { PrintUsage(g_get_prgname()); exit(0); } if (options.verbose) { gIsLogEnabled = TRUE; } InitProxyPaths(CertUtil_GetToolDir()); if ((options.generateCert && !CreateKeyCert(options.force)) || (options.displayCert && !DisplayServerCert(options.outputCert)) || (options.addCert && !AddTrustCert(options.addCert)) || (options.deleteCert && !RemoveTrustCert(options.deleteCert)) || (options.erase && !EraseProxyData())) { return 1; } else { return 0; } } open-vm-tools-10.0.7-3227872/guestproxycerttool/cert_util.c0000644000000000000000000002672212660700525022027 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * cert_util.c -- * * Utilities to manage the certificates. */ #include #include #include #include #include "cert_util.h" /* *---------------------------------------------------------------------- * * CompareFile -- * * Check if two files are the same. * * Results: * TRUE if file comparison is performed successfully, otherwise * FALSE. When the returned value is TRUE, 'same' is TRUE if two * input files are the same, otherwise FALSE. When the returned * value is FALSE, 'same' is not defined. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean CompareFile(const gchar *fname1, // IN const gchar *fname2, // IN gboolean *same) // OUT { gsize num; gboolean ret = FALSE; GMappedFile *m1; GMappedFile *m2 = NULL; GError *error = NULL; m1 = g_mapped_file_new(fname1, FALSE, &error); if (m1 == NULL) { Error("Unable to map %s: %s.\n", fname1, error->message); goto exit; } m2 = g_mapped_file_new(fname2, FALSE, &error); if (m2 == NULL) { Error("Unable to map %s: %s.\n", fname2, error->message); goto exit; } ret = TRUE; *same = FALSE; num = g_mapped_file_get_length(m1); if (g_mapped_file_get_length(m2) == num) { if (num) { if (memcmp(g_mapped_file_get_contents(m1), g_mapped_file_get_contents(m2), num) == 0) { *same = TRUE; } } else { /* Two empty files */ *same = TRUE; } } exit: g_clear_error(&error); if (m1) { g_mapped_file_unref(m1); } if (m2) { g_mapped_file_unref(m2); } return ret; } /* *---------------------------------------------------------------------- * * CertUtil_CreateCertFileName -- * * A convenient function to make up the certificate file name based * on the supplied guest proxy certificate store (certDir), subject * name hash (hash), and certificate version (version). * * Results: * Return the full path name of the certificate. Callers should free * the returned string. * * Side effects: * None. * *---------------------------------------------------------------------- */ gchar * CertUtil_CreateCertFileName(const gchar *certDir, // IN const gchar *hash, // IN int version) // IN { gchar *ret; gchar *tmp; tmp = g_strdup_printf("%s.%d", hash, version); ret = g_build_filename(certDir, tmp, NULL); g_free(tmp); return ret; } /* *---------------------------------------------------------------------- * * IntCmp -- * * This is an integer comparator, which is used to sort a list * with ascending order. * * Results: * The difference of ga and gb. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gint IntCmp(gconstpointer ga, // IN gconstpointer gb) // IN { gint a = GPOINTER_TO_INT(ga); gint b = GPOINTER_TO_INT(gb); return (a - b); } /* *---------------------------------------------------------------------- * * MatchFile -- * * Scan each file at the directory and collect file extensions of * matched files. Sort the file extension list in ascending order. * * Results: * Return a list of file extensions, their file names matching the * regular expression. These extensions are file version numbers. * * Side effects: * None. * *---------------------------------------------------------------------- */ static GList * MatchFile(GDir *dir, // IN GRegex *regExpr) // IN { const gchar *fn, *cp; GList *list = NULL; while ((fn = g_dir_read_name(dir)) != NULL) { if (g_regex_match(regExpr, fn, 0, NULL)) { cp = strrchr(fn, '.'); list = g_list_prepend(list, GINT_TO_POINTER(atoi(cp + 1))); } } list = g_list_sort(list, IntCmp); return list; } /* *---------------------------------------------------------------------- * * SearchFile -- * * Search files with pattern (.[0-9]+) at a directory . * * Results: * Return TRUE if file search is performed successfully, otherwise * FALSE. When the returned value is TRUE, 'list' is set to include * a list of file extensions matching the pattern. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean SearchFile(const gchar *path, // IN const gchar *fname, // IN GList **list) // OUT { gboolean ret = FALSE; gchar *pattern; GRegex *regExpr; GDir *dir = NULL; GError *error = NULL; pattern = g_strdup_printf("%s.[0-9]+", fname); regExpr = g_regex_new(pattern, 0, 0, &error); if (!regExpr) { Error("Failed to compile %s: %s.\n", pattern, error->message); goto exit; } dir = g_dir_open(path, 0, &error); if (!dir) { Error("Failed to open %s: %s.\n", path, error->message); goto exit; } *list = MatchFile(dir, regExpr); ret = TRUE; exit: g_free(pattern); g_clear_error(&error); if (dir) { g_dir_close(dir); } if (regExpr) { g_regex_unref(regExpr); } return ret; } /* *---------------------------------------------------------------------- * * CertUtil_FindCert -- * * From the trusted certificate directory (certDir), check if * there is any certificate file matching the contents of the * supplied one. In general, certificate files are saved in the * directory by the format of .[0-9]+. * * Results: * Return TRUE if the function is successfully executed. Otherwise * FALSE. When return TRUE, 'num' is set to the version of matching * certificate file or -1 if no matching. For 'last', it is set to * the highest version, or -1 if the store has no certificate file. * * Side effects: * None. * *---------------------------------------------------------------------- */ gboolean CertUtil_FindCert(const gchar *certFile, // IN const gchar *certDir, // IN const gchar *hash, // IN int *num, // OUT int *last) // OUT { gboolean ret = FALSE; const GList *node; GList *list = NULL; gchar *path = NULL; *last = *num = -1; if (!SearchFile(certDir, hash, &list)) { goto exit; } ret = TRUE; if (!list) { goto exit; } /* *last = the highest file version */ node = g_list_last(list); *last = GPOINTER_TO_INT(node->data); for (node = g_list_first(list); node; node = g_list_next(node)) { gboolean same = FALSE; int ext = GPOINTER_TO_INT(node->data); g_free(path); path = CertUtil_CreateCertFileName(certDir, hash, ext); if (!CompareFile(certFile, path, &same)) { ret = FALSE; goto exit; } if (same) { *num = ext; break; } } exit: g_free(path); if (list) { g_list_free(list); } return ret; } #ifndef _WIN32 /* *---------------------------------------------------------------------- * * CertUtil_GetToolDir -- * * Get the VMware tool installation directory. * * Results: * The VMware tool installation directory. Callers should not free * the returned string. * * Side effects: * None. * *---------------------------------------------------------------------- */ const gchar * CertUtil_GetToolDir(void) { static gchar *path = NULL; if (!path) { path = g_build_filename(G_DIR_SEPARATOR_S, "etc", "vmware-tools", NULL); } return path; } #endif /* *---------------------------------------------------------------------- * * CertUtil_CopyFile -- * * Copy a file from source to destination. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ gboolean CertUtil_CopyFile(const gchar *src, // IN const gchar *dst) // IN { gsize length; gboolean ret = FALSE; GMappedFile *smap; GError *error = NULL; FILE *file = NULL; const gchar *content; smap = g_mapped_file_new(src, FALSE, &error); if (!smap) { Error("Unable to map %s: %s.\n", src, error->message); goto exit; } file = fopen(dst, "w"); if (!file) { Error("Failed to open %s: %s.\n", dst, strerror(errno)); goto exit; } length = g_mapped_file_get_length(smap); content = g_mapped_file_get_contents(smap); if (fwrite(content, 1, length, file) < length) { Error("Failed to copy %s to %s: %s.\n", src, dst, strerror(errno)); goto exit; } ret = TRUE; exit: g_clear_error(&error); if (smap) { g_mapped_file_unref(smap); } if (file) { fclose(file); } return ret; } /* *---------------------------------------------------------------------- * * CertUtil_RemoveDir -- * * Remove a directory. This directory can be non-empty. When it is * non-empty, all of its files and subdirectories are removed too. * * Results: * TRUE if the directory is successfully removed, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ gboolean CertUtil_RemoveDir(const gchar *dirToRemove) { gboolean ret = FALSE; GDir *dir = NULL; const gchar *file; GError *error = NULL; gchar *fname = NULL; if ((dir = g_dir_open(dirToRemove, 0, &error)) == NULL) { Error("Failed to open %s: %s.\n", dirToRemove, error->message); goto exit; } while ((file = g_dir_read_name(dir)) != NULL) { g_free(fname); fname = g_build_filename(dirToRemove, file, NULL); if (g_file_test(fname, G_FILE_TEST_IS_DIR)) { if (!CertUtil_RemoveDir(fname)) { Error("Couldn't remove the directory '%s'.\n", fname); goto exit; } } else if (g_remove(fname) < 0) { Error("Couldn't remove the file '%s'.\n", fname); goto exit; } } g_dir_close(dir); dir = NULL; if (g_rmdir(dirToRemove) < 0) { Error("Couldn't remove the directory '%s'.\n", dirToRemove); goto exit; } ret = TRUE; exit: g_free(fname); g_clear_error(&error); if (dir) { g_dir_close(dir); } return ret; } open-vm-tools-10.0.7-3227872/guestproxycerttool/cert_key.c0000644000000000000000000003704412660700525021641 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * certKey.c -- * * Utilities to handle key and certificate generation. */ #include #include #include #include #include #include #include #include #include #include #include #include "cert_util.h" #include "cert_key.h" #define BSIZE 4096 /* *---------------------------------------------------------------------- * * GetSSLError -- * * Get the latest human readable error message from SSL library. * * Results: * Return the error message. Callers should free the returned * error message. * * Side effects: * None. * *---------------------------------------------------------------------- */ gchar * GetSSLError(gchar **errorStr) // OUT { unsigned long code; GString *str = g_string_new(NULL); gboolean first = TRUE; char buf[BSIZE]; while ((code = ERR_get_error()) != 0) { ERR_error_string_n(code, buf, sizeof buf); g_string_append_printf(str, "%s%s", first ? "" : ", ", buf); first = FALSE; } *errorStr = g_string_free(str, FALSE); return *errorStr; } /* *---------------------------------------------------------------------- * * CertKey_InitOpenSSLLib -- * * Initialize OpenSSL for key and certificate generation. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ void CertKey_InitOpenSSLLib(void) { ERR_load_crypto_strings(); OpenSSL_add_all_digests(); } /* *---------------------------------------------------------------------- * * CertKey_ComputeCertPemFileHash -- * * Compute the certificate subject name hash. * * Results: * Return the computed hash string. Callers should free the returned * string. * * Side effects: * None. * *---------------------------------------------------------------------- */ gchar * CertKey_ComputeCertPemFileHash(const gchar *certPemFile) // IN { FILE *file; gchar *hash = NULL; X509 *cert = NULL; gchar *err = NULL; file = fopen(certPemFile, "r"); if (!file) { Error("Failed to open %s: %s.\n", certPemFile, strerror(errno)); goto exit; } cert = PEM_read_X509(file, NULL, NULL, NULL); if (!cert) { Error("Error reading certificate file %s: %s.\n", certPemFile, GetSSLError(&err)); goto exit; } hash = g_strdup_printf("%08lx", X509_subject_name_hash(cert)); exit: if (file) { fclose(file); } X509_free(cert); g_free(err); return hash; } /* *---------------------------------------------------------------------- * * SetCertSerialNumber -- * * Set the certificate serial number. * * Results: * Return TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean SetCertSerialNumber(X509 *cert) // IN { BIGNUM *btmp = NULL; ASN1_INTEGER *sno; gboolean ret = FALSE; gchar *err = NULL; sno = ASN1_INTEGER_new(); if (!sno) { Error("Failed to allocate an ASN1 integer.\n"); goto exit; } btmp = BN_new(); if (!btmp) { Error("Failed to allocate a BIGNUM structure.\n"); goto exit; } if (!BN_rand(btmp, 64, 0, 0)) { Error("Failed to generate random number: %s.\n", GetSSLError(&err)); goto exit; } if (!BN_to_ASN1_INTEGER(btmp, sno)) { Error("Failed to convert from BIGNUM to ASN1_INTEGER: %s.\n", GetSSLError(&err)); goto exit; } if (!X509_set_serialNumber(cert, sno)) { Error("Failed to set the certificate serial number: %s.\n", GetSSLError(&err)); goto exit; } ret = TRUE; exit: BN_free(btmp); ASN1_INTEGER_free(sno); g_free(err); return ret; } /* *---------------------------------------------------------------------- * * LoadOpenSSLConf -- * * Loading the OpenSSL configuration file. * * Results: * Return the configuration structure if success, otherwise NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ static CONF * LoadOpenSSLConf(const gchar *fname) // IN { CONF *config; const char *mask; gboolean ret = FALSE; gchar *err = NULL; config = NCONF_new(NULL); if (!config) { Error("Failed to allocate the OpenSSL config.\n"); goto exit; } if (!NCONF_load(config, fname, NULL)) { Error("Failed to load the configuration file %s: %s.\n", fname, GetSSLError(&err)); goto exit; } OPENSSL_load_builtin_modules(); if (!CONF_modules_load(config, NULL, 0)) { Error("Error configuring OpenSSL modules: %s.\n", GetSSLError(&err)); goto exit; } mask = NCONF_get_string(config, "req", "string_mask"); if (mask) { ASN1_STRING_set_default_mask_asc(mask); } ret = TRUE; exit: if (!ret) { NCONF_free(config); config = NULL; } g_free(err); return config; } /* *---------------------------------------------------------------------- * * GenerateRSAKeyPair -- * * Interface to OpenSSL library to create RSA key pair. * * Results: * Return the generated RSA key structure if success, * otherwise NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ static RSA * GenerateRSAKeyPair(int bits) // IN { BIGNUM *bn; RSA *rsa = NULL; gchar *err = NULL; bn = BN_new(); if (!bn) { Error("Failed to allocate a BIGNUM.\n"); goto exit; } if (!BN_set_word(bn, RSA_F4)) { Error("Failed to assign a value to BIGNUM: %s.\n", GetSSLError(&err)); goto exit; } rsa = RSA_new(); if (!rsa) { Error("Failed to allocate a RSA structure.\n"); goto exit; } if (!RSA_generate_key_ex(rsa, bits, bn, NULL)) { Error("Error generating RSA key pair: %s.\n", GetSSLError(&err)); RSA_free(rsa); rsa = NULL; } exit: BN_free(bn); g_free(err); return rsa; } /* *---------------------------------------------------------------------- * * GenerateRSAPrivateKey -- * * Create the RSA private key structure. * * Results: * Return the generated RSA private key structure if success, * otherwise NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ static EVP_PKEY * GenerateRSAPrivateKey(int bits) // IN { RSA *rsa; EVP_PKEY *pkey = NULL; rsa = GenerateRSAKeyPair(bits); if (!rsa) { goto exit; } pkey = EVP_PKEY_new(); if (!pkey) { Error("Failed to allocate a private key structure.\n"); goto exit; } EVP_PKEY_assign_RSA(pkey, rsa); rsa = NULL; exit: RSA_free(rsa); return pkey; } /* *---------------------------------------------------------------------- * * ConfigX509CertReq -- * * Configure the X509 certificate request. * * Results: * Return TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean ConfigX509CertReq(X509_REQ *req, // OUT CONF *config) // IN { int idx; X509_NAME *subject; gboolean ret = FALSE; const char *dname; gchar *err = NULL; if (!X509_REQ_set_version(req, 0L)) { Error("Failed to set the certificate request version: %s.\n", GetSSLError(&err)); goto exit; } subject = X509_REQ_get_subject_name(req); if (!subject) { Error("Failed to get the certificate request subject name: %s.\n", GetSSLError(&err)); goto exit; } dname = NCONF_get_string(config, "req", "distinguished_name"); if (dname) { STACK_OF(CONF_VALUE) *dn_sk = NCONF_get_section(config, dname); if (!dn_sk) { Error("Failed to get section %s: %s.\n", dname, GetSSLError(&err)); goto exit; } for (idx = 0; idx < sk_CONF_VALUE_num(dn_sk); idx++) { CONF_VALUE *v = sk_CONF_VALUE_value(dn_sk, idx); if (!X509_NAME_add_entry_by_txt(subject, v->name, MBSTRING_ASC, v->value, -1, -1, 0)) { Error("Failed to set certificate request pair %s/%s: %s.\n", v->name, v->value, GetSSLError(&err)); goto exit; } } } ret = TRUE; exit: g_free(err); return ret; } /* *---------------------------------------------------------------------- * * GenerateX509CertReq -- * * Create X509 certificate request. * * Results: * Return the generated X509 request if success, otherwise NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ static X509_REQ * GenerateX509CertReq(EVP_PKEY **pkey, // OUT CONF *config, // IN int bits) // IN { X509_REQ *req = NULL; gboolean ret = FALSE; gchar *err = NULL; *pkey = GenerateRSAPrivateKey(bits); if (!*pkey) { goto exit; } req = X509_REQ_new(); if (!req) { Error("Failed to allocate a X509 certificate request.\n"); goto exit; } if (!ConfigX509CertReq(req, config)) { goto exit; } if (!X509_REQ_set_pubkey(req, *pkey)) { Error("Failed to set certificate request public key: %s.\n", GetSSLError(&err)); goto exit; } ret = TRUE; exit: if (!ret) { X509_REQ_free(req); req = NULL; } g_free(err); return req; } /* *---------------------------------------------------------------------- * * GenerateX509Cert -- * * Generate a X509 certificate. * * Results: * Return a X509 structure if success, otherwise NULL. * * Side effects: * None. * *---------------------------------------------------------------------- */ static X509 * GenerateX509Cert(X509_REQ *req, // IN CONF *config, // IN int days) // IN { X509 *cert; X509V3_CTX ctx; char *extensions; gboolean ret = FALSE; gchar *err = NULL; cert = X509_new(); if (!cert) { Error("Failed to allocate a X509 certificate: %s.\n", GetSSLError(&err)); goto exit; } if (!SetCertSerialNumber(cert)) { goto exit; } if (!X509_set_issuer_name(cert, X509_REQ_get_subject_name(req)) || !X509_gmtime_adj(X509_get_notBefore(cert), 0) || !X509_gmtime_adj(X509_get_notAfter(cert), (long)60*60*24*days) || !X509_set_subject_name(cert, X509_REQ_get_subject_name(req))) { Error("Failed to configure the X509 certificate: %s.\n", GetSSLError(&err)); goto exit; } X509V3_set_ctx(&ctx, cert, cert, NULL, NULL, 0); X509V3_set_nconf(&ctx, config); extensions = NCONF_get_string(config, "req", "x509_extensions"); if (extensions) { if (!X509_set_version(cert, 2)) { Error("Failed to set the certificate version: %s.\n", GetSSLError(&err)); goto exit; } if (!X509V3_EXT_add_nconf(config, &ctx, extensions, cert)) { Error("Error loading extension section %s: %s.\n", extensions, GetSSLError(&err)); goto exit; } } ret = TRUE; exit: if (!ret) { X509_free(cert); cert = NULL; } g_free(err); return cert; } #ifndef _WIN32 /* *---------------------------------------------------------------------- * * WritePemFile -- * * Output RSA private key and X509 certificate in PEM format. * * Results: * TRUE if success, otherwise FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ gboolean WritePemFile(EVP_PKEY *pkey, // IN const gchar *keyFile, // IN X509 *cert, // IN const gchar *certFile) // IN { FILE *file; gboolean ret = FALSE; gchar *err = NULL; mode_t mode; mode = umask(066); file = fopen(keyFile, "w"); if (!file) { Error("Failed to open %s: %s.\n", keyFile, strerror(errno)); goto exit; } if (!PEM_write_PrivateKey(file, pkey, NULL, NULL, 0, NULL, NULL)) { Error("Failed to write the private key file %s: %s.\n", keyFile, GetSSLError(&err)); goto exit; } fclose(file); umask(022); file = fopen(certFile, "w"); if (!file) { Error("Failed to open %s: %s.\n", certFile, strerror(errno)); goto exit; } if (!PEM_write_X509(file, cert)) { Error("Failed to write the certificate file %s: %s.\n", certFile, GetSSLError(&err)); goto exit; } ret = TRUE; exit: if (file) { fclose(file); } g_free(err); umask(mode); return ret; } #endif /* *---------------------------------------------------------------------- * * CertKey_GenerateKeyCert -- * * Generate the server key and certificate files. * * Results: * TRUE if success, otherwise FALSE. When success, key and * certificate files are generated. * * Side effects: * None. * *---------------------------------------------------------------------- */ gboolean CertKey_GenerateKeyCert(int bits, // IN int days, // IN const gchar *confFile, // IN const gchar *keyFile, // IN const gchar *certFile) // IN { gboolean ret = FALSE; X509 *cert = NULL; X509_REQ *req = NULL; EVP_PKEY *pkey = NULL; CONF *config; gchar *err = NULL; config = LoadOpenSSLConf(confFile); if (!config) { goto exit; } req = GenerateX509CertReq(&pkey, config, bits); if (!req) { goto exit; } cert = GenerateX509Cert(req, config, days); if (!cert) { goto exit; } if (!X509_set_pubkey(cert, pkey)) { Error("Failed to set certificate public key: %s.\n", GetSSLError(&err)); goto exit; } if (!X509_sign(cert, pkey, EVP_sha256())) { Error("Failed to sign the X509 certificate: %s.\n", GetSSLError(&err)); goto exit; } /* * Write private key and certificate PEM files. */ if (WritePemFile(pkey, keyFile, cert, certFile)) { ret = TRUE; } exit: g_free(err); NCONF_free(config); EVP_PKEY_free(pkey); X509_REQ_free(req); X509_free(cert); return ret; } open-vm-tools-10.0.7-3227872/guestproxycerttool/cert_tool_version.h0000644000000000000000000000312212660700525023566 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * cert_tool_version.h -- * * Version definitions for the vmware-guestproxycerttool program */ #ifndef _GUESTPROXYCERTTOOL_VERSION_H_ #define _GUESTPROXYCERTTOOL_VERSION_H_ /* * This component's version is coupled with Tools versioning. The effect * is that the version increments with each build, and with each Tools * version bump. If and when it becomes necessary to version the component * manually, make sure that the version is bumped any time the component or * its dependencies are changed. */ #include "vm_tools_version.h" #define GUESTPROXYCERTTOOL_VERSION_COMMAS TOOLS_VERSION_EXT_CURRENT_CSV #define GUESTPROXYCERTTOOL_VERSION_STRING TOOLS_VERSION_EXT_CURRENT_STR #endif /* _GUESTPROXYCERTTOOL_VERSION_H_*/ open-vm-tools-10.0.7-3227872/guestproxycerttool/cert_key.h0000644000000000000000000000333412660700525021641 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _CERT_KEY_H_ #define _CERT_KEY_H_ #include #include #include gchar * CertKey_ComputeCertPemFileHash(const gchar *certPemFile); // IN gboolean CertKey_GenerateKeyCert(int bits, // IN int days, // IN const gchar *confFile, // IN const gchar *keyFile, // IN const gchar *certFile); // IN void CertKey_InitOpenSSLLib(void); gboolean WritePemFile(EVP_PKEY *pkey, // IN const gchar *keyFile, // IN X509 *cert, // IN const gchar *certFile); // IN gchar * GetSSLError(gchar **errorStr); // OUT #endif // #ifndef _CERT_KEY_H_ open-vm-tools-10.0.7-3227872/guestproxycerttool/Makefile.in0000644000000000000000000006065312660700525021737 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2014-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ bin_PROGRAMS = vmware-guestproxycerttool$(EXEEXT) @HAVE_ICU_TRUE@am__append_1 = @ICU_LIBS@ subdir = guestproxycerttool DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_vmware_guestproxycerttool_OBJECTS = \ vmware_guestproxycerttool-cert_key.$(OBJEXT) \ vmware_guestproxycerttool-cert_util.$(OBJEXT) \ vmware_guestproxycerttool-cert_tool.$(OBJEXT) vmware_guestproxycerttool_OBJECTS = \ $(am_vmware_guestproxycerttool_OBJECTS) am__DEPENDENCIES_1 = vmware_guestproxycerttool_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(vmware_guestproxycerttool_SOURCES) DIST_SOURCES = $(vmware_guestproxycerttool_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ vmware_guestproxycerttool_LDADD = @SSL_LIBS@ -lcrypto @GLIB2_LIBS@ \ $(am__append_1) vmware_guestproxycerttool_CPPFLAGS = @SSL_CPPFLAGS@ @GLIB2_CPPFLAGS@ vmware_guestproxycerttool_SOURCES = cert_key.c cert_util.c cert_tool.c @HAVE_ICU_FALSE@vmware_guestproxycerttool_LINK = $(LINK) @HAVE_ICU_TRUE@vmware_guestproxycerttool_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) \ @HAVE_ICU_TRUE@ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ @HAVE_ICU_TRUE@ $(LDFLAGS) -o $@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 guestproxycerttool/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu guestproxycerttool/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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 vmware-guestproxycerttool$(EXEEXT): $(vmware_guestproxycerttool_OBJECTS) $(vmware_guestproxycerttool_DEPENDENCIES) @rm -f vmware-guestproxycerttool$(EXEEXT) $(vmware_guestproxycerttool_LINK) $(vmware_guestproxycerttool_OBJECTS) $(vmware_guestproxycerttool_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware_guestproxycerttool-cert_key.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware_guestproxycerttool-cert_tool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware_guestproxycerttool-cert_util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 $@ $< vmware_guestproxycerttool-cert_key.o: cert_key.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_guestproxycerttool-cert_key.o -MD -MP -MF $(DEPDIR)/vmware_guestproxycerttool-cert_key.Tpo -c -o vmware_guestproxycerttool-cert_key.o `test -f 'cert_key.c' || echo '$(srcdir)/'`cert_key.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_guestproxycerttool-cert_key.Tpo $(DEPDIR)/vmware_guestproxycerttool-cert_key.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cert_key.c' object='vmware_guestproxycerttool-cert_key.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_guestproxycerttool-cert_key.o `test -f 'cert_key.c' || echo '$(srcdir)/'`cert_key.c vmware_guestproxycerttool-cert_key.obj: cert_key.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_guestproxycerttool-cert_key.obj -MD -MP -MF $(DEPDIR)/vmware_guestproxycerttool-cert_key.Tpo -c -o vmware_guestproxycerttool-cert_key.obj `if test -f 'cert_key.c'; then $(CYGPATH_W) 'cert_key.c'; else $(CYGPATH_W) '$(srcdir)/cert_key.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_guestproxycerttool-cert_key.Tpo $(DEPDIR)/vmware_guestproxycerttool-cert_key.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cert_key.c' object='vmware_guestproxycerttool-cert_key.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_guestproxycerttool-cert_key.obj `if test -f 'cert_key.c'; then $(CYGPATH_W) 'cert_key.c'; else $(CYGPATH_W) '$(srcdir)/cert_key.c'; fi` vmware_guestproxycerttool-cert_util.o: cert_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_guestproxycerttool-cert_util.o -MD -MP -MF $(DEPDIR)/vmware_guestproxycerttool-cert_util.Tpo -c -o vmware_guestproxycerttool-cert_util.o `test -f 'cert_util.c' || echo '$(srcdir)/'`cert_util.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_guestproxycerttool-cert_util.Tpo $(DEPDIR)/vmware_guestproxycerttool-cert_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cert_util.c' object='vmware_guestproxycerttool-cert_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_guestproxycerttool-cert_util.o `test -f 'cert_util.c' || echo '$(srcdir)/'`cert_util.c vmware_guestproxycerttool-cert_util.obj: cert_util.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_guestproxycerttool-cert_util.obj -MD -MP -MF $(DEPDIR)/vmware_guestproxycerttool-cert_util.Tpo -c -o vmware_guestproxycerttool-cert_util.obj `if test -f 'cert_util.c'; then $(CYGPATH_W) 'cert_util.c'; else $(CYGPATH_W) '$(srcdir)/cert_util.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_guestproxycerttool-cert_util.Tpo $(DEPDIR)/vmware_guestproxycerttool-cert_util.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cert_util.c' object='vmware_guestproxycerttool-cert_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_guestproxycerttool-cert_util.obj `if test -f 'cert_util.c'; then $(CYGPATH_W) 'cert_util.c'; else $(CYGPATH_W) '$(srcdir)/cert_util.c'; fi` vmware_guestproxycerttool-cert_tool.o: cert_tool.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_guestproxycerttool-cert_tool.o -MD -MP -MF $(DEPDIR)/vmware_guestproxycerttool-cert_tool.Tpo -c -o vmware_guestproxycerttool-cert_tool.o `test -f 'cert_tool.c' || echo '$(srcdir)/'`cert_tool.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_guestproxycerttool-cert_tool.Tpo $(DEPDIR)/vmware_guestproxycerttool-cert_tool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cert_tool.c' object='vmware_guestproxycerttool-cert_tool.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_guestproxycerttool-cert_tool.o `test -f 'cert_tool.c' || echo '$(srcdir)/'`cert_tool.c vmware_guestproxycerttool-cert_tool.obj: cert_tool.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_guestproxycerttool-cert_tool.obj -MD -MP -MF $(DEPDIR)/vmware_guestproxycerttool-cert_tool.Tpo -c -o vmware_guestproxycerttool-cert_tool.obj `if test -f 'cert_tool.c'; then $(CYGPATH_W) 'cert_tool.c'; else $(CYGPATH_W) '$(srcdir)/cert_tool.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_guestproxycerttool-cert_tool.Tpo $(DEPDIR)/vmware_guestproxycerttool-cert_tool.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cert_tool.c' object='vmware_guestproxycerttool-cert_tool.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_guestproxycerttool_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_guestproxycerttool-cert_tool.obj `if test -f 'cert_tool.c'; then $(CYGPATH_W) 'cert_tool.c'; else $(CYGPATH_W) '$(srcdir)/cert_tool.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic 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-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/guestproxycerttool/COPYING0000644000000000000000000006347112660700525020726 0ustar rootroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! open-vm-tools-10.0.7-3227872/hgfsclient/0000755000000000000000000000000012660700525016001 5ustar rootrootopen-vm-tools-10.0.7-3227872/hgfsclient/Makefile.am0000644000000000000000000000306712660700525020043 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ bin_PROGRAMS = vmware-hgfsclient vmware_hgfsclient_LDADD = vmware_hgfsclient_LDADD += ../lib/hgfsBd/libHgfsBd.la vmware_hgfsclient_LDADD += @VMTOOLS_LIBS@ vmware_hgfsclient_LDADD += @HGFS_LIBS@ vmware_hgfsclient_CPPFLAGS = vmware_hgfsclient_CPPFLAGS += @VMTOOLS_CPPFLAGS@ vmware_hgfsclient_SOURCES = vmware_hgfsclient_SOURCES += hgfsclient.c if HAVE_ICU vmware_hgfsclient_LDADD += @ICU_LIBS@ vmware_hgfsclient_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXX) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ else vmware_hgfsclient_LINK = $(LINK) endif open-vm-tools-10.0.7-3227872/hgfsclient/hgfsclient.c0000644000000000000000000002510612660700525020277 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsclient.c -- * * Userspace HGFS client. Will one day be as full featured as an HGFS * filesystem driver. * */ #define G_LOG_DOMAIN "hgfsClient" #include "vmware.h" #include "guestApp.h" #include "vmcheck.h" #include "escBitvector.h" #include "hgfsEscape.h" #include "hgfs.h" #include "hgfsBd.h" #include "hgfsProto.h" #include "conf.h" #include "str.h" #include "vmware/tools/log.h" #include "vmware/tools/utils.h" #include "hgfsclient_version.h" #include "vm_version.h" #include "embed_version.h" VM_EMBED_VERSION(HGFSCLIENT_VERSION_STRING); #include #include #include #include #include RpcOut *gChannel = NULL; char *gPacketBuffer = NULL; static Bool HgfsClient_Open(HgfsHandle *rootHandle); static HgfsFileName *HgfsClient_Read(HgfsHandle rootHandle, int offset); static Bool HgfsClient_Close(HgfsHandle rootHandle); static Bool HgfsClient_PrintShares(void); static Bool HgfsClient_Init(void); static Bool HgfsClient_Cleanup(void); /* *----------------------------------------------------------------------------- * * HgfsClient_Open -- * * Open the root directory on the host. * * Results: * TRUE on success. FALSE otherwise. When TRUE, the root directory handle * is returned as an argument. * * Side effects: * The host has cached an open search for us. * *----------------------------------------------------------------------------- */ static Bool HgfsClient_Open(HgfsHandle *rootHandle) // OUT: Handle to root directory { Bool success = FALSE; HgfsRequestSearchOpen *searchOpenReq; HgfsReplySearchOpen *searchOpenRep = NULL; int err; char const *replyPacket; size_t packetSize; /* Create a SearchOpen and send it. */ searchOpenReq = (HgfsRequestSearchOpen *)gPacketBuffer; memset(searchOpenReq, 0, sizeof *searchOpenReq); searchOpenReq->header.id = 0; searchOpenReq->header.op = HGFS_OP_SEARCH_OPEN; searchOpenReq->dirName.length = 0; searchOpenReq->dirName.name[0] = 0; packetSize = sizeof *searchOpenReq; err = HgfsBd_Dispatch(gChannel, (char *)searchOpenReq, &packetSize, &replyPacket); if (err != 0) { Warning("Failed to send search open request.\n"); goto out; } /* replyPacket has our search handle. */ searchOpenRep = (HgfsReplySearchOpen *)replyPacket; if (searchOpenRep->header.status != HGFS_STATUS_SUCCESS) { Warning("Error in opening root directory.\n"); goto out; } success = TRUE; out: /* We got the root handle. */ if (success) { *rootHandle = searchOpenRep->search; } return success; } /* *----------------------------------------------------------------------------- * * HgfsClient_Read -- * * Read a share name from the host. * * Results: * Pointer into the packet buffer where the caller can find the * HgfsFileName struct. Since this is a pointer into the global * packet buffer, the caller should not free it. * * NULL if there was an error. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static HgfsFileName * HgfsClient_Read(HgfsHandle rootHandle, // IN: Handle to root directory int offset) // IN: Offset of dirent to read { HgfsFileName *shareName = NULL; HgfsRequestSearchRead *searchReadReq; HgfsReplySearchRead *searchReadRep; int err; char const *replyPacket; size_t packetSize; /* Create searchRead and send it. */ searchReadReq = (HgfsRequestSearchRead *)gPacketBuffer; memset(searchReadReq, 0, sizeof *searchReadReq); searchReadReq->header.id = 0; searchReadReq->header.op = HGFS_OP_SEARCH_READ; searchReadReq->search = rootHandle; searchReadReq->offset = offset; packetSize = sizeof *searchReadReq; err = HgfsBd_Dispatch(gChannel, (char *)searchReadReq, &packetSize, &replyPacket); if (err != 0) { Warning("Failed to send search read request.\n"); goto out; } /* replyPacket has our share name. */ searchReadRep = (HgfsReplySearchRead *)replyPacket; if (searchReadRep->header.status != HGFS_STATUS_SUCCESS) { Warning("Error in getting share name.\n"); goto out; } /* We got the share name. */ shareName = &searchReadRep->fileName; out: return shareName; } /* *----------------------------------------------------------------------------- * * HgfsClient_Close -- * * Closes the root directory on the host. * * Results: * TRUE on success, FALSE otherwise. * * Side effects: * Host releases state on our opened search. * *----------------------------------------------------------------------------- */ static Bool HgfsClient_Close(HgfsHandle rootHandle) // IN: Handle to root directory { HgfsRequestSearchClose *searchCloseReq; HgfsReplySearchClose *searchCloseRep; int err; char const *replyPacket; size_t packetSize; /* Create a SearchClose and send it. */ searchCloseReq = (HgfsRequestSearchClose *)gPacketBuffer; memset(searchCloseReq, 0, sizeof *searchCloseReq); searchCloseReq->header.id = 0; searchCloseReq->header.op = HGFS_OP_SEARCH_CLOSE; searchCloseReq->search = rootHandle; packetSize = sizeof *searchCloseReq; err = HgfsBd_Dispatch(gChannel, (char *)searchCloseReq, &packetSize, &replyPacket); if (err != 0) { Warning("Failed to send search close request.\n"); return FALSE; } /* replyPacket has success/failure. */ searchCloseRep = (HgfsReplySearchClose *)replyPacket; if (searchCloseRep->header.status != HGFS_STATUS_SUCCESS) { Warning("Error closing root directory.\n"); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsClient_PrintShares -- * * List all the shares available on the host. * * Results: * TRUE if successful, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool HgfsClient_PrintShares(void) { Bool success = FALSE; int offset = 0; char escapedName[PATH_MAX + 1]; HgfsHandle rootHandle; HgfsFileName *fileName; if (!HgfsClient_Open(&rootHandle)) { return success; } while (TRUE) { fileName = HgfsClient_Read(rootHandle, offset++); if (fileName == NULL) { break; } /* Are we done? */ if (fileName->length == 0) { success = TRUE; break; } /* * Escape this filename. If we get back a negative result, it means that * the escaped filename is too big, so skip this share. */ if (HgfsEscape_Do(fileName->name, fileName->length, sizeof escapedName, escapedName) < 0) { continue; } /* Skip "." and ".." which can be returned. */ if (strcmp(".", escapedName) == 0 || strcmp("..", escapedName) == 0) { continue; } printf("%s\n", escapedName); } if (!HgfsClient_Close(rootHandle)) { success = FALSE; } return success; } /* *----------------------------------------------------------------------------- * * HgfsClient_Init -- * * Do some initialization "stuff". * * Results: * TRUE if initialization succeeded, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool HgfsClient_Init(void) { Bool success = FALSE; GKeyFile *conf = NULL; VMTools_LoadConfig(NULL, G_KEY_FILE_NONE, &conf, NULL); VMTools_ConfigLogging("hgfsclient", conf, FALSE, FALSE); if (conf != NULL) { g_key_file_free(conf); conf = NULL; } if (!VmCheck_IsVirtualWorld()) { Warning("This application must be run in a Virtual Machine.\n"); goto out; } /* Setup an HGFS channel and packet buffer. */ gChannel = HgfsBd_GetChannel(); if (gChannel == NULL) { Warning("Failed to create RPC channel\n"); goto out; } gPacketBuffer = HgfsBd_GetBuf(); if (gPacketBuffer == NULL) { Warning("Failed to create packet buffer\n"); goto out; } /* Find out if HGFS is enabled in the VMX. */ if (!HgfsBd_Enabled(gChannel, gPacketBuffer)) { Warning("HGFS is disabled in the host\n"); goto out; } success = TRUE; out: if (!success) { HgfsClient_Cleanup(); } return success; } /* *----------------------------------------------------------------------------- * * HgfsClient_Cleanup -- * * Do some cleanup crap. * * Results: * TRUE if cleanup succeeded, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool HgfsClient_Cleanup(void) { Bool success = TRUE; if (gPacketBuffer != NULL) { HgfsBd_PutBuf(gPacketBuffer); } if (gChannel != NULL) { if (!HgfsBd_CloseChannel(gChannel)) { Warning("Failed to close RPC channel\n"); success = FALSE; } } return success; } /* *----------------------------------------------------------------------------- * * main -- * * Main entry point. Calls into the host's HGFS server and prints out * a list of the available shares. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ int main(int argc, // IN char *argv[]) // IN { if (!HgfsClient_Init()) { return EXIT_FAILURE; } if (!HgfsClient_PrintShares()) { return EXIT_FAILURE; } if (!HgfsClient_Cleanup()) { return EXIT_FAILURE; } return EXIT_SUCCESS; } open-vm-tools-10.0.7-3227872/hgfsclient/hgfsclient_version.h0000644000000000000000000000305512660700525022050 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsclient_version.h -- * * Version definitions for the HGFS userspace client application. */ #ifndef _HGFSCLIENT_VERSION_H_ #define _HGFSCLIENT_VERSION_H_ /* * This component's version is coupled with Tools versioning. The effect * is that the version increments with each build, and with each Tools * version bump. If and when it becomes necessary to version the component * manually, make sure that the version is bumped any time the component or * its dependencies are changed. */ #include "vm_tools_version.h" #define HGFSCLIENT_VERSION_COMMAS TOOLS_VERSION_EXT_CURRENT_CSV #define HGFSCLIENT_VERSION_STRING TOOLS_VERSION_EXT_CURRENT_STR #endif /* _HGFSCLIENT_VERSION_H_ */ open-vm-tools-10.0.7-3227872/hgfsclient/Makefile.in0000644000000000000000000004744712660700525020066 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ bin_PROGRAMS = vmware-hgfsclient$(EXEEXT) @HAVE_ICU_TRUE@am__append_1 = @ICU_LIBS@ subdir = hgfsclient DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_vmware_hgfsclient_OBJECTS = vmware_hgfsclient-hgfsclient.$(OBJEXT) vmware_hgfsclient_OBJECTS = $(am_vmware_hgfsclient_OBJECTS) am__DEPENDENCIES_1 = vmware_hgfsclient_DEPENDENCIES = ../lib/hgfsBd/libHgfsBd.la \ $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(vmware_hgfsclient_SOURCES) DIST_SOURCES = $(vmware_hgfsclient_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ vmware_hgfsclient_LDADD = ../lib/hgfsBd/libHgfsBd.la @VMTOOLS_LIBS@ \ @HGFS_LIBS@ $(am__append_1) vmware_hgfsclient_CPPFLAGS = @VMTOOLS_CPPFLAGS@ vmware_hgfsclient_SOURCES = hgfsclient.c @HAVE_ICU_FALSE@vmware_hgfsclient_LINK = $(LINK) @HAVE_ICU_TRUE@vmware_hgfsclient_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ @HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) \ @HAVE_ICU_TRUE@ $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ @HAVE_ICU_TRUE@ $(LDFLAGS) -o $@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 hgfsclient/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu hgfsclient/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(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 vmware-hgfsclient$(EXEEXT): $(vmware_hgfsclient_OBJECTS) $(vmware_hgfsclient_DEPENDENCIES) @rm -f vmware-hgfsclient$(EXEEXT) $(vmware_hgfsclient_LINK) $(vmware_hgfsclient_OBJECTS) $(vmware_hgfsclient_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware_hgfsclient-hgfsclient.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 $@ $< vmware_hgfsclient-hgfsclient.o: hgfsclient.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_hgfsclient_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_hgfsclient-hgfsclient.o -MD -MP -MF $(DEPDIR)/vmware_hgfsclient-hgfsclient.Tpo -c -o vmware_hgfsclient-hgfsclient.o `test -f 'hgfsclient.c' || echo '$(srcdir)/'`hgfsclient.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_hgfsclient-hgfsclient.Tpo $(DEPDIR)/vmware_hgfsclient-hgfsclient.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hgfsclient.c' object='vmware_hgfsclient-hgfsclient.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_hgfsclient_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_hgfsclient-hgfsclient.o `test -f 'hgfsclient.c' || echo '$(srcdir)/'`hgfsclient.c vmware_hgfsclient-hgfsclient.obj: hgfsclient.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_hgfsclient_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT vmware_hgfsclient-hgfsclient.obj -MD -MP -MF $(DEPDIR)/vmware_hgfsclient-hgfsclient.Tpo -c -o vmware_hgfsclient-hgfsclient.obj `if test -f 'hgfsclient.c'; then $(CYGPATH_W) 'hgfsclient.c'; else $(CYGPATH_W) '$(srcdir)/hgfsclient.c'; fi` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/vmware_hgfsclient-hgfsclient.Tpo $(DEPDIR)/vmware_hgfsclient-hgfsclient.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='hgfsclient.c' object='vmware_hgfsclient-hgfsclient.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(vmware_hgfsclient_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmware_hgfsclient-hgfsclient.obj `if test -f 'hgfsclient.c'; then $(CYGPATH_W) 'hgfsclient.c'; else $(CYGPATH_W) '$(srcdir)/hgfsclient.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) installdirs: for dir in "$(DESTDIR)$(bindir)"; 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-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic 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-binPROGRAMS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/hgfsclient/COPYING0000644000000000000000000006347112660700525017047 0ustar rootroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! open-vm-tools-10.0.7-3227872/hgfsmounter/0000755000000000000000000000000012660700525016214 5ustar rootrootopen-vm-tools-10.0.7-3227872/hgfsmounter/Makefile.am0000644000000000000000000000340212660700525020247 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ sbin_PROGRAMS = mount.vmhgfs mount_vmhgfs_LDADD = mount_vmhgfs_LDADD += ../lib/string/libString.la mount_vmhgfs_LDADD += ../lib/panicDefault/libPanicDefault.la mount_vmhgfs_LDADD += ../lib/panic/libPanic.la mount_vmhgfs_LDADD += ../lib/lock/libLock.la mount_vmhgfs_LDADD += ../lib/misc/libMisc.la mount_vmhgfs_LDADD += ../lib/stubs/libStubs.la mount_vmhgfs_SOURCES = mount_vmhgfs_SOURCES += hgfsmounter.c if FREEBSD install-exec-hook: mv $(DESTDIR)$(sbindir)/mount.vmhgfs \ $(DESTDIR)$(sbindir)/mount_vmhgfs -$(MKDIR_P) $(DESTDIR)/sbin -$(LN_S) $(DESTDIR)$(sbindir)/mount_vmhgfs \ $(DESTDIR)/sbin/mount_vmhgfs &> /dev/null uninstall-hook: rm -f $(DESTDIR)$(sbindir)/mount_vmhgfs else install-exec-hook: -$(MKDIR_P) $(DESTDIR)/sbin -$(LN_S) $(DESTDIR)$(sbindir)/mount.vmhgfs \ $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null uninstall-hook: rm -f $(DESTDIR)/sbin/mount.vmhgfs endif !FREEBSD open-vm-tools-10.0.7-3227872/hgfsmounter/hgfsmounter_version.h0000644000000000000000000000305712660700525022500 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsmounter_version.h -- * * Version definitions for the HGFS mount helper application. */ #ifndef _HGFSMOUNTER_VERSION_H_ #define _HGFSMOUNTER_VERSION_H_ /* * This component's version is coupled with Tools versioning. The effect * is that the version increments with each build, and with each Tools * version bump. If and when it becomes necessary to version the component * manually, make sure that the version is bumped any time the component or * its dependencies are changed. */ #include "vm_tools_version.h" #define HGFSMOUNTER_VERSION_COMMAS TOOLS_VERSION_EXT_CURRENT_CSV #define HGFSMOUNTER_VERSION_STRING TOOLS_VERSION_EXT_CURRENT_STR #endif /* _HGFSMOUNTER_VERSION_H_ */ open-vm-tools-10.0.7-3227872/hgfsmounter/hgfsmounter.c0000644000000000000000000010457012660700525020730 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsmounter.c -- * * Helper app for mounting HGFS shares on Linux and FreeBSD. On Linux, we need this * because we must pass a binary blob through mount(2) to the HGFS driver, in order * to properly communicate the share name that we're interested in mounting. On * FreeBSD, we need this because FreeBSD requires that each filesystem type have a * separate mount program installed as /sbin/mount_fstype */ #define _GNU_SOURCE #include #include #include #include #if defined(linux) # include #endif #if defined(__FreeBSD__) || defined(__APPLE__) # include # include # define MS_MANDLOCK 0 # define MS_RDONLY MNT_RDONLY # define MS_SYNCHRONOUS MNT_SYNCHRONOUS # define MS_NOEXEC MNT_NOEXEC # define MS_NOSUID MNT_NOSUID /* * MNT_NODEV does not exist, or is set to 0, on newer versions of FreeBSD. */ # if defined(MNT_NODEV) && MNT_NODEV # define MS_NODEV MNT_NODEV # endif # define MS_UNION MNT_UNION # define MS_ASYNC MNT_ASYNC # define MS_SUIDDIR MNT_SUIDDIR # define MS_SOFTDEP MNT_SOFTDEP # define MS_NOSYMFOLLOW MNT_NOSYMFOLLOW # define MS_JAILDEVFS MNT_JAILDEVFS # define MS_MULTILABEL MNT_MULTILABEL # define MS_ACLS MNT_ACLS # define MS_NODIRATIME 0 # define MS_NOCLUSTERR MNT_NOCLUSTERR # define MS_NOCLUSTERW MNT_NOCLUSTERW # define MS_REMOUNT MNT_RELOAD # if defined(__FreeBSD__) # define MS_NOATIME MNT_NOATIME # elif defined(__APPLE__) /* * XXX This is defined in the sys/mount.h in the OS X 10.5 Kernel.framework but not the * 10.4 one. Once this is built against the newer library, this should be changed. */ # define MS_NOATIME 0 # endif #endif #include #include #include #include #include #include #include #include #ifdef MOUNTED /* defined in mntent.h */ /* * If VM_HAVE_MTAB is set, hgfsmounter will update /etc/mtab. This is not necessary on * systems such as FreeBSD (and possibly Solaris) that don't have a mtab or the mntent.h * routines. */ # define VM_HAVE_MTAB 1 #endif #include "hgfsDevLinux.h" #include "vm_basic_types.h" #include "vm_basic_defs.h" #include "vm_assert.h" #include "str.h" #include "strutil.h" #include "vm_version.h" #include "hgfsmounter_version.h" /* XXX embed_version.h does not currently support Mach-O binaries (OS X). */ #if defined(linux) || defined(__FreeBSD__) # include "vm_version.h" # include "embed_version.h" VM_EMBED_VERSION(HGFSMOUNTER_VERSION_STRING); #endif /* * Not defined in glibc 2.1.3 */ #ifndef MS_BIND #define MS_BIND 4096 #endif #ifndef MS_MOVE #define MS_MOVE 8192 #endif #define MOUNT_OPTS_BUFFER_SIZE 256 #if defined(__GNUC__) && __GNUC__ < 3 /* __VA_ARGS__ isn't supported by old gcc's, so hack around the situation */ #define LOG(format...) (beVerbose ? printf(format) : 0) #else #define LOG(format, ...) (beVerbose ? printf(format, ##__VA_ARGS__) : 0) #endif typedef struct MountOptions { char *opt; /* Option name */ int flag; /* Corresponding flag */ Bool set; /* Whether the flag should be set or reset */ char *helpMsg; /* Help message for the option */ char *logMsg; /* Log message to emit when option was detected */ /* Special handler for more complex options */ Bool (*handler)(const char *opt, HgfsMountInfo *mountInfo, int *flags); } MountOptions; static char *thisProgram; static char *thisProgramBase; static char *shareName; static char *mountPoint; static Bool beVerbose = FALSE; /* *----------------------------------------------------------------------------- * * PrintVersion -- * * Displays version and exits with success. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void PrintVersion(void) { printf("%s version: %s\n", thisProgramBase, HGFSMOUNTER_VERSION_STRING); exit(EXIT_SUCCESS); } /* *----------------------------------------------------------------------------- * * GetPathMax * * Helper function to get the system's maximum path length for a given * path. In userspace, PATH_MAX may not be defined, and we must use * pathconf(3) to get its value. * * This is the realpath(3)-approved way of getting the maximum path size, * inasmuch as realpath(3) can be an approved function (see the BUGS section * in the manpage for details). * * Results: * Always succeeds, returns the maximum path size. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static size_t GetPathMax(const char *path) // IN: path to check { size_t pathMax; #ifndef PATH_MAX long sysPathMax; /* * pathconf(3) may return -1 if the system imposes no pathname bound, or if * there was an error. In any case, we're advised by realpath(3)'s manpage * not to use the result of pathconf for direct allocation, as it may be too * large. So we declare 4096 as our upper bound, to be used when pathconf(3) * returns an error, returns zero, returns a very large quantity, or when * we learn that there's no limit. */ sysPathMax = pathconf(path, _PC_PATH_MAX); if (sysPathMax <= 0 || sysPathMax > 4096) { pathMax = 4096; } else { pathMax = sysPathMax; } #else pathMax = PATH_MAX; #endif return pathMax; } /* *----------------------------------------------------------------------------- * * IsValidShareName * * A helper function to parse the share name from "host:share" format into * two separate strings, reporting errors if any. * * Results: * TRUE on success, shareNameHost and shareNameDir have been set. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool ParseShareName(const char *shareName, // IN: Share name to validate const char **shareNameHost, // OUT: Share name, host component const char **shareNameDir) // OUT: Share name, dir component { const char *colon; const char *dir; /* 1) Must be colon separated into host and dir. */ colon = strchr(shareName, ':'); if (colon == NULL) { printf("Share name must be in host:dir format\n"); return FALSE; } /* 2) Dir must not be empty. */ dir = colon + 1; if (*dir == '\0') { printf("Directory in share name must not be empty\n"); return FALSE; } /* 3) Dir must start with forward slash. */ if (*dir != '/') { printf("Directory in share name must be an absolute path\n"); return FALSE; } /* 4) Host must be ".host". */ if (strncmp(shareName, ".host:", 6) != 0) { printf("Host in share name must be \".host\"\n"); return FALSE; } *shareNameHost = ".host"; LOG("Host component of share name is \"%s\"\n", *shareNameHost); *shareNameDir = dir; LOG("Directory component of share name is \"%s\"\n", *shareNameDir); return TRUE; } /* *----------------------------------------------------------------------------- * * ParseUid * * A helper function to process a string containing either a user name * or a uid and set up mountInfo accordingly. * * Results: * TRUE on success, mountInfo modified appropriately, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ #ifndef sun static Bool ParseUid(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags { Bool success = FALSE; unsigned int idx = 0; char *optString; char *uidString; uid_t myUid = 0; ASSERT(option); ASSERT(mountInfo); ASSERT(flags); /* Figure where value starts, we don't need result, just index. */ optString = StrUtil_GetNextToken(&idx, option, "="); ASSERT(optString); uidString = StrUtil_GetNextToken(&idx, option, "="); if (!uidString) { LOG("Error getting the value for uid\n"); goto out; } /* * The uid can be a direct value or a username which we must first * translate to its numeric value. */ if (isdigit(*uidString)) { errno = 0; myUid = strtoul(uidString, NULL, 10); if (errno == 0) { success = TRUE; } else { printf("Bad UID value \"%s\"\n", uidString); } } else { struct passwd *pw; if (!(pw = getpwnam(uidString))) { printf("Bad user name \"%s\"\n", uidString); } else { myUid = pw->pw_uid; success = TRUE; } endpwent(); } if (success) { mountInfo->uid = myUid; mountInfo->uidSet = TRUE; LOG("Setting mount owner to %"FMTUID"\n", myUid); } free(uidString); out: free(optString); return success; } #endif /* *----------------------------------------------------------------------------- * * ParseGid * * A helper function to process a string containing either a group name * or a gid and set up mountInfo accordingly. * * Results: * TRUE on success, mountInfo modified appropriately, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ #ifndef sun static Bool ParseGid(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags { Bool success = FALSE; unsigned int idx = 0; char *optString; char *gidString; gid_t myGid = 0; ASSERT(option); ASSERT(mountInfo); ASSERT(flags); /* Figure where value starts, we don't need result, just index. */ optString = StrUtil_GetNextToken(&idx, option, "="); ASSERT(optString); gidString = StrUtil_GetNextToken(&idx, option, "="); if (!gidString) { LOG("Error getting the value for gid\n"); goto out; } /* * The gid can be a direct value or a group name which we must first * translate to its numeric value. */ if (isdigit(*gidString)) { errno = 0; myGid = strtoul(gidString, NULL, 10); if (errno == 0) { success = TRUE; } else { printf("Bad GID value \"%s\"\n", gidString); } } else { struct group *gr; if (!(gr = getgrnam(gidString))) { printf("Bad group name \"%s\"\n", gidString); } else { myGid = gr->gr_gid; success = TRUE; } endpwent(); } if (success) { mountInfo->gid = myGid; mountInfo->gidSet = TRUE; LOG("Setting mount group to %"FMTUID"\n", myGid); } free(gidString); out: free(optString); return success; } #endif /* *----------------------------------------------------------------------------- * * ParseMask * * A helper function to parse a string containing File/Directory * mask value. * * Results: * TRUE on success, along with the mask, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ #ifndef sun static Bool ParseMask(const char *option, // IN: option string along with value unsigned short *pmask) // OUT: parsed mask { Bool success = FALSE; unsigned int idx = 0; char *optString; char *maskString; unsigned short mask; optString = StrUtil_GetNextToken(&idx, option, "="); ASSERT(optString); maskString = StrUtil_GetNextToken(&idx, option, "="); if (!maskString) { LOG("Error getting the value for %s\n", optString); goto out; } /* * The way to check for an overflow in strtol(3), according to its * man page. */ errno = 0; mask = strtol(maskString, NULL, 8); if (errno == 0) { *pmask = mask; success = TRUE; } else { LOG("Error, overflow in %s\n", optString); } free(maskString); out: free(optString); return success; } #endif /* *----------------------------------------------------------------------------- * * ParseFmask * * A helper function to process a string containing File mask value. * * Results: * TRUE on success, mountInfo modified appropriately, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ #ifndef sun static Bool ParseFmask(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags { ASSERT(option); ASSERT(mountInfo); if (ParseMask(option, &mountInfo->fmask)) { LOG("Setting mount fmask to %o\n", mountInfo->fmask); return TRUE; } return FALSE; } #endif /* *----------------------------------------------------------------------------- * * ParseDmask * * A helper function to process a string containing dmask value. * * Results: * TRUE on success, mountInfo modified appropriately, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ #ifndef sun static Bool ParseDmask(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags { ASSERT(option); ASSERT(mountInfo); if (ParseMask(option, &mountInfo->dmask)) { LOG("Setting mount dmask to %o\n", mountInfo->dmask); return TRUE; } return FALSE; } #endif /* *----------------------------------------------------------------------------- * * ParseTtl * * A helper function to process a string containing TTL value. * * Results: * TRUE on success, mountInfo modified appropriately, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ #ifndef sun static Bool ParseTtl(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags { Bool success = FALSE; unsigned int idx = 0; char *optString; int32 ttl; ASSERT(option); ASSERT(mountInfo); ASSERT(flags); /* Figure where value starts, we don't need result, just index. */ optString = StrUtil_GetNextToken(&idx, option, "="); ASSERT(optString); if (StrUtil_GetNextIntToken(&ttl, &idx, option, "=") && ttl >= 0) { LOG("Setting maximum attribute TTL to %u\n", ttl); mountInfo->ttl = ttl; success = TRUE; } else { LOG("Error getting the value for ttl\n"); } free(optString); return success; } #endif /* *----------------------------------------------------------------------------- * * ParseServerIno -- * * A helper function to process a string containing serverino value. * * Results: * TRUE always success. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool ParseServerIno(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags unused { ASSERT(option); ASSERT(mountInfo); mountInfo->flags |= HGFS_MNTINFO_SERVER_INO; LOG("Setting mount flag server ino in 0x%x\n", mountInfo->flags); return TRUE; } /* *----------------------------------------------------------------------------- * * ParseNoServerIno -- * * A helper function to process a string containing noserverino value. * * Results: * TRUE always success. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool ParseNoServerIno(const char *option, // IN: option string along with value HgfsMountInfo *mountInfo, // OUT: mount data int *flags) // OUT: mount flags unused { ASSERT(option); ASSERT(mountInfo); mountInfo->flags &= ~HGFS_MNTINFO_SERVER_INO; LOG("Clearing mount flag server ino in 0x%x\n", mountInfo->flags); return TRUE; } static MountOptions mountOptions[] = { { "ro", MS_RDONLY, TRUE, "mount read-only", "Setting mount read-only", NULL }, { "rw", MS_RDONLY, FALSE, "mount read-write", "Setting mount read-write", NULL }, { "nosuid", MS_NOSUID, TRUE, "ignore suid/sgid bits", "Setting mount option for allowing suid/sgid bits off", NULL }, { "suid", MS_NOSUID, FALSE, "allow suid/sgid bits (default)", "Setting mount option for allowing suid/sgid bits on", NULL }, #ifndef sun /* Solaris does not have any of these options */ { "uid=", 0, TRUE, "mount owner (by uid or username)", NULL, ParseUid }, { "gid=", 0, TRUE, "mount group (by gid or groupname)", NULL, ParseGid }, { "fmask=", 0, TRUE, "file umask (in octal)", NULL, ParseFmask }, { "dmask=", 0, TRUE, "directory umask (in octal)", NULL, ParseDmask }, #ifdef MS_NODEV { "nodev", MS_NODEV, TRUE, "prevent device node access", "Setting mount option for accessing device nodes off", NULL }, { "dev", MS_NODEV, FALSE, "allow device node access (default)", "Setting mount option for accessing device nodes on", NULL }, #endif { "noexec", MS_NOEXEC, TRUE, "prevent program execution", "Setting mount option for program execution off", NULL }, { "exec", MS_NOEXEC, FALSE, "allow program execution (default)", "Setting mount option for program execution on", NULL }, { "sync", MS_SYNCHRONOUS, TRUE, "file writes are synchronous", "Setting mount synchronous writes", NULL }, { "async", MS_SYNCHRONOUS, FALSE, "file writes are asynchronous (default)", "Setting mount synchronous writes", NULL }, { "mand", MS_MANDLOCK, TRUE, "allow mandatory locks", "Setting mount option for allow mandatory locks on", NULL }, { "nomand", MS_MANDLOCK, FALSE, "prevent mandatory locks (default)", "Setting mount option for allow mandatory locks off", NULL }, { "noatime", MS_NOATIME, TRUE, "do not update access times", "Setting mount option for updating access times off", NULL }, { "atime", MS_NOATIME, FALSE, "update access times (default)", "Setting mount option for updating access times on", NULL }, { "nodiratime", MS_NOATIME, TRUE, "do not update directory access times", "Setting mount option for updating directory access times off", NULL }, { "diratime", MS_NOATIME, FALSE, "update access directory times (default)", "Setting mount option for updating directory access times on", NULL }, { "ttl=", 0, TRUE, "time before file attributes must be\n" "revalidated (in seconds). Improves\n" "performance but decreases coherency.\n" "Defaults to 1 if not set.\n", NULL, ParseTtl }, { "bind", MS_BIND, TRUE, "perform bind mount", "Setting mount type to bind", NULL }, { "bind", MS_MOVE, TRUE, "move an existig mount point", "Setting mount type to move", NULL }, #endif { "serverino", 0, TRUE, "Use server generated inode numbers.\n", "Setting mount option for using Server inode numbers on", ParseServerIno }, { "noserverino", 0, FALSE, "Use client generated inode numbers.\n", "Setting mount option for using Server inode numbers off", ParseNoServerIno }, { "remount", MS_REMOUNT, TRUE, "remount already mounted filesystem", "Setting mount type to remount", NULL } }; /* *----------------------------------------------------------------------------- * * ParseOptions -- * * Parses the options passed in by mount. Note that this doesn't correspond * to the entire argument string, merely the "-o opt1=val1,opt2=val2" * section. * * Results: * TRUE if there were no problems. * FALSE if there was an issue parsing an option. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool ParseOptions(const char *optionString, // IN: Option string to parse HgfsMountInfo *mountInfo, // OUT: Where we put the results int *flags) // OUT: Flags we might modify { unsigned int commaIndex = 0; Bool success = FALSE; char *key = NULL; char *keyVal = NULL; int i; ASSERT(optionString); ASSERT(mountInfo); ASSERT(flags); /* Parse the options string. */ LOG("Parsing option string: %s\n", optionString); /* Loop to tokenize ,,. */ while ((keyVal = StrUtil_GetNextToken(&commaIndex, optionString, ",")) != NULL) { /* Now tokenize [=]. */ unsigned int equalsIndex = 0; key = StrUtil_GetNextToken(&equalsIndex, keyVal, "="); if (key == NULL) { printf("Malformed options string\n"); goto out; } for (i = 0; i < ARRAYSIZE(mountOptions); i++) { Bool match = FALSE; unsigned int idx = 0; char *optName = StrUtil_GetNextToken(&idx, mountOptions[i].opt, "="); if (!optName) { printf("Failed to parse option name, out of memory?\n"); goto out; } match = strcmp(key, optName) == 0; free(optName); if (match) { if (mountOptions[i].handler) { if (!mountOptions[i].handler(keyVal, mountInfo, flags)) { goto out; } } else { if (mountOptions[i].set) { *flags |= mountOptions[i].flag; } else { *flags &= ~mountOptions[i].flag; } LOG("%s\n", mountOptions[i].logMsg); } break; } } if (i == ARRAYSIZE(mountOptions)) { LOG("Skipping unrecognized option \"%s\"\n", key); } free(key); free(keyVal); key = NULL; keyVal = NULL; } success = TRUE; out: free(key); free(keyVal); return success; } /* *----------------------------------------------------------------------------- * * PrintUsage -- * * Displays usage for the HGFS mounting utility, and exits with failure. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void PrintUsage(void) { int i; printf("Usage: %s [-o ]\n", thisProgramBase); printf("Mount the HGFS share, specified by name, to a local directory.\n"); printf("Share name must be in host:dir format.\n\nOptions:\n"); for (i = 0; i < ARRAYSIZE(mountOptions); i++) { Bool printOptName = TRUE; unsigned int tokidx = 0; char *msg; while ((msg = StrUtil_GetNextToken(&tokidx, mountOptions[i].helpMsg, "\n")) != NULL) { printf(" %-15s %s\n", printOptName ? mountOptions[i].opt : "", msg); free(msg); printOptName = FALSE; } } printf("\n"); printf("This command is intended to be run from within /bin/mount by\n"); printf("passing the option '-t %s'. For example:\n", HGFS_NAME); printf(" mount -t %s .host:/ /mnt/hgfs/\n", HGFS_NAME); printf(" mount -t %s .host:/foo /mnt/foo\n", HGFS_NAME); printf(" mount -t %s .host:/foo/bar /var/lib/bar\n", HGFS_NAME); exit(EXIT_FAILURE); } #ifdef VM_HAVE_MTAB /* *----------------------------------------------------------------------------- * * UpdateMtab -- * * Write the results of the mount into /etc/mtab. * * Results: * None. * * Side effects: * May write to /etc/mtab. * *----------------------------------------------------------------------------- */ static void UpdateMtab(HgfsMountInfo *mountInfo, // IN: Info to write into mtab int flags) // IN: Flags (read-only, etc.) { struct mntent mountEnt; FILE *mountFile; struct passwd *password; char *userName = NULL; ASSERT(mountInfo); mountFile = setmntent(MOUNTED, "a+"); if (mountFile == NULL) { printf("Could not open mtab for appending, continuing sans mtab\n"); return; } /* We only care about the mounting user if it isn't root. */ if (getuid() != 0) { password = getpwuid(getuid()); if (password == NULL) { printf("Could not get user for mounting uid, skipping user entry\n"); } else { userName = password->pw_name; } } /* * Create the mtab entry to be written. We'll go ahead and try to write * even if we fail to allocate the mount options. */ mountEnt.mnt_fsname = shareName; mountEnt.mnt_dir = mountPoint; mountEnt.mnt_type = HGFS_NAME; mountEnt.mnt_freq = 0; mountEnt.mnt_passno = 0; mountEnt.mnt_opts = malloc(MOUNT_OPTS_BUFFER_SIZE); if (mountEnt.mnt_opts) { char *ttlString; memset(mountEnt.mnt_opts, 0, MOUNT_OPTS_BUFFER_SIZE); /* * These are typically the displayed options in /etc/mtab (note that not * all options are typically displayed, just those the user may find * interesting). */ if (flags & MS_RDONLY) { Str_Strcat(mountEnt.mnt_opts, "ro", MOUNT_OPTS_BUFFER_SIZE); } else { Str_Strcat(mountEnt.mnt_opts, "rw", MOUNT_OPTS_BUFFER_SIZE); } if (flags & MS_NOSUID) { Str_Strcat(mountEnt.mnt_opts, ",nosuid", MOUNT_OPTS_BUFFER_SIZE); } #ifdef MS_NODEV if (flags & MS_NODEV) { Str_Strcat(mountEnt.mnt_opts, ",nodev", MOUNT_OPTS_BUFFER_SIZE); } #endif if (flags & MS_NOEXEC) { Str_Strcat(mountEnt.mnt_opts, ",noexec", MOUNT_OPTS_BUFFER_SIZE); } if (flags & MS_SYNCHRONOUS) { Str_Strcat(mountEnt.mnt_opts, ",sync", MOUNT_OPTS_BUFFER_SIZE); } if (flags & MS_MANDLOCK) { Str_Strcat(mountEnt.mnt_opts, ",mand", MOUNT_OPTS_BUFFER_SIZE); } if (flags & MS_NOATIME) { Str_Strcat(mountEnt.mnt_opts, ",noatime", MOUNT_OPTS_BUFFER_SIZE); } if (flags & MS_NODIRATIME) { Str_Strcat(mountEnt.mnt_opts, ",nodiratime", MOUNT_OPTS_BUFFER_SIZE); } if (userName != NULL) { Str_Strcat(mountEnt.mnt_opts, ",user=", MOUNT_OPTS_BUFFER_SIZE); Str_Strcat(mountEnt.mnt_opts, userName, MOUNT_OPTS_BUFFER_SIZE); } ttlString = Str_Asprintf(NULL, "%u", mountInfo->ttl); if (ttlString != NULL) { Str_Strcat(mountEnt.mnt_opts, ",ttl=", MOUNT_OPTS_BUFFER_SIZE); Str_Strcat(mountEnt.mnt_opts, ttlString, MOUNT_OPTS_BUFFER_SIZE); free(ttlString); } else { printf("Could not allocate memory for ttl entry in mtab, " "continuing\n"); } } /* Add the entry and close. */ if (addmntent(mountFile, &mountEnt)) { printf("Could not add entry to mtab, continuing\n"); } endmntent(mountFile); if (mountEnt.mnt_opts) { free(mountEnt.mnt_opts); } } #endif /*----------------------------------------------------------------------------- * * main -- * * Main entry point. Parses the mount options received, makes a call to * mount(2), and handles the results. * * Results: * Zero on success, non-zero on failure. * * Side effects: * May mount an HGFS filesystem. * *----------------------------------------------------------------------------- */ int main(int argc, // IN char *argv[]) // IN { #ifdef VM_HAVE_MTAB Bool doMtab = TRUE; #endif char c; int i; int result = EXIT_FAILURE; int flags = 0; int mntRes = -1; char *optionString = NULL; const char *shareNameHost = NULL; const char *shareNameDir = NULL; struct stat statBuf; HgfsMountInfo mountInfo; char *canonicalizedPath = NULL; size_t pathMax; thisProgram = argv[0]; /* Compute the base name of the program, too. */ thisProgramBase = strrchr(thisProgram, '/'); if (thisProgramBase != NULL) { thisProgramBase++; } else { thisProgramBase = thisProgram; } setpwent(); if (argc < 3) { PrintUsage(); } while ((c = getopt(argc, argv, "hno:vV")) != -1) { switch (c) { case '?': case 'h': PrintUsage(); #ifdef VM_HAVE_MTAB case 'n': doMtab = FALSE; break; #endif case 'o': if (optionString == NULL) { optionString = strdup(optarg); } else { size_t newLength; char *savedString = optionString; newLength = strlen(optionString) + strlen(",") + strlen(optarg) + sizeof '\0'; optionString = realloc(optionString, newLength); if (optionString != NULL) { Str_Strcat(optionString, ",", newLength); Str_Strcat(optionString, optarg, newLength); } else { free(savedString); } } if (optionString == NULL) { printf("Error: could not allocate memory for options\n"); goto out; } break; case 'v': beVerbose = TRUE; break; case 'V': PrintVersion(); default: printf("Error: unknown mount option %c\n", c); PrintUsage(); } } LOG("Original command line: \"%s", thisProgram); for (i = 1; i < argc; i++) { LOG(" %s", argv[i]); } LOG("\"\n"); /* After getopt_long(3), optind is the first non-option argument. */ shareName = argv[optind]; mountPoint = argv[optind + 1]; /* * We canonicalize the mount point to avoid any discrepancies between the actual mount * point and the listed mount point in /etc/mtab (such discrepancies could prevent * umount(8) from removing the mount point from /etc/mtab). */ pathMax = GetPathMax(mountPoint); canonicalizedPath = malloc(pathMax * sizeof *canonicalizedPath); if (canonicalizedPath == NULL) { printf("Error: cannot allocate memory for canonicalized path, " "aborting mount\n"); goto out; } else if (!realpath(mountPoint, canonicalizedPath)) { perror("Error: cannot canonicalize mount point"); goto out; } mountPoint = canonicalizedPath; if (!ParseShareName(shareName, &shareNameHost, &shareNameDir)) { printf("Error: share name is invalid, aborting mount\n"); goto out; } mountInfo.magicNumber = HGFS_SUPER_MAGIC; mountInfo.infoSize = sizeof mountInfo; mountInfo.version = HGFS_PROTOCOL_VERSION; #ifndef sun mountInfo.fmask = 0; mountInfo.dmask = 0; mountInfo.uidSet = FALSE; mountInfo.gidSet = FALSE; mountInfo.ttl = HGFS_DEFAULT_TTL; #if defined(__APPLE__) strlcpy(mountInfo.shareNameHost, shareNameHost, MAXPATHLEN); strlcpy(mountInfo.shareNameDir, shareNameDir, MAXPATHLEN); #else mountInfo.shareNameHost = shareNameHost; mountInfo.shareNameDir = shareNameDir; #endif #endif /* * Default flags which maybe modified by user passed options. */ mountInfo.flags = HGFS_MNTINFO_SERVER_INO; /* * This'll write the rest of the options into HgfsMountInfo and possibly * modify the flags. */ if (optionString && !ParseOptions(optionString, &mountInfo, &flags)) { printf("Error: could not parse options string\n"); goto out; } /* Do some sanity checks on our desired mount point. */ if (stat(mountPoint, &statBuf)) { perror("Error: cannot stat mount point"); goto out; } if (S_ISDIR(statBuf.st_mode) == 0) { printf("Error: mount point \"%s\" is not a directory\n", mountPoint); goto out; } /* * Must be root in one flavor or another. If we're suid root, only proceed * if the user owns the mountpoint. */ if (geteuid() != 0) { printf("Error: either you're not root, or %s isn't installed SUID\n", thisProgram); goto out; } else if (getuid() != 0 && (getuid() != statBuf.st_uid || (statBuf.st_mode & S_IRWXU) != S_IRWXU)) { printf("Error: for user mounts, user must own the mount point\n"); goto out; } /* Go! */ #if defined(linux) mntRes = mount(shareName, mountPoint, HGFS_NAME, flags, &mountInfo); #elif defined(__FreeBSD__) { struct iovec iov[] = {{"fstype", sizeof("fstype")}, {HGFS_NAME, sizeof(HGFS_NAME)}, {"target", sizeof("target")}, {shareName, strlen(shareName) + 1}, {"fspath", sizeof("fspath")}, {(void *)mountPoint, strlen(mountPoint) + 1}, {"uidSet", sizeof("uidSet")}, {&mountInfo.uidSet, sizeof(mountInfo.uidSet)}, {"uid", sizeof("uid")}, {&mountInfo.uid, sizeof(mountInfo.uid)}, {"gidSet", sizeof("gidSet")}, {&mountInfo.gidSet, sizeof(mountInfo.gidSet)}, {"gid", sizeof("gid")}, {&mountInfo.gid, sizeof(mountInfo.gid)}}; mntRes = nmount(iov, ARRAYSIZE(iov), flags); } #elif defined(__APPLE__) mntRes = mount(HGFS_NAME, mountPoint, flags, &mountInfo); #elif defined(sun) mntRes = mount(mountPoint, mountPoint, MS_DATA | flags, HGFS_NAME, &mountInfo, sizeof mountInfo); #endif if (mntRes) { perror("Error: cannot mount filesystem"); goto out; } result = EXIT_SUCCESS; #ifdef VM_HAVE_MTAB if (doMtab) { UpdateMtab(&mountInfo, flags); } #endif out: free(optionString); free(canonicalizedPath); return result; } open-vm-tools-10.0.7-3227872/hgfsmounter/Makefile.in0000644000000000000000000004460212660700525020267 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ sbin_PROGRAMS = mount.vmhgfs$(EXEEXT) subdir = hgfsmounter DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(sbin_PROGRAMS) am_mount_vmhgfs_OBJECTS = hgfsmounter.$(OBJEXT) mount_vmhgfs_OBJECTS = $(am_mount_vmhgfs_OBJECTS) mount_vmhgfs_DEPENDENCIES = ../lib/string/libString.la \ ../lib/panicDefault/libPanicDefault.la \ ../lib/panic/libPanic.la ../lib/lock/libLock.la \ ../lib/misc/libMisc.la ../lib/stubs/libStubs.la DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(mount_vmhgfs_SOURCES) DIST_SOURCES = $(mount_vmhgfs_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ mount_vmhgfs_LDADD = ../lib/string/libString.la \ ../lib/panicDefault/libPanicDefault.la \ ../lib/panic/libPanic.la ../lib/lock/libLock.la \ ../lib/misc/libMisc.la ../lib/stubs/libStubs.la mount_vmhgfs_SOURCES = hgfsmounter.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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 hgfsmounter/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu hgfsmounter/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 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 mount.vmhgfs$(EXEEXT): $(mount_vmhgfs_OBJECTS) $(mount_vmhgfs_DEPENDENCIES) @rm -f mount.vmhgfs$(EXEEXT) $(LINK) $(mount_vmhgfs_OBJECTS) $(mount_vmhgfs_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsmounter.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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: 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 clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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-sbinPROGRAMS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: CTAGS GTAGS all all-am check check-am clean 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-dvi \ install-dvi-am install-exec install-exec-am install-exec-hook \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am 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-hook \ uninstall-sbinPROGRAMS @FREEBSD_TRUE@install-exec-hook: @FREEBSD_TRUE@ mv $(DESTDIR)$(sbindir)/mount.vmhgfs \ @FREEBSD_TRUE@ $(DESTDIR)$(sbindir)/mount_vmhgfs @FREEBSD_TRUE@ -$(MKDIR_P) $(DESTDIR)/sbin @FREEBSD_TRUE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount_vmhgfs \ @FREEBSD_TRUE@ $(DESTDIR)/sbin/mount_vmhgfs &> /dev/null @FREEBSD_TRUE@uninstall-hook: @FREEBSD_TRUE@ rm -f $(DESTDIR)$(sbindir)/mount_vmhgfs @FREEBSD_FALSE@install-exec-hook: @FREEBSD_FALSE@ -$(MKDIR_P) $(DESTDIR)/sbin @FREEBSD_FALSE@ -$(LN_S) $(DESTDIR)$(sbindir)/mount.vmhgfs \ @FREEBSD_FALSE@ $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null @FREEBSD_FALSE@uninstall-hook: @FREEBSD_FALSE@ rm -f $(DESTDIR)/sbin/mount.vmhgfs # 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: open-vm-tools-10.0.7-3227872/hgfsmounter/COPYING0000644000000000000000000006347112660700525017262 0ustar rootroot GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, 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 and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, 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 library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete 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 distribute a copy of this License along with the Library. 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 Library or any portion of it, thus forming a work based on the Library, 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) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, 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 Library, 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 Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you 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. If distribution of 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 satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be 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. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library 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. 9. 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 Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library 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 with this License. 11. 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 Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library 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 Library. 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. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library 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. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser 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 Library 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 Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, 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 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "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 LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. 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 LIBRARY 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 LIBRARY (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 LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), 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 Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. 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 library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! open-vm-tools-10.0.7-3227872/INSTALL0000644000000000000000000002231012660700525014702 0ustar rootrootInstallation Instructions ************************* Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. 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 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. Running `configure' might take a while. 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=c99 CFLAGS=-g 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 can use 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 `..'. With a non-GNU `make', it is safer 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' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', 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 pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files 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 option `--target=TYPE' 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 causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf bug. Until the bug is fixed you can use this workaround: CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash `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. open-vm-tools-10.0.7-3227872/lib/0000755000000000000000000000000012660700527014423 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/message/0000755000000000000000000000000012660700526016046 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/message/Makefile.am0000644000000000000000000000173612660700526020111 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libMessage.la libMessage_la_SOURCES = libMessage_la_SOURCES += message.c open-vm-tools-10.0.7-3227872/lib/message/Makefile.in0000644000000000000000000004027612660700526020124 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/message DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libMessage_la_LIBADD = am_libMessage_la_OBJECTS = message.lo libMessage_la_OBJECTS = $(am_libMessage_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libMessage_la_SOURCES) DIST_SOURCES = $(libMessage_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libMessage.la libMessage_la_SOURCES = message.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/message/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/message/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libMessage.la: $(libMessage_la_OBJECTS) $(libMessage_la_DEPENDENCIES) $(LINK) $(libMessage_la_OBJECTS) $(libMessage_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/message/message.c0000644000000000000000000004340012660700526017637 0ustar rootroot/********************************************************* * Copyright (C) 1999-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * message.c -- * * Second layer of the internal communication channel between guest * applications and vmware * * Build a generic messaging system between guest applications and vmware. * * The protocol is not completely symmetrical, because: * . basic requests can only be sent by guest applications (when vmware * wants to post a message to a guest application, the message will be * really fetched only when the guest application will poll for new * available messages) * . several guest applications can talk to vmware, while the contrary is * not true * * Operations that are not atomic (in terms of number of backdoor calls) * can be aborted by vmware if a checkpoint/restore occurs in the middle of * such an operation. This layer takes care of retrying those operations. */ #ifdef __cplusplus extern "C" { #endif #if defined(__KERNEL__) || defined(_KERNEL) || defined(KERNEL) # include "kernelStubs.h" #else # include # include # include "debug.h" #endif #include "backdoor_def.h" #include "guest_msg_def.h" #include "backdoor.h" #include "message.h" #if defined(MESSAGE_DEBUG) # define MESSAGE_LOG(...) Warning(__VA_ARGS__) #else # define MESSAGE_LOG(...) #endif /* *----------------------------------------------------------------------------- * * Message_OpenAllocated -- * * Open a communication channel using an allocated, but unitialized * Message_Channel structure. A receive buffer may be optionally * specified with a given size. If a message larger than this * buffer is received the communication will be aborted. If no * receiver buffer is specified, one will be dynamically allocated * to size. When finished with the channel, Message_CloseAllocated * should be called. * * Result: * TRUE on success, FALSE on failure. * * Side-effects: * See above. * *----------------------------------------------------------------------------- */ Bool Message_OpenAllocated(uint32 proto, Message_Channel *chan, char *receiveBuffer, size_t receiveBufferSize) { uint32 flags; Backdoor_proto bp; flags = GUESTMSG_FLAG_COOKIE; retry: /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_OPEN; /* IN: Magic number of the protocol and flags */ bp.in.size = proto | flags; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { if (flags) { /* Cookies not supported. Fall back to no cookie. --hpreg */ flags = 0; goto retry; } MESSAGE_LOG("Message: Unable to open a communication channel\n"); return FALSE; } /* OUT: Id and cookie */ chan->id = bp.in.dx.halfs.high; chan->cookieHigh = bp.out.si.word; chan->cookieLow = bp.out.di.word; /* Initialize the channel */ chan->in = (unsigned char *)receiveBuffer; chan->inAlloc = receiveBufferSize; ASSERT((receiveBuffer == NULL) == (receiveBufferSize == 0)); chan->inPreallocated = receiveBuffer != NULL; return TRUE; } /* *----------------------------------------------------------------------------- * * Message_Open -- * * Open a communication channel * * Result: * An allocated Message_Channel on success * NULL on failure * * Side-effects: * None * *----------------------------------------------------------------------------- */ Message_Channel * Message_Open(uint32 proto) // IN { Message_Channel *chan = malloc(sizeof *chan); if (chan != NULL && !Message_OpenAllocated(proto, chan, NULL, 0)) { free(chan); chan = NULL; } return chan; } /* *----------------------------------------------------------------------------- * * Message_Send -- * * Send a message over a communication channel * * Result: * TRUE on success * FALSE on failure (the message is discarded by vmware) * * Side-effects: * None * *----------------------------------------------------------------------------- */ Bool Message_Send(Message_Channel *chan, // IN/OUT const unsigned char *buf, // IN size_t bufSize) // IN { const unsigned char *myBuf; size_t myBufSize; Backdoor_proto bp; retry: myBuf = buf; myBufSize = bufSize; /* * Send the size. */ /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_SENDSIZE; /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; /* IN: Size */ bp.in.size = myBufSize; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { MESSAGE_LOG("Message: Unable to send a message over the communication " "channel %u\n", chan->id); return FALSE; } if (bp.in.cx.halfs.high & MESSAGE_STATUS_HB) { /* * High-bandwidth backdoor port supported. Send the message in one * backdoor operation. --hpreg */ if (myBufSize) { Backdoor_proto_hb bphb; bphb.in.bx.halfs.low = BDOORHB_CMD_MESSAGE; bphb.in.bx.halfs.high = MESSAGE_STATUS_SUCCESS; bphb.in.dx.halfs.high = chan->id; bphb.in.bp.word = chan->cookieHigh; bphb.in.dstAddr = chan->cookieLow; bphb.in.size = myBufSize; bphb.in.srcAddr = (uintptr_t) myBuf; Backdoor_HbOut(&bphb); if ((bphb.in.bx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { if ((bphb.in.bx.halfs.high & MESSAGE_STATUS_CPT) != 0) { /* A checkpoint occurred. Retry the operation. --hpreg */ goto retry; } MESSAGE_LOG("Message: Unable to send a message over the " "communication channel %u\n", chan->id); return FALSE; } } } else { /* * High-bandwidth backdoor port not supported. Send the message, 4 bytes * at a time. --hpreg */ for (;;) { if (myBufSize == 0) { /* We are done */ break; } /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_SENDPAYLOAD; /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; /* IN: Piece of message */ /* * Beware in case we are not allowed to read extra bytes beyond the * end of the buffer. */ switch (myBufSize) { case 1: bp.in.size = myBuf[0]; myBufSize -= 1; break; case 2: bp.in.size = myBuf[0] | myBuf[1] << 8; myBufSize -= 2; break; case 3: bp.in.size = myBuf[0] | myBuf[1] << 8 | myBuf[2] << 16; myBufSize -= 3; break; default: bp.in.size = *(const uint32 *)myBuf; myBufSize -= 4; break; } bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { if ((bp.in.cx.halfs.high & MESSAGE_STATUS_CPT) != 0) { /* A checkpoint occurred. Retry the operation. --hpreg */ goto retry; } MESSAGE_LOG("Message: Unable to send a message over the " "communication channel %u\n", chan->id); return FALSE; } myBuf += 4; } } return TRUE; } /* *----------------------------------------------------------------------------- * * Message_Receive -- * * If vmware has posted a message for this channel, retrieve it * * Result: * TRUE on success (bufSize is 0 if there is no message) * FALSE on failure * * Side-effects: * None * *----------------------------------------------------------------------------- */ Bool Message_Receive(Message_Channel *chan, // IN/OUT unsigned char **buf, // OUT size_t *bufSize) // OUT { Backdoor_proto bp; size_t myBufSize; unsigned char *myBuf; retry: /* * Is there a message waiting for our retrieval? */ /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_RECVSIZE; /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { MESSAGE_LOG("Message: Unable to poll for messages over the " "communication channel %u\n", chan->id); return FALSE; } if ((bp.in.cx.halfs.high & MESSAGE_STATUS_DORECV) == 0) { /* No message to retrieve */ *bufSize = 0; return TRUE; } /* * Receive the size. */ /* OUT: Type */ if (bp.in.dx.halfs.high != MESSAGE_TYPE_SENDSIZE) { MESSAGE_LOG("Message: Protocol error. Expected a " "MESSAGE_TYPE_SENDSIZE request from vmware\n"); return FALSE; } /* OUT: Size */ myBufSize = bp.out.bx.word; /* * Allocate an extra byte for a trailing NUL character. The code that will * deal with this message may not know about binary strings, and may expect * a C string instead. --hpreg */ if (myBufSize + 1 > chan->inAlloc) { if (chan->inPreallocated) { MESSAGE_LOG("Message: Buffer too small to receive a message over " "the communication channel %u\n", chan->id); goto error_quit; } else { myBuf = (unsigned char *)realloc(chan->in, myBufSize + 1); if (myBuf == NULL) { MESSAGE_LOG("Message: Not enough memory to receive a message over " "the communication channel %u\n", chan->id); goto error_quit; } chan->in = myBuf; chan->inAlloc = myBufSize + 1; } } *bufSize = myBufSize; myBuf = *buf = chan->in; if (bp.in.cx.halfs.high & MESSAGE_STATUS_HB) { /* * High-bandwidth backdoor port supported. Receive the message in one * backdoor operation. --hpreg */ if (myBufSize) { Backdoor_proto_hb bphb; bphb.in.bx.halfs.low = BDOORHB_CMD_MESSAGE; bphb.in.bx.halfs.high = MESSAGE_STATUS_SUCCESS; bphb.in.dx.halfs.high = chan->id; bphb.in.srcAddr = chan->cookieHigh; bphb.in.bp.word = chan->cookieLow; bphb.in.size = myBufSize; bphb.in.dstAddr = (uintptr_t) myBuf; Backdoor_HbIn(&bphb); if ((bphb.in.bx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { if ((bphb.in.bx.halfs.high & MESSAGE_STATUS_CPT) != 0) { /* A checkpoint occurred. Retry the operation. --hpreg */ goto retry; } MESSAGE_LOG("Message: Unable to receive a message over the " "communication channel %u\n", chan->id); goto error_quit; } } } else { /* * High-bandwidth backdoor port not supported. Receive the message, 4 * bytes at a time. --hpreg */ for (;;) { if (myBufSize == 0) { /* We are done */ break; } /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_RECVPAYLOAD; /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; /* IN: Status for the previous request (that succeeded) */ bp.in.size = MESSAGE_STATUS_SUCCESS; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { if ((bp.in.cx.halfs.high & MESSAGE_STATUS_CPT) != 0) { /* A checkpoint occurred. Retry the operation. --hpreg */ goto retry; } MESSAGE_LOG("Message: Unable to receive a message over the " "communication channel %u\n", chan->id); goto error_quit; } /* OUT: Type */ if (bp.in.dx.halfs.high != MESSAGE_TYPE_SENDPAYLOAD) { MESSAGE_LOG("Message: Protocol error. Expected a " "MESSAGE_TYPE_SENDPAYLOAD from vmware\n"); goto error_quit; } /* OUT: Piece of message */ /* * Beware in case we are not allowed to write extra bytes beyond the * end of the buffer. --hpreg */ switch (myBufSize) { case 1: myBuf[0] = bp.out.bx.word & 0xff; myBufSize -= 1; break; case 2: myBuf[0] = bp.out.bx.word & 0xff; myBuf[1] = (bp.out.bx.word >> 8) & 0xff; myBufSize -= 2; break; case 3: myBuf[0] = bp.out.bx.word & 0xff; myBuf[1] = (bp.out.bx.word >> 8) & 0xff; myBuf[2] = (bp.out.bx.word >> 16) & 0xff; myBufSize -= 3; break; default: *(uint32 *)myBuf = bp.out.bx.word; myBufSize -= 4; break; } myBuf += 4; } } /* Write a trailing NUL just after the message. --hpreg */ chan->in[*bufSize] = '\0'; /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_RECVSTATUS; /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; /* IN: Status for the previous request (that succeeded) */ bp.in.size = MESSAGE_STATUS_SUCCESS; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { if ((bp.in.cx.halfs.high & MESSAGE_STATUS_CPT) != 0) { /* A checkpoint occurred. Retry the operation. --hpreg */ goto retry; } MESSAGE_LOG("Message: Unable to receive a message over the " "communication channel %u\n", chan->id); goto error_quit; } return TRUE; error_quit: /* IN: Type */ if (myBufSize == 0) { bp.in.cx.halfs.high = MESSAGE_TYPE_RECVSTATUS; } else { bp.in.cx.halfs.high = MESSAGE_TYPE_RECVPAYLOAD; } /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; /* IN: Status for the previous request (that failed) */ bp.in.size = 0; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { MESSAGE_LOG("Message: Unable to signal an error of reception over the " "communication channel %u\n", chan->id); return FALSE; } return FALSE; } /* *----------------------------------------------------------------------------- * * Message_CloseAllocated -- * * Close a communication channel that had been allocated by the * caller. (For use with Message_OpenAllocated.) * * Result: * TRUE on success, the channel is destroyed * FALSE on failure * * Side-effects: * None * *----------------------------------------------------------------------------- */ Bool Message_CloseAllocated(Message_Channel *chan) // IN/OUT { Backdoor_proto bp; Bool ret = TRUE; /* IN: Type */ bp.in.cx.halfs.high = MESSAGE_TYPE_CLOSE; /* IN: Id and cookie */ bp.in.dx.halfs.high = chan->id; bp.in.si.word = chan->cookieHigh; bp.in.di.word = chan->cookieLow; bp.in.cx.halfs.low = BDOOR_CMD_MESSAGE; Backdoor(&bp); /* OUT: Status */ if ((bp.in.cx.halfs.high & MESSAGE_STATUS_SUCCESS) == 0) { MESSAGE_LOG("Message: Unable to close the communication channel %u\n", chan->id); ret = FALSE; } if (!chan->inPreallocated) { free(chan->in); } chan->in = NULL; return ret; } /* *----------------------------------------------------------------------------- * * Message_Close -- * * Close a communication channel. * * Result: * TRUE on success, the channel is destroyed * FALSE on failure * * Side-effects: * None * *----------------------------------------------------------------------------- */ Bool Message_Close(Message_Channel *chan) // IN/OUT { Bool ret = Message_CloseAllocated(chan); free(chan); return ret; } #ifdef __cplusplus } #endif open-vm-tools-10.0.7-3227872/lib/netUtil/0000755000000000000000000000000012660700526016046 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/netUtil/netUtilLinux.c0000644000000000000000000002414412660700526020663 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * netUtilLinux.c -- * * Network routines for all guest applications. * * Linux implementation * */ #ifndef VMX86_DEVEL #endif #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) # error This file should not be compiled #endif #include #include #include #include #include #include #include #include #include #ifdef sun # include #endif #include #include /* must precede for FreeBSD to compile. */ #include #include #include #include #include #include // for ARPHRD_ETHER #if defined(__FreeBSD__) || defined(__APPLE__) #include "ifaddrs.h" #endif #include "vm_assert.h" #include "netutil.h" #include "debug.h" #include "guestApp.h" #include "util.h" #include "str.h" #define MAX_IFACES 64 #define LOOPBACK "lo" // XXX: We would have a problem with something like "loa0". #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif /* *----------------------------------------------------------------------------- * * ValidateConvertAddress -- * * Helper routine validates an address as a return value for * NetUtil_GetPrimaryIP. * * Results: * Returns TRUE with sufficient result stored in outputBuffer on success. * Returns FALSE with "" stored in outputBuffer on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool ValidateConvertAddress(const char *ifaceName, // IN: interface name const struct sockaddr_in *addr, // IN: network address to // evaluate char ipstr[INET_ADDRSTRLEN]) // OUT: converted address // stored here { /* * 1. Ensure this isn't a loopback device. * 2. Ensure this is an (IPv4) internet address. */ if (ifaceName[0] == '\0' || strncmp(ifaceName, LOOPBACK, sizeof LOOPBACK - 1) == 0 || addr->sin_family != AF_INET) { goto invalid; } /* * Branches separated because it just looked really silly to lump the * initial argument checking and actual conversion logic together. */ /* * 3. Attempt network to presentation conversion. * 4. Ensure the IP isn't all zeros. */ if (inet_ntop(AF_INET, (void *)&addr->sin_addr, ipstr, INET_ADDRSTRLEN) != NULL && strcmp(ipstr, "0.0.0.0") != 0) { return TRUE; } invalid: ipstr[0] = '\0'; return FALSE; } /* *---------------------------------------------------------------------- * * NetUtil_GetPrimaryIP -- * * Get the primary IP for this machine. * * Results: * If applicable address found, returns string of said IP address. * If applicable address not found, returns an empty string. * If an error occurred, returns NULL. * * Side effects: * Caller is responsible for free()ing returned string. * *---------------------------------------------------------------------- */ #if !defined(__FreeBSD__) && !defined(__APPLE__) /* { */ char * NetUtil_GetPrimaryIP(void) { int sd, i; struct ifconf iflist; struct ifreq ifaces[MAX_IFACES]; char ipstr[INET_ADDRSTRLEN] = ""; /* Get a socket descriptor to give to ioctl(). */ sd = socket(PF_INET, SOCK_STREAM, 0); if (sd < 0) { return NULL; } memset(&iflist, 0, sizeof iflist); memset(ifaces, 0, sizeof ifaces); /* Tell ioctl where to write interface list to and how much room it has. */ iflist.ifc_req = ifaces; iflist.ifc_len = sizeof ifaces; if (ioctl(sd, SIOCGIFCONF, &iflist) < 0) { close(sd); return NULL; } close(sd); /* Loop through the list of interfaces provided by ioctl(). */ for (i = 0; i < (sizeof ifaces/sizeof *ifaces); i++) { if (ValidateConvertAddress(ifaces[i].ifr_name, (struct sockaddr_in *)&ifaces[i].ifr_addr, ipstr)) { break; } } /* Success. Here, caller, you can throw this away. */ return strdup(ipstr); } #else /* } FreeBSD || APPLE { */ char * NetUtil_GetPrimaryIP(void) { struct ifaddrs *ifaces; struct ifaddrs *curr; char ipstr[INET_ADDRSTRLEN] = ""; /* * getifaddrs(3) creates a NULL terminated linked list of interfaces for us * to traverse and places a pointer to it in ifaces. */ if (getifaddrs(&ifaces) < 0) { return NULL; } /* * We traverse the list until there are no more interfaces or we have found * the primary interface. This function defines the primary interface to be * the first non-loopback, internet interface in the interface list. */ for(curr = ifaces; curr != NULL; curr = curr->ifa_next) { if (ValidateConvertAddress(curr->ifa_name, (struct sockaddr_in *)curr->ifa_addr, ipstr)) { break; } } /* Tell FreeBSD to free our linked list. */ freeifaddrs(ifaces); /* Success. Here, caller, you can throw this away. */ return strdup(ipstr); } #endif /* } */ /* *---------------------------------------------------------------------- * * NetUtil_GetPrimaryNic -- * * Get the primary Nic entry for this machine. Primary Nic is the * first interface that comes up when you do a ifconfig. * * Results: * The primary NIC entry or NULL if an error occurred. In nicEntry * returned, only IP address is retuend. All other fields remain zero. * * Side effects: * Memory is allocated for the returned NicEntry. Caller is * supposed to free it after use. * *---------------------------------------------------------------------- */ GuestNic * NetUtil_GetPrimaryNic(void) { GuestNic *nicEntry = NULL; VmIpAddress *ip; char *ipstr; ipstr = NetUtil_GetPrimaryIP(); if (NULL == ipstr) { goto abort; } nicEntry = Util_SafeCalloc(1, sizeof *nicEntry); ip = Util_SafeCalloc(1, sizeof *ip); nicEntry->ips.ips_len = 1; nicEntry->ips.ips_val = ip; Str_Strcpy(ip->ipAddress, ipstr, sizeof ip->ipAddress); free(ipstr); abort: return nicEntry; } #if defined(linux) # ifdef DUMMY_NETUTIL /* *----------------------------------------------------------------------------- * * NetUtil_GetIfIndex (dummy version) -- * * Given an interface name, return its index. * * Results: * Returns a valid interface index on success or -1 on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ int NetUtil_GetIfIndex(const char *ifName) // IN: interface name { NetUtilIfTableEntry *iterator; int ifIndex = -1; ASSERT(netUtilIfTable != NULL); for (iterator = netUtilIfTable; iterator->ifName; iterator++) { if (strcmp(iterator->ifName, ifName) == 0) { ifIndex = iterator->ifIndex; break; } } return ifIndex; } /* *----------------------------------------------------------------------------- * * NetUtil_GetIfName (dummy version) -- * * Given an interface index, return its name. * * Results: * Returns a valid interface name on success, NULL on failure. * * Side effects: * Caller is responsible for freeing the returned string. * *----------------------------------------------------------------------------- */ char * NetUtil_GetIfName(int ifIndex) // IN: interface index { NetUtilIfTableEntry *iterator; char *ifName = NULL; ASSERT(netUtilIfTable != NULL); for (iterator = netUtilIfTable; iterator->ifName; iterator++) { if (iterator->ifIndex == ifIndex) { ifName = Util_SafeStrdup(iterator->ifName); break; } } return ifName; } # endif // ifdef DUMMY_NETUTIL /* *----------------------------------------------------------------------------- * * NetUtil_GetHardwareAddress -- * * Given an interface name, return its hardware/link layer address. * * Results: * Returns TRUE and populates hwAddr on success. * Returns FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ size_t NetUtil_GetHardwareAddress(int ifIndex, // IN char *hwAddr, // OUT size_t hwAddrSize, // IN IanaIfType *ifType) // OUT { struct ifreq ifreq; int fd = -1; size_t ret = 0; if (hwAddrSize < IFHWADDRLEN) { return FALSE; } ASSERT(sizeof ifreq.ifr_name >= IF_NAMESIZE); memset(&ifreq, 0, sizeof ifreq); if (if_indextoname(ifIndex, ifreq.ifr_name) == NULL) { return FALSE; } if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) == -1) { return FALSE; } if (ioctl(fd, SIOCGIFHWADDR, &ifreq) == 0 && ifreq.ifr_hwaddr.sa_family == ARPHRD_ETHER) { memcpy(hwAddr, ifreq.ifr_hwaddr.sa_data, IFHWADDRLEN); *ifType = IANA_IFTYPE_ETHERNETCSMACD; ret = IFHWADDRLEN; } close(fd); return ret; } #endif // if defined(linux) open-vm-tools-10.0.7-3227872/lib/netUtil/Makefile.am0000644000000000000000000000174312660700526020107 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libNetUtil.la libNetUtil_la_SOURCES = libNetUtil_la_SOURCES += netUtilLinux.c open-vm-tools-10.0.7-3227872/lib/netUtil/Makefile.in0000644000000000000000000004031512660700526020116 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/netUtil DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libNetUtil_la_LIBADD = am_libNetUtil_la_OBJECTS = netUtilLinux.lo libNetUtil_la_OBJECTS = $(am_libNetUtil_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libNetUtil_la_SOURCES) DIST_SOURCES = $(libNetUtil_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libNetUtil.la libNetUtil_la_SOURCES = netUtilLinux.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/netUtil/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/netUtil/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libNetUtil.la: $(libNetUtil_la_OBJECTS) $(libNetUtil_la_DEPENDENCIES) $(LINK) $(libNetUtil_la_OBJECTS) $(libNetUtil_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netUtilLinux.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/dynxdr/0000755000000000000000000000000012660700525015731 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/dynxdr/Makefile.am0000644000000000000000000000177512660700525017777 0ustar rootroot################################################################################ ### Copyright (C) 2008-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libDynxdr.la libDynxdr_la_SOURCES = libDynxdr_la_SOURCES += dynxdr.c libDynxdr_la_SOURCES += xdrutil.c open-vm-tools-10.0.7-3227872/lib/dynxdr/dynxdr.c0000644000000000000000000002655512660700525017422 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include #if defined(_WIN32) # include #else # include # include # include # include #endif #include "dynxdr.h" #include "dynbuf.h" /* * dynxdr.c -- * * Implements an XDR stream backed by a DynBuf. */ typedef struct DynXdrData { DynBuf data; Bool freeMe; } DynXdrData; /* * FreeBSD < 5.0 and Solaris do not declare some parameters as "const". */ #if defined(sun) || (defined(__FreeBSD__) && __FreeBSD_version < 500000) # define DYNXDR_CONST #else # define DYNXDR_CONST const #endif /* * Mac OS X, FreeBSD and Solaris don't take a const parameter to the * "x_getpostn" function. */ #if defined(__APPLE__) || defined(__FreeBSD__) || defined(sun) # define DYNXDR_GETPOS_CONST #else # define DYNXDR_GETPOS_CONST const #endif /* * Solaris defines the parameter to "x_putbytes" as an int. */ #if defined(sun) # define DYNXDR_SIZE_T int #else # define DYNXDR_SIZE_T u_int #endif /* * Mac OS 64-bit defines the parameter to "x_putlong" as an int. */ #if defined __APPLE__ && defined __LP64__ # define DYNXDR_LONG int #else # define DYNXDR_LONG long #endif #if defined(sun) # define DYNXDR_INLINE_T rpc_inline_t # define DYNXDR_INLINE_LEN_T int #else # define DYNXDR_INLINE_T int32_t # define DYNXDR_INLINE_LEN_T u_int #endif /* *----------------------------------------------------------------------------- * * DynXdrPutBytes -- * * Writes a byte array into the XDR stream. * * Results: * TRUE: all ok * FALSE: failed to add data do dynbuf. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static bool_t DynXdrPutBytes(XDR *xdrs, // IN/OUT DYNXDR_CONST char *data, // IN DYNXDR_SIZE_T len) // IN { DynXdrData *priv = (DynXdrData *) xdrs->x_private; return DynBuf_Append(&priv->data, data, len); } /* *----------------------------------------------------------------------------- * * DynXdrGetPos -- * * Returns the current position of the buffer, which is the same as * the current buffer size. * * XXX: The Mac OS X headers don't expect a "const" argument. * * Results: * The size of the underlying buffer. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static u_int DynXdrGetPos(DYNXDR_GETPOS_CONST XDR *xdrs) // IN { DynXdrData *priv = (DynXdrData *) xdrs->x_private; return (u_int) DynBuf_GetSize(&priv->data); } /* *----------------------------------------------------------------------------- * * DynXdrSetPos -- * * Sets the position of the XDR stream. The current data in the buffer is * not affected, just the pointer to the current position. * * Results: * TRUE if pos is within the bounds of the backing buffer. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static bool_t DynXdrSetPos(XDR *xdrs, // IN u_int pos) // IN { DynXdrData *priv = (DynXdrData *) xdrs->x_private; if (pos <= DynBuf_GetAllocatedSize(&priv->data)) { DynBuf_SetSize(&priv->data, (size_t) pos); return TRUE; } return FALSE; } #if defined(__GLIBC__) || (defined(sun) && (defined(_LP64) || defined(_KERNEL))) /* *----------------------------------------------------------------------------- * * DynXdrPutInt32 -- * * Writes a 32-bit int to the XDR stream. * * XXX: This seems to be a glibc-only extenstion. It's present since at * least glibc 2.1, according to their CVS. * * XXX: Investigate this further. This XDR operation exists in Solaris * since at least Solaris 9. * * Results: * TRUE: all ok * FALSE: failed to add data do dynbuf. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static bool_t DynXdrPutInt32(XDR *xdrs, // IN/OUT DYNXDR_CONST int32_t *ip) // IN { int32_t out = htonl(*ip); DynXdrData *priv = (DynXdrData *) xdrs->x_private; return DynBuf_Append(&priv->data, &out, sizeof out); } #endif /* *----------------------------------------------------------------------------- * * DynXdrPutLong -- * * Writes a 32-bit int to the XDR stream. * * Results: * TRUE: all ok * FALSE: failed to add data do dynbuf. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static bool_t DynXdrPutLong(XDR *xdrs, // IN/OUT DYNXDR_CONST DYNXDR_LONG *lp) // IN { int32 out; DynXdrData *priv = (DynXdrData *) xdrs->x_private; #ifdef __APPLE__ ASSERT_ON_COMPILE(sizeof *lp <= sizeof (int32)); #endif out = htonl((int32)*lp); return DynBuf_Append(&priv->data, &out, sizeof out); } /* *----------------------------------------------------------------------------- * * DynXdrInline -- * * Return a pointer to a contiguous buffer of len bytes. On XDR_ENCODE, * is used to preallocate chunks of the backing buffer such that the caller * may set bulk 4-byte members w/o reallocating each time. * * Results: * Valid pointer on success, NULL on failure. * * Side effects: * Backing DynBuf may be enlarged. * *----------------------------------------------------------------------------- */ static DYNXDR_INLINE_T * DynXdrInline(XDR *xdrs, // IN/OUT DYNXDR_INLINE_LEN_T len) // IN { DynXdrData *priv = (DynXdrData *)xdrs->x_private; DynBuf *buf = &priv->data; DYNXDR_INLINE_T *retAddr; ASSERT(len >= 0); ASSERT(xdrs->x_op == XDR_ENCODE); if (len == 0) { return (DYNXDR_INLINE_T *)&buf->data[buf->size]; } if (buf->allocated - buf->size < len) { /* DynBuf too small. Grow it. */ if (!DynBuf_Enlarge(buf, buf->size + len)) { return NULL; } } retAddr = (DYNXDR_INLINE_T *)&buf->data[buf->size]; buf->size += len; return retAddr; } /* *----------------------------------------------------------------------------- * * DynXdr_Create -- * * Creates a new XDR struct backed by a DynBuf. The XDR stream is created * in XDR_ENCODE mode. The "in" argument is optional - if NULL, a new XDR * structure will be allocated. * * Results: * The XDR struct, or NULL on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ XDR * DynXdr_Create(XDR *in) // IN { static struct xdr_ops dynXdrOps = { /* * Yes, these macros are a little redundant, but I figure it helps with * readability to group the sun/_KERNEL bits together. */ #if !defined(sun) || (defined(sun) && !defined(_KERNEL)) NULL, /* x_getlong */ DynXdrPutLong, /* x_putlong */ #endif NULL, /* x_getbytes */ DynXdrPutBytes, /* x_putbytes */ DynXdrGetPos, /* x_getpostn */ DynXdrSetPos, /* x_setpostn */ DynXdrInline, /* x_inline */ NULL, /* x_destroy */ #if defined(__GLIBC__) NULL, /* x_getint32 */ DynXdrPutInt32, /* x_putint32 */ #elif defined(__APPLE__) NULL, /* x_control */ #elif defined(sun) && (defined(_LP64) || defined(_KERNEL)) NULL, /* x_control */ NULL, /* x_getint32 */ DynXdrPutInt32, /* x_putint32 */ #endif }; XDR *ret; DynXdrData *priv; if (in == NULL) { ret = malloc(sizeof *ret); if (ret == NULL) { goto error; } } else { ret = in; } priv = malloc(sizeof *priv); if (priv == NULL) { goto error; } priv->freeMe = (in == NULL); DynBuf_Init(&priv->data); ret->x_op = XDR_ENCODE; ret->x_public = NULL; ret->x_private = (char *) priv; ret->x_base = 0; ret->x_ops = &dynXdrOps; return ret; error: if (in == NULL) { free(ret); } return NULL; } /* *----------------------------------------------------------------------------- * * DynXdr_AppendRaw -- * * Appends some raw bytes to the XDR stream's internal dynbuf. This is * useful when non-XDR data may need to be added to the buffer, avoiding * the need to create another buffer and copying the existing data. * * Results: * Whether appending the data was successful. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool DynXdr_AppendRaw(XDR *xdrs, // IN const void *buf, // IN size_t len) // IN { DynBuf *intbuf = &((DynXdrData *) xdrs->x_private)->data; return DynBuf_Append(intbuf, buf, len); } /* *----------------------------------------------------------------------------- * * DynXdr_GetData -- * * Returns a copy of the current data in the XDR buffer. Caller is * responsible for freeing the data. * * Results: * The current data in the buffer, or NULL if there's no data, or failed * to allocate data. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void * DynXdr_AllocGet(XDR *xdrs) // IN { DynBuf *buf = &((DynXdrData *) xdrs->x_private)->data; return DynBuf_AllocGet(buf); } /* *----------------------------------------------------------------------------- * * DynXdr_Get -- * * Returns the current data in the XDR buffer. * * Results: * The current data in the buffer, or NULL if there's no data. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void * DynXdr_Get(XDR *xdrs) // IN { DynBuf *buf = &((DynXdrData *) xdrs->x_private)->data; return DynBuf_Get(buf); } /* *----------------------------------------------------------------------------- * * DynXdr_Destroy -- * * Frees data in the XDR stream, optionally destroying the underlying * DynBuf (if "release" is TRUE). If the XDR stream was dynamically * allocated by DynXdr_Create(), it will be freed. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void DynXdr_Destroy(XDR *xdrs, // IN Bool release) // IN { if (xdrs) { DynXdrData *priv = (DynXdrData *) xdrs->x_private; if (release) { DynBuf_Destroy(&priv->data); } if (priv->freeMe) { free(xdrs); } free(priv); } } open-vm-tools-10.0.7-3227872/lib/dynxdr/Makefile.in0000644000000000000000000004041012660700525017775 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2008-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/dynxdr DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libDynxdr_la_LIBADD = am_libDynxdr_la_OBJECTS = dynxdr.lo xdrutil.lo libDynxdr_la_OBJECTS = $(am_libDynxdr_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libDynxdr_la_SOURCES) DIST_SOURCES = $(libDynxdr_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libDynxdr.la libDynxdr_la_SOURCES = dynxdr.c xdrutil.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/dynxdr/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/dynxdr/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libDynxdr.la: $(libDynxdr_la_OBJECTS) $(libDynxdr_la_DEPENDENCIES) $(LINK) $(libDynxdr_la_OBJECTS) $(libDynxdr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynxdr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdrutil.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/dynxdr/xdrutil.c0000644000000000000000000000574612660700525017604 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * xdrutil.c -- * * Utility functions for code that uses XDR to encode/decode data. */ #include #include #include "vm_assert.h" #include "vmxrpc.h" #include "xdrutil.h" /* *----------------------------------------------------------------------------- * * XdrUtil_ArrayAppend -- * * Appends 'cnt' new elements of size 'sz' at the end of the given array. * If successful, len will contain the count of elements in the new * array. * * The newly allocated memory is zeroed out. * * Results: * NULL on allocation failure, pointer to the first new element otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void * XdrUtil_ArrayAppend(void **array, // IN/OUT u_int *arrayLen, // IN/OUT size_t elemSz, // IN u_int elemCnt) // IN { void *ret = NULL; void *newarray; newarray = realloc(*array, (*arrayLen + elemCnt) * elemSz); if (newarray != NULL) { ret = &((char *)newarray)[*arrayLen * elemSz]; memset(ret, 0, elemSz * elemCnt); *array = newarray; *arrayLen = *arrayLen + elemCnt; } return ret; } /* *----------------------------------------------------------------------------- * * XdrUtil_Deserialize -- * * Deserializes the given data into the provided destination, using the * given XDR function. * * Results: * Whether deserialization was successful. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool XdrUtil_Deserialize(const void *data, // IN size_t dataLen, // IN void *xdrProc, // IN void *dest) // IN { Bool ret; xdrproc_t proc = xdrProc; XDR xdrs; ASSERT(data != NULL); ASSERT(xdrProc != NULL); ASSERT(dest != NULL); xdrmem_create(&xdrs, (char *) data, dataLen, XDR_DECODE); ret = (Bool) proc(&xdrs, dest, 0); xdr_destroy(&xdrs); if (!ret) { VMX_XDR_FREE(proc, dest); } return ret; } open-vm-tools-10.0.7-3227872/lib/panic/0000755000000000000000000000000012660700526015514 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/panic/Makefile.am0000644000000000000000000000172512660700526017555 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libPanic.la libPanic_la_SOURCES = libPanic_la_SOURCES += panic.c open-vm-tools-10.0.7-3227872/lib/panic/panic.c0000644000000000000000000003450412660700526016760 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * panic.c -- * * Module to encapsulate common Panic behaviors. */ #include #include #include #include #ifdef _WIN32 # include # include #else // Posix # include # include #endif // Win32 vs Posix #include "vmware.h" #include "log.h" #include "panic.h" #include "msg.h" #include "str.h" #include "config.h" #include "util.h" #include "userlock.h" #if defined(_WIN32) || !defined(VMX86_TOOLS) #include "coreDump.h" #endif #ifdef _WIN32 #include "win32u.h" #endif typedef enum { PanicBreakLevel_Never, PanicBreakLevel_IfDebuggerAttached, PanicBreakLevel_Always } PanicBreakLevel; static struct PanicState { Bool msgPostOnPanic; Bool coreDumpOnPanic; Bool loopOnPanic; int coreDumpFlags; /* Memorize for clients without init func */ PanicBreakLevel breakOnPanic; /* XXX: should this be DEVEL only? */ char *coreDumpFile; } panicState = { TRUE, TRUE }; /* defaults in lieu of Panic_Init() */ /* *----------------------------------------------------------------------------- * * Panic_Init -- * * Inits the panic module. * * Results: * void * * Side effects: * Sets panic state. * *----------------------------------------------------------------------------- */ void Panic_Init(void) { panicState.coreDumpOnPanic = Config_GetBool(TRUE, "coreDumpOnPanic"); panicState.loopOnPanic = Config_GetBool(FALSE, "panic.loopOnPanic"); panicState.breakOnPanic = Config_GetLong(PanicBreakLevel_Never, "panic.breakOnPanic"); panicState.coreDumpFlags = Config_GetLong(0, "coreDumpFlags"); } /* *---------------------------------------------------------------------- * * Panic_SetPanicMsgPost -- * * Allow the Msg_Post() on panic to be suppressed. If passed FALSE, * then any subsequent Panics will refrain from posting the "VMWARE * Panic:" message. * * Results: * void. * * Side effects: * Enables/Disables Msg_Post on Panic(). * *---------------------------------------------------------------------- */ void Panic_SetPanicMsgPost(Bool postMsg) { panicState.msgPostOnPanic = postMsg; } /* *---------------------------------------------------------------------- * * Panic_GetPanicMsgPost -- * Returns panicState.msgPostOnPanic * * Results: * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool Panic_GetPanicMsgPost(void) { return panicState.msgPostOnPanic; } /* *---------------------------------------------------------------------- * * Panic_SetCoreDumpOnPanic -- * * Allow the core dump on panic to be suppressed. If passed FALSE, * then any subsequent Panics will not attempt to dump core. * * Results: * void. * * Side effects: * Enables/Disables core dump on Panic(). * * Bugs: * This really should act like Panic_Loop and Panic_Break, and just * be Panic_CoreDumpOnPanic, and not have to export the state back * out. That requires this module being the one that knows how to * actually carry out the core dump, which seems like a good thing * anyway. (Then Panic_Panic can do it too.) * *---------------------------------------------------------------------- */ void Panic_SetCoreDumpOnPanic(Bool dumpCore) { panicState.coreDumpOnPanic = dumpCore; } /* *----------------------------------------------------------------------------- * * Panic_GetCoreDumpOnPanic -- * * Returns whether panic should attempt to dump core. * * Results: * TRUE if panics should dump core. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool Panic_GetCoreDumpOnPanic(void) { return panicState.coreDumpOnPanic; } /* *----------------------------------------------------------------------------- * * Panic_GetCoreDumpFlags -- * * Return the core dump flags. The reason this module knows about this * is because it's available to everyone who wants to know, and has an * init function which is a convenient time to read configuration info. * Putting the same functionality elsewhere is harder. * * Results: * flags if set; 0 by default. * * Side effects: * None. * *----------------------------------------------------------------------------- */ int Panic_GetCoreDumpFlags(void) { return panicState.coreDumpFlags; } /* *----------------------------------------------------------------------------- * * Panic_SetCoreDumpFlags -- * * Although the core dump flags are read at init time, we may want to * update this value later. This is especially true because the default * value is read before the VM config is established. * * Results: * None. * * Side effects: * Updates global struct panicState. * *----------------------------------------------------------------------------- */ void Panic_SetCoreDumpFlags(int flags) // IN { panicState.coreDumpFlags = flags; } /* *----------------------------------------------------------------------------- * * Panic_LoopOnPanic -- * * Loop until debugger intervention, if so configured. * * Results: * void, eventually. * * Side effects: * Stall for time. * *----------------------------------------------------------------------------- */ void Panic_LoopOnPanic(void) { if (panicState.loopOnPanic) { fprintf(stderr, "Looping pid=%d\n", (int)getpid()); while (panicState.loopOnPanic) { sleep(1); } } } /* *----------------------------------------------------------------------------- * * Panic_BreakOnPanic -- * * Attract the attention of a nearby debugger. * * Results: * void, eventually. * * Side effects: * DebugBreak. * *----------------------------------------------------------------------------- */ void Panic_BreakOnPanic(void) { #if defined(_WIN32) if (Panic_GetBreakOnPanic()) { Warning("Panic: breaking into debugger\n"); DebugBreak(); } #else // Posix switch (panicState.breakOnPanic) { case PanicBreakLevel_Never: break; case PanicBreakLevel_IfDebuggerAttached: { void (*handler)(int); handler = signal(SIGTRAP, SIG_IGN); /* * INT3 is not always ignored, so explicitely use kill() here. */ kill(getpid(), SIGTRAP); signal(SIGTRAP, handler); } break; default: case PanicBreakLevel_Always: Warning("Panic: breaking into debugger\n"); # if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__ ("int3"); # else kill(getpid(), SIGTRAP); # endif break; } #endif } /* *----------------------------------------------------------------------------- * * Panic_SetBreakOnPanic -- * * Allow the debug breakpoint on panic to be suppressed. If passed FALSE, * then any subsequent Panics will not attempt to attract a debugger. * * Results: * void. * * Side effects: * Enables/Disables break into debugger on Panic(). * *----------------------------------------------------------------------------- */ void Panic_SetBreakOnPanic(Bool breakOnPanic) { panicState.breakOnPanic = breakOnPanic ? PanicBreakLevel_Always : PanicBreakLevel_Never; } /* *----------------------------------------------------------------------------- * * Panic_GetBreakOnPanic -- * * Whether or not we should break into the debugger on the current * panic iteration. * * Results: * TRUE if a break is in order, FALSE otherwise * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool Panic_GetBreakOnPanic(void) { Bool shouldBreak = FALSE; switch (panicState.breakOnPanic) { case PanicBreakLevel_Never: break; case PanicBreakLevel_IfDebuggerAttached: #ifdef _WIN32 { typedef BOOL (*pfnIsDebuggerPresent)(void); HMODULE kernelLibrary = Win32U_LoadLibrary("kernel32.dll"); if (kernelLibrary != NULL) { pfnIsDebuggerPresent IsDebuggerPresentFn = (pfnIsDebuggerPresent) GetProcAddress(kernelLibrary, "IsDebuggerPresent"); if (IsDebuggerPresentFn != NULL) { shouldBreak = IsDebuggerPresentFn(); } FreeLibrary(kernelLibrary); } } #else /* * This case is handled by Panic_BreakOnPanic for Posix as there is no * portable way to know if we're being debugged other than actually * trapping into the debugger. */ #endif break; default: case PanicBreakLevel_Always: shouldBreak = TRUE; break; } return shouldBreak; } /* *----------------------------------------------------------------------------- * * Panic_SetCoreDumpFileName -- * * Record the filename of a core dump file so that a subsequent * Panic_PostPanicMsg can mention it by name. * * Pass NULL to say there's no core file; pass the empty string to * say there's a core file but you don't know where; pass the name * of the core file if you know it. * * Results: * void * * Side effects: * malloc; overwrites panicState.coreDumpFile * *----------------------------------------------------------------------------- */ void Panic_SetCoreDumpFileName(const char *fileName) { if (panicState.coreDumpFile) { free(panicState.coreDumpFile); } if (fileName) { panicState.coreDumpFile = strdup(fileName); } else { panicState.coreDumpFile = NULL; } } /* *----------------------------------------------------------------------------- * * Panic_GetCoreDumpFileName -- * * Returns the core dump filename if set. * * Results: * coredump filename if set, NULL otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ const char * Panic_GetCoreDumpFileName(void) { return panicState.coreDumpFile; } /* *----------------------------------------------------------------------------- * * Panic_Panic -- * * Panic, possibly core dump * * A nice default implementation that basic Panic can call if you don't * want to write your own. The VMX of course has its own. * * TODO: Figure out how to trigger the Mac OS X Crash Reporter. * * Results: * None. * * Side effects: * Death. * *----------------------------------------------------------------------------- */ void Panic_Panic(const char *format, va_list args) { char buf[1024]; static int count = 0; MXUser_SetInPanic(); Str_Vsnprintf(buf, sizeof buf, format, args); /* * Write the message to stderr first, so there's always * some sort of record. * Don't try to do anything fancy, since this is before * panic loop detection. In particular, try not to call * any of our functions (that may call Panic()). */ fputs(buf, stderr); #ifdef _WIN32 /* * This would nominally be Win32U_OutputDebugString. However, * OutputDebugString is unusual in that the W version converts * to local encoding and calls the A version. * * Since any such conversion is risky (read: can Panic) and * we haven't yet hit the loop detection, we will conservatively * dump UTF-8 via the A version. */ OutputDebugStringA(buf); #endif /* * Make sure Panic gets logged */ Log_DisableThrottling(); /* * Panic loop detection: * first time - do the whole report and shutdown sequence * second time - log and exit * beyond second time - just exit */ switch (count++) { case 0: break; case 1: Log("PANIC: %s", buf); Log("Panic loop\n"); default: fprintf(stderr, "Panic loop\n"); Util_ExitProcessAbruptly(1); NOT_REACHED(); } #ifdef _WIN32 /* * Output again, in a way that we hope localizes correctly. Since * we are converting, this can Panic, so it must run after loop * detection. */ Win32U_OutputDebugString(buf); #endif /* * Log panic information. */ Log("PANIC: %s", buf); Util_Backtrace(0); /* * Do the debugging steps early before we have a chance * to double panic. */ Panic_DumpGuiResources(); #if defined(_WIN32) || !defined(VMX86_TOOLS) if (Panic_GetCoreDumpOnPanic()) { CoreDump_CoreDump(); } #endif Panic_LoopOnPanic(); /* * Show pretty panic dialog. * This is where things can go badly wrong. */ Panic_PostPanicMsg(buf); /* * Bye */ Log("Exiting\n"); exit(-1); NOT_REACHED(); } /* *----------------------------------------------------------------------------- * * Panic_DumpGuiResources -- * * Dumps userlevel resources used by the current process. * * Results: * void * * Side effects: * Logs. * *----------------------------------------------------------------------------- */ void Panic_DumpGuiResources(void) { #ifdef _WIN32 HANDLE hUser = Win32U_GetModuleHandle("user32.dll"); if (hUser) { typedef DWORD (WINAPI *fnGetGuiResources)(HANDLE, DWORD); fnGetGuiResources pGetGuiResources = (fnGetGuiResources) GetProcAddress(hUser, "GetGuiResources"); if (pGetGuiResources) { Warning("Win32 object usage: GDI %d, USER %d\n", pGetGuiResources(GetCurrentProcess(), GR_GDIOBJECTS), pGetGuiResources(GetCurrentProcess(), GR_USEROBJECTS)); } } #endif } open-vm-tools-10.0.7-3227872/lib/panic/Makefile.in0000644000000000000000000004023012660700526017560 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/panic DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libPanic_la_LIBADD = am_libPanic_la_OBJECTS = panic.lo libPanic_la_OBJECTS = $(am_libPanic_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libPanic_la_SOURCES) DIST_SOURCES = $(libPanic_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libPanic.la libPanic_la_SOURCES = panic.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/panic/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/panic/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libPanic.la: $(libPanic_la_OBJECTS) $(libPanic_la_DEPENDENCIES) $(LINK) $(libPanic_la_OBJECTS) $(libPanic_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panic.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/procMgr/0000755000000000000000000000000012660700526016033 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/procMgr/Makefile.am0000644000000000000000000000204012660700526020063 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libProcMgr.la libProcMgr_la_SOURCES = libProcMgr_la_SOURCES += procMgrPosix.c if SOLARIS libProcMgr_la_SOURCES += procMgrSolaris.c endif open-vm-tools-10.0.7-3227872/lib/procMgr/procMgrSolaris.c0000644000000000000000000005603012660700526021151 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * procMgrSolaris.c -- * * Solaris specific implementations of the process management lib methods. * */ #include #include #include #include #if _FILE_OFFSET_BITS != 64 # error FILE_OFFSET_BITS=64 required #endif /* * Work around unnecessary blocking of FOB=64 in Sol10, fixed in Sol11 * See https://www.illumos.org/issues/2410 */ #undef _FILE_OFFSET_BITS #include #define _FILE_OFFSET_BITS 64 #include #include #include #include #include "vmware.h" #include "procMgr.h" #include "debug.h" #include "util.h" #undef offsetof #include "dynbuf.h" #include "dynarray.h" #include "su.h" #include "str.h" #include "posix.h" #include "codeset.h" #include "unicode.h" static Bool ReadArgsFromAddressSpaceFile(int asFd, psinfo_t *psInfo, DynBufArray *cmdLineArr); static Bool ReadOffsetsFromAddressSpaceFile(int asFd, psinfo_t *psInfo, uintptr_t *argOffs); static char * ExtractArgStringFromAddressSpaceFile(int asFd, uintptr_t offset); static char * ExtractCommandLineFromAddressSpaceFile(psinfo_t *procInfo, char **procCmdName); /* *---------------------------------------------------------------------------- * * ProcMgr_ListProcesses -- * * List all the processes that the calling client has privilege to * enumerate. The strings in the returned structure should be all * UTF-8 encoded, although we do not enforce it right now. * * Results: * * On success, the process list is returned and the caller is responsible * for freeing the memory used by calling ProcMgr_FreeProcList. On * failure, NULL is returned. * * Side effects: * * None * *---------------------------------------------------------------------------- */ ProcMgrProcInfoArray * ProcMgr_ListProcesses(void) { ProcMgrProcInfoArray *procList = NULL; ProcMgrProcInfo processInfo; Bool failed = TRUE; DIR *dir; struct dirent *ent; procList = Util_SafeCalloc(1, sizeof *procList); ProcMgrProcInfoArray_Init(procList, 0); processInfo.procOwner = NULL; processInfo.procCmdLine = NULL; processInfo.procCmdName = NULL; dir = opendir("/proc"); if (NULL == dir) { Warning("ProcMgr_ListProcesses unable to open /proc\n"); goto exit; } while (TRUE) { char *tmp; char *cmdNameBegin = NULL; char *cmdNameEnd = NULL; struct passwd *pwd; char tempPath[MAXPATHLEN]; psinfo_t procInfo; size_t strLen = 0; size_t numRead = 0; int psInfoFd = -1; Bool cmdNameLookup = TRUE; errno = 0; ent = readdir(dir); if (ent == NULL) { if (errno == 0) { break; } else { goto exit; } } if (Str_Snprintf(tempPath, sizeof tempPath, "/proc/%s/psinfo", ent->d_name) == -1) { Debug("Process id '%s' too large\n", ent->d_name); continue; } psInfoFd = Posix_Open(tempPath, O_RDONLY); if (psInfoFd == -1) { if (errno == ENOENT || errno == EACCES) { continue; } else { goto exit; } } numRead = read(psInfoFd, &procInfo, sizeof procInfo); close(psInfoFd); if (numRead != sizeof procInfo) { goto exit; } processInfo.procStartTime = procInfo.pr_start.tv_sec; /* * If the command name in the ps info struct is strictly less than the * maximum allowed size, then we can save it right now. Else we shall * need to try and parse it from the entire command line, to avoid * saving a truncated command name. */ if (strlen(procInfo.pr_fname) + 1 < sizeof procInfo.pr_fname) { processInfo.procCmdName = Unicode_Alloc(procInfo.pr_fname, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } /* * The logic below is this: * 1. If we are looking for the explicit command name, we need to * extract the arguments from the /proc//as file and save argv[0]. * 2. If we are not looking for the explicit command name, but the command * line in the ps info struct is not strictly less than the maximum * allowed size, we still need to extract the arguments from the * /proc//as file, to avoid saving truncated comand line. * 3. Else we can save the command line directly from the ps info struct. */ if (cmdNameLookup) { tmp = ExtractCommandLineFromAddressSpaceFile(&procInfo, &processInfo.procCmdName); } else if (strlen(procInfo.pr_psargs) + 1 >= sizeof procInfo.pr_psargs) { tmp = ExtractCommandLineFromAddressSpaceFile(&procInfo, NULL); } else { tmp = NULL; } if (tmp != NULL) { processInfo.procCmdLine = Unicode_Alloc(tmp, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } else { /* * We had some issues reading procfs, mostly due to lack of * permissions for certain system owned precesses. So let's resort to * what the procinfo structure provides as a last resort. */ processInfo.procCmdLine = Unicode_Alloc(procInfo.pr_psargs, STRING_ENCODING_DEFAULT); if (cmdNameLookup) { /* * Now let's try and get the best effort command name from the entire * command line. The method below does not take care of spaces in folder * names and executable file names. This is the best we can do at this * point, considering that spaces are not common in either file or * folder names in Solaris, specially when owned by the system. */ char *tmp2 = Unicode_Alloc(procInfo.pr_psargs, STRING_ENCODING_DEFAULT); cmdNameBegin = tmp2; /* * Assuming the command name to end at the first blank space. */ cmdNameEnd = cmdNameBegin; while ('\0' != *cmdNameEnd) { if ('/' == *cmdNameEnd) { cmdNameBegin = cmdNameEnd + 1; } if (' ' == *cmdNameEnd) { break; } cmdNameEnd++; } *cmdNameEnd = '\0'; processInfo.procCmdName = Str_SafeAsprintf(NULL, "%s", cmdNameBegin); free(tmp2); } } free(tmp); tmp = NULL; /* * Store the pid. */ processInfo.procId = procInfo.pr_pid; /* * Store the owner of the process. */ pwd = getpwuid(procInfo.pr_uid); processInfo.procOwner = (NULL == pwd) ? Str_SafeAsprintf(&strLen, "%d", (int) procInfo.pr_uid) : Unicode_Alloc(pwd->pw_name, STRING_ENCODING_DEFAULT); /* * Store the process info into a list buffer. */ if (!ProcMgrProcInfoArray_Push(procList, processInfo)) { Warning("%s: failed to expand DynArray - out of memory\n", __FUNCTION__); goto exit; } processInfo.procCmdName = NULL; processInfo.procCmdLine = NULL; processInfo.procOwner = NULL; } // while (TRUE) if (0 < ProcMgrProcInfoArray_Count(procList)) { failed = FALSE; } exit: closedir(dir); free(processInfo.procOwner); free(processInfo.procCmdLine); free(processInfo.procCmdName); if (failed) { ProcMgr_FreeProcList(procList); procList = NULL; } return procList; } /* *---------------------------------------------------------------------------- * * ExtractCommandLineFromAddressSpaceFile -- * * Read the address space file (/proc//as) for a given process and * return its command line string. * * Results: * * On success, the command line string for the process is returned and the * caller is responsible for freeing the memory used by this string. On * failure, NULL is returned. * * Side effects: * * None * *---------------------------------------------------------------------------- */ static char * ExtractCommandLineFromAddressSpaceFile(psinfo_t *procInfo, //IN: psinfo struct char **procCmdName) //OUT: command name { int argc; int i; char tempPath[MAXPATHLEN]; char *buf; int asFd = -1; DynBuf cmdLine; DynBufArray args; pid_t pid; char *cmdNameBegin; if (NULL != procCmdName) { *procCmdName = NULL; } pid = procInfo->pr_pid; if (Str_Snprintf(tempPath, sizeof tempPath, "/proc/%"FMT64"d/as", (int64_t)pid) == -1) { /* This should not happen. MAXPATHLEN should be large enough. */ ASSERT(FALSE); } asFd = Posix_Open(tempPath, O_RDONLY); if (asFd == -1) { Warning("Could not open address space file for pid %"FMT64"d, %s\n", (int64_t)pid, strerror(errno)); return NULL; } buf = NULL; if (ReadArgsFromAddressSpaceFile(asFd, procInfo, &args)) { /* Concatenate the strings in args into cmdLine. */ DynBuf_Init(&cmdLine); argc = DynBufArray_Count(&args); for (i = 0; i < argc; i++) { buf = DynBuf_Get(DynBufArray_AddressOf(&args, i)); DynBuf_Append(&cmdLine, buf, strlen(buf)); if (i + 1 < argc) { DynBuf_Append(&cmdLine, " ", 1); } if (NULL != procCmdName && 0 == i) { /* * Store the command name of the process. * Find the last path separator, to get the cmd name. * If no separator is found, then use the whole name. */ cmdNameBegin = strrchr(buf, '/'); if (NULL == cmdNameBegin) { cmdNameBegin = buf; } else { /* * Skip over the last separator. */ cmdNameBegin++; } *procCmdName = Unicode_Alloc(cmdNameBegin, STRING_ENCODING_DEFAULT); } DynBuf_Destroy(DynBufArray_AddressOf(&args, i)); } DynBuf_AppendString(&cmdLine,""); DynBufArray_Destroy(&args); DynBuf_Trim(&cmdLine); buf = DynBuf_Detach(&cmdLine); DynBuf_Destroy(&cmdLine); } close(asFd); return buf; } /* *---------------------------------------------------------------------------- * * ReadArgsFromAddressSpaceFile -- * * Read the command line arguments for a process and store them in the * cmdLineArr array. The processes' address space file must be open with * the file descriptor adFd. This function assumes that it runs in the * same locale as the process being inspected. * * Results: * * On success, TRUE is returned and the caller is responsible for * de-allocating the memory used by the DynBufArray; by calling * DynBuf_Destroy on each of its elements, and then DynBufArray_Destroy on * the array itself. FALSE is returned on failure, and no de-allocation * is needed. * * Side effects: * * The cmdLineArr array is filled with the command line strings of the * given process. *---------------------------------------------------------------------------- */ static Bool ReadArgsFromAddressSpaceFile(int asFd, //IN psinfo_t *psInfo, //IN DynBufArray *cmdLineArr) //OUT { uintptr_t *argOffs; uintptr_t argOff; uintptr_t nextArgOff; int argc; int i; char *argBuf; char *argBufPtr; DynBuf *arg; argc = psInfo->pr_argc; DynBufArray_Init(cmdLineArr, argc); for (i = 0; i < argc; i++) { DynBuf_Init(DynBufArray_AddressOf(cmdLineArr, i)); } if (argc == 0) { return TRUE; } argOffs = Util_SafeCalloc(argc, sizeof *argOffs); if (argOffs == NULL) { return FALSE; } if (!ReadOffsetsFromAddressSpaceFile(asFd, psInfo, argOffs)) { goto fail; } /* Read the command line arguments into the cmdLineArr array. */ nextArgOff = argc > 0 ? argOffs[0] : 0; i = 0; while (i < argc) { argOff = argOffs[i]; /* * The argument strings are contiguous in the address space file. So * argOff[i] + strlen(arg[i]) + 1 should be equal to argOff[i + 1]. */ if ((argOff == 0) || (argOff != nextArgOff)) { goto fail; } argBuf = ExtractArgStringFromAddressSpaceFile(asFd, argOff); if (argBuf == NULL) { goto fail; } nextArgOff = argOff + strlen(argBuf) + 1; argBufPtr = argBuf + strlen(argBuf); while ((argBufPtr > argBuf) && isspace(*(argBufPtr - 1))) { argBufPtr--; } *argBufPtr = '\0'; arg = DynBufArray_AddressOf(cmdLineArr, i); if (!DynBuf_Append(arg, argBuf, strlen(argBuf) + 1)) { free(argBuf); goto fail; } free(argBuf); i++; } return TRUE; fail: Warning("Failed to read command line arguments\n"); argc = DynBufArray_Count(cmdLineArr); for (i = 0; i < argc; i++) { arg = DynArray_AddressOf(cmdLineArr, i); DynBuf_Destroy(arg); } DynBufArray_SetCount(cmdLineArr, 0); DynBufArray_Destroy(cmdLineArr); free(argOffs); return FALSE; } /* *---------------------------------------------------------------------------- * * ReadOffsetsFromAddressSpaceFile -- * * Read the offsets for the command line arguments strings of a process * into the argOffs array. The processes' /proc//as file must be * open with the file descriptor asFd. The argOffs array must have enough * space to store all the offsets for the process. * * Results: * * TRUE on success, FALSE on error. * * Side Effects: * * The argOffs array is filled with the offsets of the command line * arguments. * *---------------------------------------------------------------------------- */ static Bool ReadOffsetsFromAddressSpaceFile(int asFd, //IN psinfo_t *psInfo, //IN uintptr_t *argOffs) //OUT { int argc; int i; uintptr_t argv; ssize_t res; argc = psInfo->pr_argc; argv = psInfo->pr_argv; /* * The offsets for the command line argument are located at an offset of * argv in the /proc//as file. If the process data model is NATIVE, * each offset is a unitptr_t; else if the data model is ILP32 or LP64, each * offset is uint32_t. */ if (psInfo->pr_dmodel == PR_MODEL_NATIVE) { /* * The offset for each arguments is sizeof uintptr_t bytes. */ res = pread(asFd, argOffs, argc * sizeof argv, argv); if (res != argc * sizeof argv) { return FALSE; } } else { /* * The offset for each arguments is sizeof uint32_t bytes. */ uint32_t *argOffs32; argOffs32 = Util_SafeCalloc(argc, sizeof *argOffs32); if (argOffs32 == NULL) { return FALSE; } res = pread(asFd, argOffs32, argc * sizeof *argOffs32, argv); if (res != argc * sizeof *argOffs32) { free (argOffs32); return FALSE; } for (i = 0; i < argc; i++) { argOffs[i] = argOffs32[i]; } free(argOffs32); } return TRUE; } /* *---------------------------------------------------------------------------- * * ExtractArgStringFromAddressSpaceFile -- * * Extract a string at a given offset in the given file. The file must be * open with file descriptor asFd. * * Results: * * On success, the NULL terminated string is returned and the * caller is responsible for freeing the memory used by this string. On * failure, NULL is returned. * * Side effects: * * None * *---------------------------------------------------------------------------- */ static char * ExtractArgStringFromAddressSpaceFile(int asFd, //IN uintptr_t offset) //IN { int readSize = 32; char *buf; ssize_t res; buf = Util_SafeMalloc(readSize * sizeof *buf); while (1) { res = pread(asFd, buf, readSize, offset); if (res != readSize) { goto fail; } if (Str_Strlen(buf, readSize) == readSize) { readSize *= 2; free(buf); if (readSize > NCARGS) { return NULL; } buf = Util_SafeMalloc(readSize * sizeof *buf); } else { break; } } return buf; fail: free(buf); return NULL; } /* *---------------------------------------------------------------------- * * ProcMgr_ImpersonateUserStart -- * * Impersonate a user. Much like bora/lib/impersonate, but * changes the real and saved uid as well, to work with syscalls * (access() and kill()) that look at real UID instead of effective. * The user name should be UTF-8 encoded, although we do not enforce * it right now. Solaris does not have setresuid/setresgid. So perform * a two step process to set the real and effective uid/gid to given * user and leave the saved uid/gid as root. * * Assumes it will be called as root. * * Results: * TRUE on success, FALSE on failure * * Side effects: * * Uid/gid set to given user, saved uid/gid left as root. * *---------------------------------------------------------------------- */ Bool ProcMgr_ImpersonateUserStart(const char *user, // IN: UTF-8 encoded user name AuthToken token) // IN { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw; gid_t root_gid; int ret; char *userLocal; ppw = &pw; if ((ppw = getpwuid_r(0, &pw, buffer, sizeof buffer)) == NULL) { return FALSE; } root_gid = ppw->pw_gid; /* convert user name to local character set */ userLocal = (char *)Unicode_GetAllocBytes(user, Unicode_GetCurrentEncoding()); if (!userLocal) { Warning("Failed to convert user name %s to local character set.\n", user); return FALSE; } ppw = getpwnam_r(userLocal, &pw, buffer, sizeof buffer); free(userLocal); if (ppw == NULL) { return FALSE; } /* first change group. */ ret = Id_SetGid(root_gid); if (ret < 0) { Warning("Failed to setregid() for root\n"); return FALSE; } /* Snippet from Solaris setregid man page -- * * A -1 argument does not change the corresponding gid. If the real user ID * is being changed, or the effective user ID is being changed to a value * not equal to the real user ID, the saved set-user ID is set equal to * the new effective user ID. */ ret = Id_SetREGid(ppw->pw_gid, -1); if (ret < 0) { Warning("Failed to setregid() for user %s\n", user); return FALSE; } ret = Id_SetREGid(-1, ppw->pw_gid); if (ret < 0) { Warning("Failed to setregid() for user %s\n", user); return FALSE; } ret = initgroups(ppw->pw_name, ppw->pw_gid); if (ret < 0) { Warning("Failed to initgroups() for user %s\n", user); goto failure; } /* now user. */ ret = Id_SetUid(0); if (ret < 0) { Warning("Failed to setregid() for root\n"); return FALSE; } /* Same as above. */ ret = Id_SetREUid(ppw->pw_uid, -1); if (ret < 0) { Warning("Failed to setreuid() for user %s\n", user); goto failure; } ret = Id_SetREUid(-1, ppw->pw_uid); if (ret < 0) { Warning("Failed to setreuid() for user %s\n", user); goto failure; } /* set env. */ setenv("USER", ppw->pw_name, 1); setenv("HOME", ppw->pw_dir, 1); setenv("SHELL", ppw->pw_shell, 1); return TRUE; failure: /* try to restore on error. */ ProcMgr_ImpersonateUserStop(); return FALSE; } /* *---------------------------------------------------------------------- * * ProcMgr_ImpersonateUserStop -- * * Stop impersonating a user and return to root. Solaris does not * have setresuid/setresgid. So perform a two step process while * restoring uids to root. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * * Uid/gid restored to root. * *---------------------------------------------------------------------- */ Bool ProcMgr_ImpersonateUserStop(void) { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw; int ret; ppw = &pw; if ((ppw = getpwuid_r(0, &pw, buffer, sizeof buffer)) == NULL) { return FALSE; } /* first change back user, Do the same two step process as above. */ ret = Id_SetREUid(-1, ppw->pw_uid); if (ret < 0) { Warning("Failed setreuid() for root\n"); return FALSE; } ret = Id_SetREUid(ppw->pw_uid, -1); if (ret < 0) { Warning("Failed to setreuid() for root\n"); return FALSE; } /* now group. */ ret = Id_SetGid(ppw->pw_gid); if (ret < 0) { Warning("Failed to setgid() for root\n"); return FALSE; } ret = initgroups(ppw->pw_name, ppw->pw_gid); if (ret < 0) { Warning("Failed to initgroups() for root\n"); return FALSE; } /* set env. */ setenv("USER", ppw->pw_name, 1); setenv("HOME", ppw->pw_dir, 1); setenv("SHELL", ppw->pw_shell, 1); return TRUE; } /* *---------------------------------------------------------------------- * * ProcMgr_GetImpersonatedUserInfo -- * * Return info about the impersonated user. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * *---------------------------------------------------------------------- */ Bool ProcMgr_GetImpersonatedUserInfo(char **userName, // OUT char **homeDir) // OUT { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw; *userName = NULL; *homeDir = NULL; ppw = &pw; if ((ppw = getpwuid_r(Id_GetEUid(), &pw, buffer, sizeof buffer)) == NULL) { return FALSE; } *userName = Unicode_Alloc(ppw->pw_name, STRING_ENCODING_DEFAULT); *homeDir = Unicode_Alloc(ppw->pw_dir, STRING_ENCODING_DEFAULT); return TRUE; } open-vm-tools-10.0.7-3227872/lib/procMgr/procMgrPosix.c0000644000000000000000000017157312660700526020651 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * procMgrPosix.c -- * * Posix implementation of the process management lib * */ // pull in setresuid()/setresgid() if possible #define _GNU_SOURCE #include #if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) #include #endif #if !defined(sun) && !defined(__APPLE__) #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #if defined(linux) || defined(__FreeBSD__) || defined(HAVE_SYS_USER_H) // sys/param.h is required on FreeBSD before sys/user.h # include // Pull in PAGE_SIZE/PAGE_SHIFT defines ahead of vm_basic_defs.h # include #endif #if defined (__FreeBSD__) #include #include #include #include #endif #if defined(__APPLE__) #include #include #include "posix.h" #endif #include "vmware.h" #include "procMgr.h" #include "vm_assert.h" #include "debug.h" #include "util.h" #include "msg.h" #include "vmsignal.h" #undef offsetof #include "file.h" #include "dynbuf.h" #include "dynarray.h" #include "su.h" #include "str.h" #include "strutil.h" #include "codeset.h" #include "unicode.h" #ifdef USERWORLD #include #include #include #endif /* * All signals that: * . Can terminate the process * . May occur even if the program has no bugs */ static int const cSignals[] = { SIGHUP, SIGINT, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2, }; /* * Keeps track of the posix async proc info. */ struct ProcMgr_AsyncProc { pid_t waiterPid; // pid of the waiter process pid_t resultPid; // pid of the process created for the client int fd; // fd to write to when the child is done Bool validExitCode; int exitCode; }; static pid_t ProcMgrStartProcess(char const *cmd, char * const *envp, char const *workingDir); static Bool ProcMgrWaitForProcCompletion(pid_t pid, Bool *validExitCode, int *exitCode); static Bool ProcMgrKill(pid_t pid, int sig, int timeout); #if defined(__APPLE__) static int ProcMgrGetCommandLineArgs(long pid, DynBuf *argsBuf, char **procCmdName); #endif #ifdef sun #define BASH_PATH "/usr/bin/bash" #else #define BASH_PATH "/bin/bash" #endif #if defined(linux) && !defined(GLIBC_VERSION_23) && !defined(__UCLIBC__) /* * Implements the system calls (they are not wrapped by glibc til 2.3.2). * * The _syscall3 macro from the Linux kernel headers is not PIC-safe. * See: http://bugzilla.kernel.org/show_bug.cgi?id=7302 * * (In fact, newer Linux kernels don't even define _syscall macros anymore.) */ static INLINE int setresuid(uid_t ruid, uid_t euid, uid_t suid) { return syscall(__NR_setresuid, ruid, euid, suid); } static INLINE int setresgid(gid_t ruid, gid_t euid, gid_t suid) { return syscall(__NR_setresgid, ruid, euid, suid); } #endif /* *---------------------------------------------------------------------- * * ProcMgr_ReadProcFile -- * * Read the contents of a file in /proc/. * * The size is essentially unbounded because of cmdline arguments. * The only way to figure out the content size is to keep reading; * stat(2) and lseek(2) lie. * * The contents are NUL terminated -- in some distros may not include * a NUL for some commands (eg. pid 1, /sbin/init) -- so add * one to be safe. * * Results: * * The length of the file. * * -1 on error. * * Side effects: * * The returned contents must be freed by caller. * *---------------------------------------------------------------------- */ #if defined(linux) int ProcMgr_ReadProcFile(int fd, // IN char **contents) // OUT { int size = 0; char tmp[512]; int numRead; *contents = NULL; numRead = read(fd, tmp, sizeof(tmp)); size = numRead; if (numRead <= 0) { goto done; } /* * handle the 99% case */ if (sizeof(tmp) > numRead) { char *result; result = malloc(numRead + 1); if (NULL == result) { size = -1; goto done; } memcpy(result, tmp, numRead); result[numRead] = '\0'; *contents = result; goto done; } else { DynBuf dbuf; DynBuf_Init(&dbuf); DynBuf_Append(&dbuf, tmp, numRead); do { numRead = read(fd, tmp, sizeof(tmp)); if (numRead > 0) { DynBuf_Append(&dbuf, tmp, numRead); } size += numRead; } while (numRead > 0); // add the NUL term DynBuf_Append(&dbuf, "", 1); DynBuf_Trim(&dbuf); *contents = DynBuf_Detach(&dbuf); DynBuf_Destroy(&dbuf); } done: return size; } /* *---------------------------------------------------------------------- * * ProcMgr_ListProcesses -- * * List all the processes that the calling client has privilege to * enumerate. The strings in the returned structure should be all * UTF-8 encoded, although we do not enforce it right now. * * Results: * * A ProcMgrProcInfoArray. * * Side effects: * *---------------------------------------------------------------------- */ ProcMgrProcInfoArray * ProcMgr_ListProcesses(void) { ProcMgrProcInfoArray *procList = NULL; ProcMgrProcInfo procInfo; Bool failed = TRUE; DIR *dir; struct dirent *ent; static time_t hostStartTime = 0; static unsigned long long hertz = 100; int numberFound; procList = Util_SafeCalloc(1, sizeof *procList); ProcMgrProcInfoArray_Init(procList, 0); procInfo.procCmdName = NULL; procInfo.procCmdLine = NULL; procInfo.procOwner = NULL; /* * Figure out when the system started. We need this number to * compute process start times, which are relative to this number. * We grab the first float in /proc/uptime, convert it to an integer, * and then subtract that from the current time. That leaves us * with the seconds since epoch that the system booted up. */ if (0 == hostStartTime) { FILE *uptimeFile = NULL; uptimeFile = fopen("/proc/uptime", "r"); if (NULL != uptimeFile) { double secondsSinceBoot; char *realLocale; /* * Set the locale such that floats are delimited with ".". */ realLocale = setlocale(LC_NUMERIC, NULL); setlocale(LC_NUMERIC, "C"); numberFound = fscanf(uptimeFile, "%lf", &secondsSinceBoot); setlocale(LC_NUMERIC, realLocale); /* * Figure out system boot time in absolute terms. */ if (numberFound) { hostStartTime = time(NULL) - (time_t) secondsSinceBoot; } fclose(uptimeFile); } /* * Figure out the "hertz" value, which may be radically * different than the actual CPU frequency of the machine. * The process start time is expressed in terms of this value, * so let's compute it now and keep it in a static variable. */ #ifdef HZ hertz = (unsigned long long) HZ; #else /* * Don't do anything. Use the default value of 100. */ #endif } // if (0 == hostStartTime) /* * Scan /proc for any directory that is all numbers. * That represents a process id. */ dir = opendir("/proc"); if (NULL == dir) { Warning("ProcMgr_ListProcesses unable to open /proc\n"); goto abort; } while ((ent = readdir(dir))) { struct stat fileStat; char cmdFilePath[1024]; int statResult; int numRead = 0; /* number of bytes that read() actually read */ int cmdFd; int replaceLoop; struct passwd *pwd; char *cmdLineTemp = NULL; char *cmdStatTemp = NULL; size_t strLen = 0; unsigned long long dummy; unsigned long long relativeStartTime; char *stringBegin; char *cmdNameBegin; Bool cmdNameLookup = TRUE; /* * We only care about dirs that look like processes. */ if (strspn(ent->d_name, "0123456789") != strlen(ent->d_name)) { continue; } if (snprintf(cmdFilePath, sizeof cmdFilePath, "/proc/%s/cmdline", ent->d_name) == -1) { Debug("Giant process id '%s'\n", ent->d_name); continue; } cmdFd = open(cmdFilePath, O_RDONLY); if (-1 == cmdFd) { /* * We may not be able to open the file due to the security reason. * In that case, just ignore and continue. */ continue; } /* * Read in the command and its arguments. Arguments are separated * by \0, which we convert to ' '. Then we add a NULL terminator * at the end. Example: "perl -cw try.pl" is read in as * "perl\0-cw\0try.pl\0", which we convert to "perl -cw try.pl\0". * It would have been nice to preserve the NUL character so it is easy * to determine what the command line arguments are without * using a quote and space parsing heuristic. But we do this * to have parity with how Windows reports the command line. * In the future, we could keep the NUL version around and pass it * back to the client for easier parsing when retrieving individual * command line parameters is needed. */ numRead = ProcMgr_ReadProcFile(cmdFd, &cmdLineTemp); close(cmdFd); if (numRead < 0) { continue; } if (numRead > 0) { /* * Stop before we hit the final '\0'; want to leave it alone. */ for (replaceLoop = 0 ; replaceLoop < (numRead - 1) ; replaceLoop++) { if ('\0' == cmdLineTemp[replaceLoop]) { if (cmdNameLookup) { /* * Store the command name. * Find the last path separator, to get the cmd name. * If no separator is found, then use the whole name. */ cmdNameBegin = strrchr(cmdLineTemp, '/'); if (NULL == cmdNameBegin) { cmdNameBegin = cmdLineTemp; } else { /* * Skip over the last separator. */ cmdNameBegin++; } procInfo.procCmdName = Unicode_Alloc(cmdNameBegin, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } cmdLineTemp[replaceLoop] = ' '; } } } else { /* * Some procs don't have a command line text, so read a name from * the 'status' file (should be the first line). If unable to get a name, * the process is still real, so it should be included in the list, just * without a name. */ cmdFd = -1; numRead = 0; if (snprintf(cmdFilePath, sizeof cmdFilePath, "/proc/%s/status", ent->d_name) != -1) { cmdFd = open(cmdFilePath, O_RDONLY); } if (cmdFd != -1) { numRead = ProcMgr_ReadProcFile(cmdFd, &cmdLineTemp); close(cmdFd); } if (numRead > 0) { /* * Extract the part with just the name, by reading until the first * space, then reading the next non-space word after that, and * ignoring everything else. The format looks like this: * "^Name:[ \t]*(.*)$" * for example: * "Name: nfsd" */ const char *nameStart; char *copyItr; /* Skip non-whitespace. */ for (nameStart = cmdLineTemp; *nameStart && *nameStart != ' ' && *nameStart != '\t' && *nameStart != '\n'; ++nameStart); /* Skip whitespace. */ for (;*nameStart && (*nameStart == ' ' || *nameStart == '\t' || *nameStart == '\n'); ++nameStart); /* Copy the name to the start of the string and null term it. */ for (copyItr = cmdLineTemp; *nameStart && *nameStart != '\n';) { *(copyItr++) = *(nameStart++); } *copyItr = '\0'; /* * Store the command name. */ procInfo.procCmdName = Unicode_Alloc(cmdLineTemp, STRING_ENCODING_DEFAULT); } } /* * Get the inode information for this process. This gives us * the process owner. */ if (snprintf(cmdFilePath, sizeof cmdFilePath, "/proc/%s", ent->d_name) == -1) { Debug("Giant process id '%s'\n", ent->d_name); goto next_entry; } /* * stat() /proc/ to get the owner. We use fileStat.st_uid * later in this code. If we can't stat(), ignore and continue. * Maybe we don't have enough permission. */ statResult = stat(cmdFilePath, &fileStat); if (0 != statResult) { goto next_entry; } /* * Figure out the process start time. Open /proc//stat * and read the start time and compute it in absolute time. */ if (snprintf(cmdFilePath, sizeof cmdFilePath, "/proc/%s/stat", ent->d_name) == -1) { Debug("Giant process id '%s'\n", ent->d_name); goto next_entry; } cmdFd = open(cmdFilePath, O_RDONLY); if (-1 == cmdFd) { goto next_entry; } numRead = ProcMgr_ReadProcFile(cmdFd, &cmdStatTemp); close(cmdFd); if (0 >= numRead) { goto next_entry; } /* * Skip over initial process id and process name. "123 (bash) [...]". */ stringBegin = strchr(cmdStatTemp, ')') + 2; numberFound = sscanf(stringBegin, "%c %d %d %d %d %d " "%lu %lu %lu %lu %lu %Lu %Lu %Lu %Lu %ld %ld " "%d %ld %Lu", (char *) &dummy, (int *) &dummy, (int *) &dummy, (int *) &dummy, (int *) &dummy, (int *) &dummy, (unsigned long *) &dummy, (unsigned long *) &dummy, (unsigned long *) &dummy, (unsigned long *) &dummy, (unsigned long *) &dummy, (unsigned long long *) &dummy, (unsigned long long *) &dummy, (unsigned long long *) &dummy, (unsigned long long *) &dummy, (long *) &dummy, (long *) &dummy, (int *) &dummy, (long *) &dummy, &relativeStartTime); if (20 != numberFound) { goto next_entry; } /* * Store the command line string pointer in dynbuf. */ if (cmdLineTemp) { procInfo.procCmdLine = Unicode_Alloc(cmdLineTemp, STRING_ENCODING_DEFAULT); } else { procInfo.procCmdLine = Unicode_Alloc("", STRING_ENCODING_UTF8); } /* * Store the pid in dynbuf. */ procInfo.procId = (pid_t) atoi(ent->d_name); /* * Store the owner of the process. */ pwd = getpwuid(fileStat.st_uid); procInfo.procOwner = (NULL == pwd) ? Str_SafeAsprintf(&strLen, "%d", (int) fileStat.st_uid) : Unicode_Alloc(pwd->pw_name, STRING_ENCODING_DEFAULT); /* * Store the time that the process started. */ procInfo.procStartTime = hostStartTime + (relativeStartTime / hertz); /* * Store the process info pointer into a list buffer. */ if (!ProcMgrProcInfoArray_Push(procList, procInfo)) { Warning("%s: failed to expand DynArray - out of memory\n", __FUNCTION__); goto abort; } procInfo.procCmdName = NULL; procInfo.procCmdLine = NULL; procInfo.procOwner = NULL; next_entry: free(cmdLineTemp); free(cmdStatTemp); } // while readdir if (0 < ProcMgrProcInfoArray_Count(procList)) { failed = FALSE; } abort: closedir(dir); free(procInfo.procCmdName); free(procInfo.procCmdLine); free(procInfo.procOwner); if (failed) { ProcMgr_FreeProcList(procList); procList = NULL; } return procList; } #endif // defined(linux) /* *---------------------------------------------------------------------- * * ProcMgr_ListProcesses -- * * List all the processes that the calling client has privilege to * enumerate. The strings in the returned structure should be all * UTF-8 encoded, although we do not enforce it right now. * * Results: * * A ProcMgrProcInfoArray. * * Side effects: * *---------------------------------------------------------------------- */ #if defined(__FreeBSD__) ProcMgrProcInfoArray * ProcMgr_ListProcesses(void) { ProcMgrProcInfoArray *procList = NULL; ProcMgrProcInfo procInfo; Bool failed = TRUE; static kvm_t *kd; struct kinfo_proc *kp; char errbuf[_POSIX2_LINE_MAX]; int i; int nentries=-1; int flag=0; procList = Util_SafeCalloc(1, sizeof *procList); procInfo.procCmdName = NULL; procInfo.procCmdLine = NULL; procInfo.procOwner = NULL; /* * Get the handle to the Kernel Virtual Memory */ kd = kvm_openfiles(NULL, _PATH_DEVNULL, NULL, O_RDONLY, errbuf); if (kd == NULL) { Warning("%s: failed to open kvm with error: %s\n", __FUNCTION__, errbuf); goto abort; } /* * Get the list of process info structs */ kp = kvm_getprocs(kd, KERN_PROC_PROC, flag, &nentries); if (kp == NULL || nentries <= 0) { Warning("%s: failed to get proc infos with error: %s\n", __FUNCTION__, kvm_geterr(kd)); goto abort; } /* * Pre-allocate the dynamic array of required size. */ if (!ProcMgrProcInfoArray_Init(procList, nentries)) { Warning("%s: failed to create DynArray - out of memory\n", __FUNCTION__); goto abort; } /* * Iterate through the list of process entries */ for (i = 0; i < nentries; ++i, ++kp) { struct passwd *pwd; char **cmdLineTemp = NULL; char *cmdNameBegin = NULL; Bool cmdNameLookup = TRUE; /* * Store the pid of the process. */ procInfo.procId = kp->ki_pid; /* * Store the owner of the process. */ pwd = getpwuid(kp->ki_uid); procInfo.procOwner = (NULL == pwd) ? Str_SafeAsprintf(NULL, "%d", (int) kp->ki_uid) : Unicode_Alloc(pwd->pw_name, STRING_ENCODING_DEFAULT); /* * If the command name in the kinfo_proc struct is strictly less than the * maximum allowed size, then we can save it right now. Else we shall * need to try and parse it from the entire command line. */ if (strlen(kp->ki_comm) + 1 < sizeof kp->ki_comm) { procInfo.procCmdName = Unicode_Alloc(kp->ki_comm, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } /* * Store the command line string of the process. */ cmdLineTemp = kvm_getargv(kd, kp, 0); if (cmdLineTemp != NULL) { /* * Flatten the argument list to get cmd & all params. */ DynBuf dbuf; DynBuf_Init(&dbuf); while (*cmdLineTemp != NULL) { if (!DynBuf_Append(&dbuf, *cmdLineTemp, strlen(*cmdLineTemp))) { Warning("%s: failed to append cmd/args in DynBuf - no memory\n", __FUNCTION__); goto abort; } if (cmdNameLookup) { /* * Store the command name of the process. * Find the last path separator, to get the cmd name. * If no separator is found, then use the whole name. */ cmdNameBegin = strrchr(*cmdLineTemp, '/'); if (NULL == cmdNameBegin) { cmdNameBegin = *cmdLineTemp; } else { /* * Skip over the last separator. */ cmdNameBegin++; } procInfo.procCmdName = Unicode_Alloc(cmdNameBegin, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } cmdLineTemp++; if (*cmdLineTemp != NULL) { /* * Add the whitespace between arguments. */ if (!DynBuf_Append(&dbuf, " ", 1)) { Warning("%s: failed to append ' ' in DynBuf - no memory\n", __FUNCTION__); goto abort; } } } /* * Add the NUL term. */ if (!DynBuf_Append(&dbuf, "", 1)) { Warning("%s: failed to append NUL in DynBuf - out of memory\n", __FUNCTION__); goto abort; } DynBuf_Trim(&dbuf); procInfo.procCmdLine = DynBuf_Detach(&dbuf); DynBuf_Destroy(&dbuf); } else { procInfo.procCmdLine = Unicode_Alloc(kp->ki_comm, STRING_ENCODING_DEFAULT); if (cmdNameLookup) { procInfo.procCmdName = Unicode_Alloc(kp->ki_comm, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } } /* * Store the start time of the process */ procInfo.procStartTime = kp->ki_start.tv_sec; /* * Store the process info pointer into a list buffer. */ *ProcMgrProcInfoArray_AddressOf(procList, i) = procInfo; procInfo.procCmdLine = NULL; procInfo.procCmdName = NULL; procInfo.procOwner = NULL; } // for nentries failed = FALSE; abort: if (kd != NULL) { kvm_close(kd); } free(procInfo.procCmdLine); free(procInfo.procCmdName); free(procInfo.procOwner); if (failed) { ProcMgr_FreeProcList(procList); procList = NULL; } return procList; } #endif // defined(__FreeBSD__) #if defined(__APPLE__) /* *---------------------------------------------------------------------- * * ProcMgrGetCommandLineArgs -- * * Fetch all the command line arguments for a given process id. * The argument names shall all be UTF-8 encoded. * * Results: * Number of arguments retrieved. * Buffer is returned with argument names, if any. * Command name is returned. * * Side effects: * *---------------------------------------------------------------------- */ static int ProcMgrGetCommandLineArgs(long pid, // IN: process id DynBuf *argsBuf, // OUT: Buffer with arguments char **procCmdName) // OUT: Command name string { int argCount = 0; int argNum; char *argUnicode = NULL; char *cmdNameBegin = NULL; char *cmdLineRaw = NULL; char *cmdLineTemp; char *cmdLineEnd; size_t maxargs = 0; size_t maxargsSize; int maxargsName[] = {CTL_KERN, KERN_ARGMAX}; int argName[] = {CTL_KERN, KERN_PROCARGS2, pid}; Bool cmdNameLookup = TRUE; Bool failed = TRUE; if (NULL != procCmdName) { *procCmdName = NULL; } /* * Get the sysctl kern argmax. */ maxargsSize = sizeof maxargs; if (sysctl(maxargsName, ARRAYSIZE(maxargsName), &maxargs, &maxargsSize, NULL, 0) < 0) { Warning("%s: failed to get the kernel max args with errno = %d\n", __FUNCTION__, errno); goto abort; } /* * Fetch the raw command line */ cmdLineRaw = Util_SafeCalloc(maxargs, sizeof *cmdLineRaw); if (sysctl(argName, ARRAYSIZE(argName), cmdLineRaw, &maxargs, NULL, 0) < 0) { Debug("%s: No command line args for pid = %ld\n", __FUNCTION__, pid); goto abort; } cmdLineEnd = &cmdLineRaw[maxargs]; /* * Format of the raw command line (without line breaks): * * * <'\0'> * <'\0'>... <'\0'> * <'\0'>... <'\0'> * where: * arg = command line args we want. * env = environment vars we ignore. */ /* * Save the number of arguments. */ memcpy(&argNum, cmdLineRaw, sizeof argNum); if (0 >= argNum) { Debug("%s: Invalid number of command line args (=%d) for pid = %ld\n", __FUNCTION__, argNum, pid); goto abort; } /* * Skip over the number of args (argc value) and * full path to command name in the command line. * (Please refer to format in comment above.) */ cmdLineTemp = cmdLineRaw + sizeof argNum; cmdLineTemp += strlen(cmdLineTemp) + 1; /* * Save the arguments one by one */ while (cmdLineTemp < cmdLineEnd && argCount < argNum) { /* * Skip over leading '\0' chars to reach new arg. */ while (cmdLineTemp < cmdLineEnd && '\0' == *cmdLineTemp) { ++cmdLineTemp; } /* * If we are pointing to a valid arg, save it. */ if (cmdLineTemp < cmdLineEnd && '\0' != *cmdLineTemp) { /* * KERN_PROCARGS2 is not guaranteed to provide argument names in UTF-8. * As long as we find UTF-8 argument names, we keep adding to our list. * As soon as we see any non UTF-8 argument, we ignore that argument * and return the list we have built so far. * NOTE: On MacOS, STRING_ENCODING_DEFAULT will default to UTF-8. */ if (Unicode_IsBufferValid(cmdLineTemp, -1, STRING_ENCODING_DEFAULT) && (argUnicode = Unicode_Alloc(cmdLineTemp, STRING_ENCODING_DEFAULT)) != NULL) { /* * Add the whitespace between arguments. */ if (0 < argCount) { if (!DynBuf_Append(argsBuf, " ", 1)) { Warning("%s: failed to append ' ' in DynBuf\ - no memory\n", __FUNCTION__); goto abort; } } /* * Add the argument. */ if (!DynBuf_Append(argsBuf, argUnicode, strlen(argUnicode))) { Warning("%s: failed to append cmd/args in DynBuf\ - no memory\n", __FUNCTION__); goto abort; } free(argUnicode); argUnicode = NULL; } else { break; } ++argCount; /* * If this is the command name, retrieve it. */ if (NULL != procCmdName && cmdNameLookup) { /* * Store the command name of the process. * Find the last path separator, to get the cmd name. * If no separator is found, then use the whole name. */ cmdNameBegin = strrchr(cmdLineTemp, '/'); if (NULL == cmdNameBegin) { cmdNameBegin = cmdLineTemp; } else { /* * Skip over the last separator. */ cmdNameBegin++; } *procCmdName = Unicode_Alloc(cmdNameBegin, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } } /* * Skip over the current arg that we just saved. */ while (cmdLineTemp < cmdLineEnd && '\0' != *cmdLineTemp) { ++cmdLineTemp; } } /* * Add the NULL term. */ if (!DynBuf_Append(argsBuf, "", 1)) { Warning("%s: failed to append NUL in DynBuf - out of memory\n", __FUNCTION__); goto abort; } DynBuf_Trim(argsBuf); failed = FALSE; abort: free(cmdLineRaw); free(argUnicode); if (failed) { if (NULL != procCmdName) { free(*procCmdName); *procCmdName = NULL; } argCount = 0; } return argCount; } /* *---------------------------------------------------------------------- * * ProcMgr_ListProcesses -- * * List all the processes that the calling client has privilege to * enumerate. The strings in the returned structure should be all * UTF-8 encoded, although we do not enforce it right now. * * Results: * A ProcMgrProcInfoArray. * * Side effects: * *---------------------------------------------------------------------- */ ProcMgrProcInfoArray * ProcMgr_ListProcesses(void) { ProcMgrProcInfoArray *procList = NULL; ProcMgrProcInfo procInfo; Bool failed = TRUE; struct kinfo_proc *kptmp; struct kinfo_proc *kp = NULL; size_t procsize; int i; int nentries; int procName[] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL}; procList = Util_SafeCalloc(1, sizeof *procList); procInfo.procCmdLine = NULL; procInfo.procCmdName = NULL; procInfo.procOwner = NULL; /* * Get the number of process info structs in the entire list. */ if (sysctl(procName, ARRAYSIZE(procName), NULL, &procsize, NULL, 0) < 0) { Warning("%s: failed to get the size of the process struct\ list with errno = %d\n", __FUNCTION__, errno); goto abort; } nentries = (int)(procsize / sizeof *kp); /* * Get the list of process info structs. */ kp = Util_SafeCalloc(nentries, sizeof *kp); if (sysctl(procName, ARRAYSIZE(procName), kp, &procsize, NULL, 0) < 0) { Warning("%s: failed to get the process struct list (errno = %d)\n", __FUNCTION__, errno); goto abort; } /* * Recalculate the number of entries as they may have changed. */ if (0 >= (nentries = (int)(procsize / sizeof *kp))) { goto abort; } /* * Pre-allocate the dynamic array of required size. */ if (!ProcMgrProcInfoArray_Init(procList, nentries)) { Warning("%s: failed to create DynArray - out of memory\n", __FUNCTION__); goto abort; } /* * Iterate through the list of process entries */ for (i = 0, kptmp = kp; i < nentries; ++i, ++kptmp) { DynBuf argsBuf; char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; int error; int argCount = 0; Bool cmdNameLookup = TRUE; /* * Store the pid of the process */ procInfo.procId = kptmp->kp_proc.p_pid; /* * Store the owner of the process. */ error = Posix_Getpwuid_r(kptmp->kp_eproc.e_pcred.p_ruid, &pw, buffer, sizeof buffer, &ppw); procInfo.procOwner = (0 != error || NULL == ppw) ? Str_SafeAsprintf(NULL, "%d", (int) kptmp->kp_eproc.e_pcred.p_ruid) : Unicode_Alloc(ppw->pw_name, STRING_ENCODING_DEFAULT); /* * If the command name in the kinfo_proc struct is strictly less than the * maximum allowed size, then we can save it right now. Else we shall * need to try and parse it from the entire command line. */ if (strlen(kptmp->kp_proc.p_comm) + 1 < sizeof kptmp->kp_proc.p_comm) { procInfo.procCmdName = Unicode_Alloc(kptmp->kp_proc.p_comm, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } /* * Store the command line arguments of the process. * If no arguments are found, use the full command name. */ DynBuf_Init(&argsBuf); if (cmdNameLookup) { argCount = ProcMgrGetCommandLineArgs(kptmp->kp_proc.p_pid, &argsBuf, &procInfo.procCmdName); } else { argCount = ProcMgrGetCommandLineArgs(kptmp->kp_proc.p_pid, &argsBuf, NULL); } if (0 < argCount) { procInfo.procCmdLine = DynBuf_Detach(&argsBuf); /* * cmdName would have been filled up by the function ProcMgrGetCommandLineArgs(). */ cmdNameLookup = FALSE; } else { procInfo.procCmdLine = Unicode_Alloc(kptmp->kp_proc.p_comm, STRING_ENCODING_DEFAULT); if (cmdNameLookup) { procInfo.procCmdName = Unicode_Alloc(kptmp->kp_proc.p_comm, STRING_ENCODING_DEFAULT); cmdNameLookup = FALSE; } } DynBuf_Destroy(&argsBuf); /* * Store the start time of the process */ procInfo.procStartTime = kptmp->kp_proc.p_starttime.tv_sec; /* * Store the process info pointer into a list buffer. */ *ProcMgrProcInfoArray_AddressOf(procList, i) = procInfo; procInfo.procCmdLine = NULL; procInfo.procCmdName = NULL; procInfo.procOwner = NULL; } // nentries failed = FALSE; abort: free(kp); free(procInfo.procCmdLine); free(procInfo.procCmdName); free(procInfo.procOwner); if (failed) { ProcMgr_FreeProcList(procList); procList = NULL; } return procList; } #endif // defined(__APPLE__) /* *---------------------------------------------------------------------- * * ProcMgr_FreeProcList -- * * Free the memory occupied by ProcMgrProcInfoArray. * * Results: * * None. * * Side effects: * *---------------------------------------------------------------------- */ void ProcMgr_FreeProcList(ProcMgrProcInfoArray *procList) { int i; size_t procCount; if (NULL == procList) { return; } procCount = ProcMgrProcInfoArray_Count(procList); for (i = 0; i < procCount; i++) { ProcMgrProcInfo *procInfo = ProcMgrProcInfoArray_AddressOf(procList, i); free(procInfo->procCmdName); free(procInfo->procCmdLine); free(procInfo->procOwner); } ProcMgrProcInfoArray_Destroy(procList); free(procList); } /* *---------------------------------------------------------------------- * * ProcMgr_ExecSync -- * * Synchronously execute a command. The command is UTF-8 encoded. * * Results: * TRUE on success (the program had an exit code of 0) * FALSE on failure or if an error occurred (detail is displayed) * * Side effects: * Lots, depending on the program. * *---------------------------------------------------------------------- */ Bool ProcMgr_ExecSync(char const *cmd, // IN: UTF-8 command line ProcMgr_ProcArgs *userArgs) // IN: optional { pid_t pid; Debug("Executing sync command: %s\n", cmd); pid = ProcMgrStartProcess(cmd, userArgs ? userArgs->envp : NULL, userArgs ? userArgs->workingDirectory : NULL); if (pid == -1) { return FALSE; } return ProcMgrWaitForProcCompletion(pid, NULL, NULL); } /* *---------------------------------------------------------------------- * * ProcMgrStartProcess -- * * Fork and execute a command using the shell. This function returns * immediately after the fork() in the parent process. * * Results: * The pid of the forked process, or -1 on an error. * * Side effects: * Lots, depending on the program * *---------------------------------------------------------------------- */ static pid_t ProcMgrStartProcess(char const *cmd, // IN: UTF-8 encoded cmd char * const *envp, // IN: UTF-8 encoded env vars char const *workingDir) // IN: UTF-8 working directory { pid_t pid; char *cmdCurrent = NULL; char **envpCurrent = NULL; char *workDir = NULL; if (cmd == NULL) { ASSERT(FALSE); return -1; } /* * Convert the strings before the call to fork(), since the conversion * routines may rely on locks that do not survive fork(). */ if (!CodeSet_Utf8ToCurrent(cmd, strlen(cmd), &cmdCurrent, NULL)) { Warning("Could not convert from UTF-8 to current\n"); return -1; } if ((NULL != workingDir) && !CodeSet_Utf8ToCurrent(workingDir, strlen(workingDir), &workDir, NULL)) { Warning("Could not convert workingDir from UTF-8 to current\n"); return -1; } if (NULL != envp) { envpCurrent = Unicode_GetAllocList(envp, -1, STRING_ENCODING_DEFAULT); } #ifdef USERWORLD do { static const char filePath[] = "/bin/sh"; char * const argv[] = { "sh", "++group=host/vim/tmp", "-c", cmdCurrent, NULL }; int initFds[] = { STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO }; int workingDirFd; VmkuserStatus_Code status; int outPid; workingDirFd = open(workingDir != NULL ? workingDir : "/tmp", O_RDONLY); status = VmkuserCompat_ForkExec(filePath, argv, envpCurrent, workingDirFd, initFds, ARRAYSIZE(initFds), geteuid(), getegid(), 0, &outPid); if (workingDirFd >= 0) { close(workingDirFd); } if (VmkuserStatus_IsOK(status)) { pid = (pid_t)outPid; } else { VmkuserStatus_CodeToErrno(status, &errno); pid = -1; } } while (FALSE); #else pid = fork(); if (pid == -1) { Warning("Unable to fork: %s.\n\n", strerror(errno)); } else if (pid == 0) { static const char bashShellPath[] = BASH_PATH; char *bashArgs[] = { "bash", "-c", cmdCurrent, NULL }; static const char bourneShellPath[] = "/bin/sh"; char *bourneArgs[] = { "sh", "-c", cmdCurrent, NULL }; const char *shellPath; char **args; /* * Check bug 772203. To start the program, we start the shell * and specify the program using the option '-c'. We should return the * PID of the app that gets started. * * When the option '-c' is specified, * - bash shell just uses exec() to replace itself. So, 'bash' returns * the PID of the new application that is started. * * - bourne shell does a fork & exec. So two processes are started. We * see the PID of the shell and not the app that it starts. When the PID * is returned to a user to watch, they'll watch the wrong process. * * In order to return the proper PID, use bash if possible. If bash * is not available, then use the bourne shell. */ if (File_Exists(bashShellPath)) { shellPath = bashShellPath; args = bashArgs; } else { shellPath = bourneShellPath; args = bourneArgs; } /* * Child */ if (NULL != workDir) { if (chdir(workDir) != 0) { Warning("%s: Could not chdir(%s) %s\n", __FUNCTION__, workDir, strerror(errno)); } } if (NULL != envpCurrent) { execve(shellPath, args, envpCurrent); } else { execv(shellPath, args); } /* Failure */ Panic("Unable to execute the \"%s\" shell command: %s.\n\n", cmd, strerror(errno)); } #endif /* * Parent */ free(cmdCurrent); free(workDir); Util_FreeStringList(envpCurrent, -1); return pid; } /* *---------------------------------------------------------------------- * * ProcMgrWaitForProcCompletion -- * * Waits until the process identified by 'pid' exits or is otherwise * terminated. * * Results: * TRUE on success (the program had an exit code of 0) * FALSE on failure or if an error occurred (detail is displayed) * * Side effects: * Prevents zombification of the process. * *---------------------------------------------------------------------- */ static Bool ProcMgrWaitForProcCompletion(pid_t pid, // IN Bool *validExitCode, // OUT: Optional int *exitCode) // OUT: Optional { Bool retVal; int childStatus; if (NULL != validExitCode) { *validExitCode = FALSE; } for (;;) { pid_t status; status = waitpid(pid, &childStatus, 0); if (status == pid) { /* Success */ break; } if ( status == (pid_t)-1 && errno == EINTR) { /* System call interrupted by a signal */ continue; } Warning("Unable to wait for the process %"FMTPID" to terminate: " "%s.\n\n", pid, strerror(errno)); return FALSE; } if ((NULL != validExitCode) && (NULL != exitCode)) { *validExitCode = WIFEXITED(childStatus); *exitCode = WEXITSTATUS(childStatus); } retVal = (WIFEXITED(childStatus) && WEXITSTATUS(childStatus) == 0); Debug("Done waiting for process: %"FMTPID" (%s)\n", pid, retVal ? "success" : "failure"); return retVal; } /* *---------------------------------------------------------------------- * * ProcMgr_ExecAsync -- * * Execute a command in the background, returning immediately. * * Results: * The async proc (must be freed) or * NULL if the cmd failed to be forked. * * Side effects: * The cmd is run. * *---------------------------------------------------------------------- */ ProcMgr_AsyncProc * ProcMgr_ExecAsync(char const *cmd, // IN: UTF-8 command line ProcMgr_ProcArgs *userArgs) // IN: optional { ProcMgr_AsyncProc *asyncProc = NULL; pid_t pid; int fds[2]; Bool validExitCode; int exitCode; pid_t resultPid; int readFd, writeFd; Debug("Executing async command: '%s' in working dir '%s'\n", cmd, (userArgs && userArgs->workingDirectory) ? userArgs->workingDirectory : ""); if (pipe(fds) == -1) { Warning("Unable to create the pipe to launch command: %s.\n", cmd); return NULL; } readFd = fds[0]; writeFd = fds[1]; pid = fork(); if (pid == -1) { Warning("Unable to fork: %s.\n\n", strerror(errno)); goto abort; } else if (pid == 0) { struct sigaction olds[ARRAYSIZE(cSignals)]; int i, maxfd; Bool status = TRUE; pid_t childPid = -1; /* * Child */ /* * shut down everything but stdio and the pipe() we just made. * leaving all the other fds behind can cause nastiness with the X * connection and I/O errors, and make wait() hang. * * should probably call Hostinfo_ResetProcessState(), but that * does some stuff with iopl() we don't need */ maxfd = sysconf(_SC_OPEN_MAX); for (i = STDERR_FILENO + 1; i < maxfd; i++) { if (i != readFd && i != writeFd) { close(i); } } if (Signal_SetGroupHandler(cSignals, olds, ARRAYSIZE(cSignals), #ifndef sun SIG_DFL #else 0 #endif ) == 0) { status = FALSE; } close(readFd); /* * Only run the program if we have not already experienced a failure. */ if (status) { childPid = ProcMgrStartProcess(cmd, userArgs ? userArgs->envp : NULL, userArgs ? userArgs->workingDirectory : NULL); status = childPid != -1; } /* * Send the child's pid back immediately, so that the caller can * report the result pid back synchronously. */ if (write(writeFd, &childPid, sizeof childPid) == -1) { Warning("Waiter unable to write back to parent.\n"); /* * This is quite bad, since the original process will block * waiting for data. Unfortunately, there isn't much to do * (other than trying some other IPC mechanism). */ exit(-1); } if (status) { /* * If everything has gone well so far, then wait until the child * finishes executing. */ ASSERT(pid != -1); status = ProcMgrWaitForProcCompletion(childPid, &validExitCode, &exitCode); } /* * We always have to send IPC back to caller, so that it does not * block waiting for data we'll never send. */ Debug("Writing the command %s a success to fd %x\n", status ? "was" : "was not", writeFd); if (write(writeFd, &status, sizeof status) == -1) { Warning("Waiter unable to write back to parent\n"); /* * This is quite bad, since the original process will block * waiting for data. Unfortunately, there isn't much to do * (other than trying some other IPC mechanism). */ exit(-1); } if (write(writeFd, &exitCode, sizeof exitCode) == -1) { Warning("Waiter unable to write back to parent\n"); /* * This is quite bad, since the original process will block * waiting for data. Unfortunately, there isn't much to do * (other than trying some other IPC mechanism). */ exit(-1); } close(writeFd); if (status && Signal_ResetGroupHandler(cSignals, olds, ARRAYSIZE(cSignals)) == 0) { /* * We are too close to give up now. */ } if (!validExitCode) { exitCode = 0; } exit(exitCode); } /* * Parent */ close(writeFd); writeFd = -1; /* * Read the pid of the child's child from the pipe. */ if (read(readFd, &resultPid, sizeof resultPid) != sizeof resultPid) { Warning("Unable to read result pid from the pipe.\n"); /* * We cannot wait on the child process here, since the error * may have just been on our end, so the child could be running * for some time and we probably cannot afford to block. * Just kill the child and move on. */ ProcMgrKill(pid, SIGKILL, -1); goto abort; } if (resultPid == -1) { Warning("The child failed to fork the target process.\n"); /* * Clean up the child process; it should exit pretty quickly. */ waitpid(pid, NULL, 0); goto abort; } asyncProc = Util_SafeMalloc(sizeof *asyncProc); asyncProc->fd = readFd; readFd = -1; asyncProc->waiterPid = pid; asyncProc->validExitCode = FALSE; asyncProc->exitCode = -1; asyncProc->resultPid = resultPid; abort: if (readFd != -1) { close(readFd); } if (writeFd != -1) { close(writeFd); } return asyncProc; } /* *---------------------------------------------------------------------- * * ProcMgr_IsProcessRunning -- * * Check to see if a pid is active * * Results: * TRUE if the process exists; FALSE otherwise * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool ProcMgr_IsProcessRunning(pid_t pid) { return ((kill(pid, 0) == 0) || (errno == EPERM)); } /* *---------------------------------------------------------------------- * * ProcMgrKill -- * * Try to kill a pid & check every so often to see if it has died. * * Results: * TRUE if the process died; FALSE otherwise * * Side effects: * Depends on the program being killed. * *---------------------------------------------------------------------- */ Bool ProcMgrKill(pid_t pid, // IN int sig, // IN int timeout) // IN: -1 will wait indefinitely { if (kill(pid, sig) == -1) { Warning("Error trying to kill process %"FMTPID" with signal %d: %s\n", pid, sig, Msg_ErrString()); } else { int i; /* Try every 100ms until we've reached the timeout */ for (i = 0; timeout == -1 || i < timeout * 10; i++) { int ret; ret = waitpid(pid, NULL, WNOHANG); if (ret == -1) { /* * if we didn't start it, we can only check if its running * by looking in the proc table */ if (ECHILD == errno) { if (ProcMgr_IsProcessRunning(pid)) { Debug("Process %"FMTPID" is not a child, still running\n", pid); usleep(100000); continue; } return TRUE; } Warning("Error trying to wait on process %"FMTPID": %s\n", pid, Msg_ErrString()); } else if (ret == 0) { usleep(100000); } else { Debug("Process %"FMTPID" died from signal %d on iteration #%d\n", pid, sig, i); return TRUE; } } } return FALSE; } /* *---------------------------------------------------------------------- * * ProcMgr_KillByPid -- * * Terminate the process of procId. * * Results: * Bool. * * Side effects: * Lots, depending on the program * *---------------------------------------------------------------------- */ Bool ProcMgr_KillByPid(ProcMgr_Pid procId) // IN { Bool success = TRUE; if (!ProcMgrKill(procId, SIGTERM, 5)) { success = ProcMgrKill(procId, SIGKILL, -1); } return success; } /* *---------------------------------------------------------------------- * * ProcMgr_Kill -- * * Kill a process synchronously by first attempty to do so * nicely & then whipping out the SIGKILL axe. * * Results: * None. * * Side effects: * Depends on the program being killed. * *---------------------------------------------------------------------- */ void ProcMgr_Kill(ProcMgr_AsyncProc *asyncProc) // IN { if ((asyncProc == NULL) || (asyncProc->waiterPid == -1)) { ASSERT(FALSE); return; } ProcMgr_KillByPid(asyncProc->waiterPid); asyncProc->waiterPid = -1; } /* *---------------------------------------------------------------------- * * ProcMgr_IsAsyncProcRunning -- * * Checks whether an async process is still running. * * Results: * TRUE iff the process is still running. * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool ProcMgr_IsAsyncProcRunning(ProcMgr_AsyncProc *asyncProc) // IN { int maxFd; fd_set readFds; struct timeval tv; int status; Selectable fd; ASSERT(asyncProc); /* * Do a select, not a read. This procedure may be called many times, * while polling another program. After it returns true, then the * watcher program will try to read the socket to get the IPC error * and the exit code. */ fd = ProcMgr_GetAsyncProcSelectable(asyncProc); FD_ZERO(&readFds); FD_SET(fd, &readFds); maxFd = fd; tv.tv_sec = 0; tv.tv_usec = 0; status = select(maxFd + 1, &readFds, NULL, NULL, &tv); if (status == -1) { return(FALSE); // Not running } else if (status > 0) { return(FALSE); // Not running } else { return(TRUE); // Still running } } /* *---------------------------------------------------------------------- * * ProcMgr_GetAsyncProcSelectable -- * * Get the selectable fd for an async proc struct. * * Results: * The fd casted to a void *. * * Side effects: * None. * *---------------------------------------------------------------------- */ Selectable ProcMgr_GetAsyncProcSelectable(ProcMgr_AsyncProc *asyncProc) { ASSERT(asyncProc); return asyncProc->fd; } /* *---------------------------------------------------------------------- * * ProcMgr_GetPid -- * * Get the pid for an async proc struct. * * Results: * * Side effects: * * None. * *---------------------------------------------------------------------- */ ProcMgr_Pid ProcMgr_GetPid(ProcMgr_AsyncProc *asyncProc) { ASSERT(asyncProc); return asyncProc->resultPid; } /* *---------------------------------------------------------------------- * * ProcMgr_GetExitCode -- * * Get the exit code status of an async process. Waits on the child * process so that its resources are cleaned up. * * Results: * 0 if successful, -1 if not. * * Side effects: * None. * *---------------------------------------------------------------------- */ int ProcMgr_GetExitCode(ProcMgr_AsyncProc *asyncProc, // IN int *exitCode) // OUT { ASSERT(asyncProc); ASSERT(exitCode); *exitCode = -1; if (asyncProc->waiterPid != -1) { Bool status; if (read(asyncProc->fd, &status, sizeof status) != sizeof status) { Warning("Error reading async process status.\n"); goto exit; } if (read(asyncProc->fd, &asyncProc->exitCode, sizeof asyncProc->exitCode) != sizeof asyncProc->exitCode) { Warning("Error reading async process status.\n"); goto exit; } asyncProc->validExitCode = TRUE; Debug("Child w/ fd %x exited with code=%d\n", asyncProc->fd, asyncProc->exitCode); } *exitCode = asyncProc->exitCode; exit: if (asyncProc->waiterPid != -1) { Debug("Waiting on pid %"FMTPID" to de-zombify it\n", asyncProc->waiterPid); waitpid(asyncProc->waiterPid, NULL, 0); asyncProc->waiterPid = -1; } return (asyncProc->exitCode == -1) ? -1 : 0; } /* *---------------------------------------------------------------------- * * ProcMgr_Free -- * * Discard the state of an async process. You must call one of * ProcMgr_Kill(), ProcMgr_GetAsyncStatus(), or ProcMgr_GetExitCode() * before calling this function to ensure that the child process * is cleaned up. * * That clean-up cannot occur here, since blocking with a waitpid() * is an excessive side effect for a Free() function. * * Results: * None * * Side effects: * None. * *---------------------------------------------------------------------- */ void ProcMgr_Free(ProcMgr_AsyncProc *asyncProc) // IN { /* * Make sure that we don't leak zombie processes. */ #ifdef VMX86_DEBUG if ((asyncProc != NULL) && (asyncProc->waiterPid != -1)) { /* * Someone did not call ProcMgr_Kill(), ProcMgr_GetAsyncStatus(), * or ProcMgr_GetExitCode(). */ Warning("Leaving process %"FMTPID" to be a zombie.\n", asyncProc->waiterPid); } #endif if (asyncProc != NULL && asyncProc->fd != -1) { close(asyncProc->fd); } free(asyncProc); } #if defined(linux) || defined(__FreeBSD__) || defined(__APPLE__) /* *---------------------------------------------------------------------- * * ProcMgr_ImpersonateUserStart -- * * Impersonate a user. Much like bora/lib/impersonate, but * changes the real and saved uid as well, to work with syscalls * (access() and kill()) that look at real UID instead of effective. * The user name should be UTF-8 encoded, although we do not enforce * it right now. * * Assumes it will be called as root. * * Results: * TRUE on success * * Side effects: * * Uid/gid set to given user, saved uid/gid left as root. * *---------------------------------------------------------------------- */ Bool ProcMgr_ImpersonateUserStart(const char *user, // IN: UTF-8 encoded user name AuthToken token) // IN { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; gid_t root_gid; int error; int ret; char *userLocal; if ((error = getpwuid_r(0, &pw, buffer, sizeof buffer, &ppw)) != 0 || !ppw) { /* * getpwuid_r() and getpwnam_r() can return a 0 (success) but not * set the return pointer (ppw) if there's no entry for the user, * according to POSIX 1003.1-2003, so patch up the errno. */ if (error == 0) { error = ENOENT; } return FALSE; } root_gid = ppw->pw_gid; /* convert user name to local character set */ userLocal = (char *)Unicode_GetAllocBytes(user, Unicode_GetCurrentEncoding()); if (!userLocal) { Warning("Failed to convert user name %s to local character set.\n", user); return FALSE; } error = getpwnam_r(userLocal, &pw, buffer, sizeof buffer, &ppw); free(userLocal); if (error != 0 || !ppw) { if (error == 0) { error = ENOENT; } return FALSE; } // first change group #if defined(USERWORLD) ret = Id_SetREGid(ppw->pw_gid, ppw->pw_gid); #elif defined(__APPLE__) ret = setregid(ppw->pw_gid, ppw->pw_gid); #else ret = setresgid(ppw->pw_gid, ppw->pw_gid, root_gid); #endif if (ret < 0) { Warning("Failed to set gid for user %s\n", user); return FALSE; } #ifndef USERWORLD ret = initgroups(ppw->pw_name, ppw->pw_gid); if (ret < 0) { Warning("Failed to initgroups() for user %s\n", user); goto failure; } #endif // now user #if defined(USERWORLD) ret = Id_SetREUid(ppw->pw_uid, ppw->pw_uid); #elif defined(__APPLE__) ret = setreuid(ppw->pw_uid, ppw->pw_uid); #else ret = setresuid(ppw->pw_uid, ppw->pw_uid, 0); #endif if (ret < 0) { Warning("Failed to set uid for user %s\n", user); goto failure; } // set env setenv("USER", ppw->pw_name, 1); setenv("HOME", ppw->pw_dir, 1); setenv("SHELL", ppw->pw_shell, 1); return TRUE; failure: // try to restore on error ProcMgr_ImpersonateUserStop(); return FALSE; } /* *---------------------------------------------------------------------- * * ProcMgr_ImpersonateUserStop -- * * Stop impersonating a user and return to root. * * Results: * TRUE on success * * Side effects: * * Uid/gid restored to root. * *---------------------------------------------------------------------- */ Bool ProcMgr_ImpersonateUserStop(void) { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; int error; int ret; if ((error = getpwuid_r(0, &pw, buffer, sizeof buffer, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } return FALSE; } // first change back user #if defined(USERWORLD) ret = Id_SetREUid(ppw->pw_uid, ppw->pw_uid); #elif defined(__APPLE__) ret = setreuid(ppw->pw_uid, ppw->pw_uid); #else ret = setresuid(ppw->pw_uid, ppw->pw_uid, 0); #endif if (ret < 0) { Warning("Failed to set uid for root\n"); return FALSE; } // now group #if defined(USERWORLD) ret = Id_SetREGid(ppw->pw_gid, ppw->pw_gid); #elif defined(__APPLE__) ret = setregid(ppw->pw_gid, ppw->pw_gid); #else ret = setresgid(ppw->pw_gid, ppw->pw_gid, ppw->pw_gid); #endif if (ret < 0) { Warning("Failed to set gid for root\n"); return FALSE; } #ifndef USERWORLD ret = initgroups(ppw->pw_name, ppw->pw_gid); if (ret < 0) { Warning("Failed to initgroups() for root\n"); return FALSE; } #endif // set env setenv("USER", ppw->pw_name, 1); setenv("HOME", ppw->pw_dir, 1); setenv("SHELL", ppw->pw_shell, 1); return TRUE; } /* *---------------------------------------------------------------------- * * ProcMgr_GetImpersonatedUserInfo -- * * Return info about the impersonated user. * * Results: * TRUE on success * * Side effects: * *---------------------------------------------------------------------- */ Bool ProcMgr_GetImpersonatedUserInfo(char **userName, // OUT char **homeDir) // OUT { uid_t uid = geteuid(); char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; int error; *userName = NULL; *homeDir = NULL; if ((error = getpwuid_r(uid, &pw, buffer, sizeof buffer, &ppw)) != 0 || !ppw) { /* * getpwuid_r() and getpwnam_r() can return a 0 (success) but not * set the return pointer (ppw) if there's no entry for the user, * according to POSIX 1003.1-2003, so patch up the errno. */ if (error == 0) { error = ENOENT; } return FALSE; } *userName = Unicode_Alloc(ppw->pw_name, STRING_ENCODING_DEFAULT); *homeDir = Unicode_Alloc(ppw->pw_dir, STRING_ENCODING_DEFAULT); return TRUE; } #endif // linux || __FreeBSD__ || __APPLE__ open-vm-tools-10.0.7-3227872/lib/procMgr/Makefile.in0000644000000000000000000004074512660700526020112 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ @SOLARIS_TRUE@am__append_1 = procMgrSolaris.c subdir = lib/procMgr DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libProcMgr_la_LIBADD = am__libProcMgr_la_SOURCES_DIST = procMgrPosix.c procMgrSolaris.c @SOLARIS_TRUE@am__objects_1 = procMgrSolaris.lo am_libProcMgr_la_OBJECTS = procMgrPosix.lo $(am__objects_1) libProcMgr_la_OBJECTS = $(am_libProcMgr_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libProcMgr_la_SOURCES) DIST_SOURCES = $(am__libProcMgr_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libProcMgr.la libProcMgr_la_SOURCES = procMgrPosix.c $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/procMgr/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/procMgr/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libProcMgr.la: $(libProcMgr_la_OBJECTS) $(libProcMgr_la_DEPENDENCIES) $(LINK) $(libProcMgr_la_OBJECTS) $(libProcMgr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procMgrPosix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/procMgrSolaris.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/Makefile.am0000644000000000000000000000360512660700525016461 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ SUBDIRS = SUBDIRS += guestRpc if HAVE_X11 SUBDIRS += appUtil endif SUBDIRS += auth SUBDIRS += backdoor if HAVE_VSOCK SUBDIRS += asyncsocket endif SUBDIRS += sslDirect SUBDIRS += pollGtk SUBDIRS += poll SUBDIRS += dataMap SUBDIRS += hashMap SUBDIRS += dict SUBDIRS += dynxdr SUBDIRS += err SUBDIRS += file SUBDIRS += foundryMsg SUBDIRS += glibUtils SUBDIRS += guestApp SUBDIRS += hgfs SUBDIRS += hgfsBd SUBDIRS += hgfsHelper SUBDIRS += hgfsServer SUBDIRS += hgfsServerManagerGuest SUBDIRS += hgfsServerPolicyGuest if HAVE_GTKMM SUBDIRS += hgfsUri endif SUBDIRS += impersonate SUBDIRS += lock SUBDIRS += message SUBDIRS += misc SUBDIRS += netUtil SUBDIRS += nicInfo SUBDIRS += panic SUBDIRS += panicDefault SUBDIRS += procMgr SUBDIRS += rpcChannel SUBDIRS += rpcIn SUBDIRS += rpcOut SUBDIRS += rpcVmx if USE_SLASH_PROC SUBDIRS += slashProc endif SUBDIRS += string SUBDIRS += stubs SUBDIRS += syncDriver SUBDIRS += system SUBDIRS += unicode SUBDIRS += user SUBDIRS += vmCheck SUBDIRS += vmSignal SUBDIRS += wiper SUBDIRS += xdg open-vm-tools-10.0.7-3227872/lib/asyncsocket/0000755000000000000000000000000012660700525016747 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/asyncsocket/Makefile.am0000644000000000000000000000203012660700525020776 0ustar rootroot################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libAsyncSocket.la libAsyncSocket_la_SOURCES = libAsyncSocket_la_SOURCES += asyncsocket.c AM_CFLAGS = AM_CFLAGS += -DUSE_SSL_DIRECT open-vm-tools-10.0.7-3227872/lib/asyncsocket/asyncsocket.c0000644000000000000000000050424712660700525021455 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * asyncsocket.c -- * * The AsyncSocket object is a fairly simple wrapper around a basic TCP * socket. It's potentially asynchronous for both read and write * operations. Reads are "requested" by registering a receive function * that is called once the requested amount of data has been read from * the socket. Similarly, writes are queued along with a send function * that is called once the data has been written. Errors are reported via * a separate callback. */ #include #include #include #include #include "str.h" #include "vmware.h" #include "asyncsocket.h" #include "asyncSocketInt.h" #include "poll.h" #include "log.h" #include "err.h" #include "hostinfo.h" #include "util.h" #include "msg.h" #include "posix.h" #include "vmci_sockets.h" #ifndef VMX86_TOOLS #include "vmdblib.h" #endif #define LOGLEVEL_MODULE asyncsocket #include "loglevel_user.h" #ifdef VMX86_SERVER #include "uwvmkAPI.h" #endif #ifdef __linux__ /* * Our toolchain does not support IPV6_V6ONLY, but the host we are running on * may support it. Since setsockopt will return a error that we treat as * non-fatal, it is fine to attempt it. See define in in6.h. */ #ifndef IPV6_V6ONLY #define IPV6_V6ONLY 26 #endif /* * Linux versions can lack support for IPV6_V6ONLY while still supporting * V4MAPPED addresses. We check for a V4MAPPED address during accept to cover * this scenario. In case IN6_IS_ADDR_V4MAPPED is also not avaiable, define it. */ #ifndef IN6_IS_ADDR_V4MAPPED #define IN6_IS_ADDR_V4MAPPED(a) \ (*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0 && \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0 && \ *(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) #endif #endif #define PORT_STRING_LEN 6 /* "12345\0" or ":12345" */ #define IN_IPOLL_RECV (1 << 0) #define IN_IPOLL_SEND (1 << 1) /* * INET6_ADDRSTRLEN allows for only 45 characters. If we somehow have a * non-recommended V4MAPPED address we can exceed 45 total characters in our * address string format. While this should not be the case it is possible. * Account for the possible: * "[XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:AAA.BBB.CCC.DDD]:12345\0" * (XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:AAA.BBB.CCC.DDD\0 + [] + :12345) */ #define ADDR_STRING_LEN (INET6_ADDRSTRLEN + 2 + PORT_STRING_LEN) /* * The slots each have a "unique" ID, which is just an incrementing integer. */ static Atomic_uint32 nextid = { 1 }; /* * Local Functions */ static Bool AsyncSocketHasDataPending(AsyncSocket *asock); static int AsyncSocketMakeNonBlocking(int fd); static void AsyncSocketAcceptCallback(void *clientData); static void AsyncSocketConnectCallback(void *clientData); static int AsyncSocketBlockingWork(AsyncSocket *asock, Bool read, void *buf, int len, int *completed, int timeoutMS, Bool partial); static VMwareStatus AsyncSocketPollAdd(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback, ...); static Bool AsyncSocketPollRemove(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback); static unsigned int AsyncSocketGetPort(struct sockaddr_storage *addr); static AsyncSocket *AsyncSocketConnect(struct sockaddr_storage *addr, socklen_t addrLen, AsyncSocketConnectFn connectFn, void *clientData, PollerFunction internalConnectFn, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *outError); static int AsyncSocketConnectInternal(AsyncSocket *s); static int AsyncSocketRecv(AsyncSocket *asock, void *buf, int len, Bool fireOnPartial, void *cb, void *cbData); static Bool AsyncSocketHasDataPendingSocket(AsyncSocket *asock); static VMwareStatus AsyncSocketIPollAdd(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback, int info); static Bool AsyncSocketIPollRemove(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback); static void AsyncSocketIPollSendCallback(void *clientData); static void AsyncSocketIPollRecvCallback(void *clientData); static Bool AsyncSocketAddListenCbSocket(AsyncSocket *asock); static const AsyncSocketVTable asyncStreamSocketVTable = { AsyncSocketDispatchConnect, AsyncSocketSendInternal, AsyncSocketSendSocket, AsyncSocketRecvSocket, AsyncSocketSendCallback, AsyncSocketRecvCallback, AsyncSocketHasDataPendingSocket, AsyncSocketCancelListenCbSocket, AsyncSocketCancelRecvCbSocket, AsyncSocketCancelCbForCloseSocket, AsyncSocketCancelCbForConnectingCloseSocket, AsyncSocketCloseSocket, NULL, }; static const AsyncSocketVTable asyncStreamSocketIPollVTable = { AsyncSocketDispatchConnect, AsyncSocketSendInternal, AsyncSocketSendSocket, AsyncSocketRecvSocket, AsyncSocketIPollSendCallback, AsyncSocketIPollRecvCallback, AsyncSocketHasDataPendingSocket, AsyncSocketCancelListenCbSocket, AsyncSocketCancelRecvCbSocket, AsyncSocketCancelCbForCloseSocket, AsyncSocketCancelCbForConnectingCloseSocket, AsyncSocketCloseSocket, NULL, }; /* *---------------------------------------------------------------------------- * * AsyncSocketLock -- * AsyncSocketUnlock -- * * Acquire/Release the lock provided by the client when creating the * AsyncSocket object. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ INLINE void AsyncSocketLock(AsyncSocket *asock) // IN: { if (asock->pollParams.lock) { MXUser_AcquireRecLock(asock->pollParams.lock); } } INLINE void AsyncSocketUnlock(AsyncSocket *asock) // IN: { if (asock->pollParams.lock) { MXUser_ReleaseRecLock(asock->pollParams.lock); } } /* *---------------------------------------------------------------------------- * * AsyncSocketIsLocked -- * * If a lock is associated with the socket, check whether the calling * thread holds the lock. * * Results: * TRUE if calling thread holds the lock, or if there is no assoicated * lock. * * Side effects: * None. * *---------------------------------------------------------------------------- */ INLINE Bool AsyncSocketIsLocked(AsyncSocket *asock) // IN: { if (asock->pollParams.lock && Poll_LockingEnabled()) { return MXUser_IsCurThreadHoldingRecLock(asock->pollParams.lock); } return TRUE; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Init -- * * Initializes the host's socket library. NOP on Posix. * On Windows, calls WSAStartup(). * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * On Windows, loads winsock library. * *---------------------------------------------------------------------------- */ int AsyncSocket_Init(void) { #ifdef _WIN32 WSADATA wsaData; WORD versionRequested = MAKEWORD(2, 0); return WSAStartup(versionRequested, &wsaData) ? ASOCKERR_GENERIC : ASOCKERR_SUCCESS; #endif return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Err2String -- * * Returns the error string associated with error code. * * Results: * Error string. * * Side effects: * None. * *---------------------------------------------------------------------------- */ const char * AsyncSocket_Err2String(int err) // IN { return Msg_StripMSGID(AsyncSocket_MsgError(err)); } /* *---------------------------------------------------------------------------- * * AsyncSocket_MsgError -- * * Returns the message associated with error code. * * Results: * Message string. * * Side effects: * None. * *---------------------------------------------------------------------------- */ const char * AsyncSocket_MsgError(int asyncSockError) // IN { const char *result = NULL; switch (asyncSockError) { case ASOCKERR_SUCCESS: result = MSGID(asyncsocket.success) "Success"; break; case ASOCKERR_GENERIC: result = MSGID(asyncsocket.generic) "Asyncsocket error"; break; case ASOCKERR_INVAL: result = MSGID(asyncsocket.invalid) "Invalid parameters"; break; case ASOCKERR_TIMEOUT: result = MSGID(asyncsocket.timeout) "Time-out error"; break; case ASOCKERR_NOTCONNECTED: result = MSGID(asyncsocket.notconnected) "Local socket not connected"; break; case ASOCKERR_REMOTE_DISCONNECT: result = MSGID(asyncsocket.remotedisconnect) "Remote connection failure"; break; case ASOCKERR_CLOSED: result = MSGID(asyncsocket.closed) "Closed socket"; break; case ASOCKERR_CONNECT: result = MSGID(asyncsocket.connect) "Connection error"; break; case ASOCKERR_POLL: result = MSGID(asyncsocket.poll) "Poll registration error"; break; case ASOCKERR_BIND: result = MSGID(asyncsocket.bind) "Socket bind error"; break; case ASOCKERR_BINDADDRINUSE: result = MSGID(asyncsocket.bindaddrinuse) "Socket bind address already in use"; break; case ASOCKERR_LISTEN: result = MSGID(asyncsocket.listen) "Socket listen error"; break; case ASOCKERR_CONNECTSSL: result = MSGID(asyncsocket.connectssl) "Connection error: could not negotiate SSL"; break; } if (!result) { Warning("%s was passed bad code %d\n", __FUNCTION__, asyncSockError); result = MSGID(asyncsocket.unknown) "Unknown error"; } return result; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetFd -- * * Returns the fd for this socket. * * Results: * File descriptor. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocket_GetFd(AsyncSocket *s) { return s->fd; } /* *---------------------------------------------------------------------------- * * AsyncSocketGetAddr -- * * Given an AsyncSocket object, return the sockaddr associated with the * requested address family's file descriptor if available. * * Passing AF_UNSPEC to socketFamily will provide you with the first * usable sockaddr found (if multiple are available), with a preference * given to IPv6. * * Results: * ASOCKERR_SUCCESS. ASOCKERR_INVAL if there is no socket associated with * address family requested. ASOCKERR_GENERIC for all other errors. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int AsyncSocketGetAddr(AsyncSocket *asock, // IN int socketFamily, // IN struct sockaddr_storage *outAddr, // OUT socklen_t *outAddrLen) // IN/OUT { AsyncSocket *tempAsock; int tempFd; struct sockaddr_storage addr; socklen_t addrLen = sizeof addr; int ret = ASOCKERR_GENERIC; if (asock->fd != -1) { tempAsock = asock; } else if ((socketFamily == AF_UNSPEC || socketFamily == AF_INET6) && asock->listenAsock6 && asock->listenAsock6->fd != -1) { tempAsock = asock->listenAsock6; } else if ((socketFamily == AF_UNSPEC || socketFamily == AF_INET) && asock->listenAsock4 && asock->listenAsock4->fd != -1) { tempAsock = asock->listenAsock4; } else { return ASOCKERR_INVAL; } AsyncSocketLock(tempAsock); tempFd = tempAsock->fd; if (getsockname(tempFd, (struct sockaddr*)&addr, &addrLen) == 0) { if (socketFamily != AF_UNSPEC && addr.ss_family != socketFamily) { ret = ASOCKERR_INVAL; goto outWithLock; } memcpy(outAddr, &addr, Min(*outAddrLen, addrLen)); *outAddrLen = addrLen; ret = ASOCKERR_SUCCESS; } else { ASOCKWARN(tempAsock, ("%s: could not locate socket.\n", __FUNCTION__)); } outWithLock: AsyncSocketUnlock(tempAsock); return ret; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetRemoteIPStr -- * * Given an AsyncSocket object, returns the remote IP address associated * with it, or an error if the request is meaningless for the underlying * connection. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * * *---------------------------------------------------------------------------- */ int AsyncSocket_GetRemoteIPStr(AsyncSocket *asock, // IN const char **ipRetStr) // OUT { int ret = ASOCKERR_SUCCESS; ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(ipRetStr != NULL); if (ipRetStr == NULL || asock == NULL || asock->state != AsyncSocketConnected || (asock->remoteAddrLen != sizeof (struct sockaddr_in) && asock->remoteAddrLen != sizeof (struct sockaddr_in6))) { ret = ASOCKERR_GENERIC; } else { char addrBuf[NI_MAXHOST]; if (Posix_GetNameInfo((struct sockaddr *)&asock->remoteAddr, asock->remoteAddrLen, addrBuf, sizeof addrBuf, NULL, 0, NI_NUMERICHOST) != 0) { ret = ASOCKERR_GENERIC; } else { *ipRetStr = Util_SafeStrdup(addrBuf); } } return ret; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetINETIPStr -- * * Given an AsyncSocket object, returns the IP addresses associated with * the requested address family's file descriptor if available. * * Passing AF_UNSPEC to socketFamily will provide you with the first * usable IP address found (if multiple are available), with a preference * given to IPv6. * * It is the caller's responsibility to free ipRetStr. * * Results: * ASOCKERR_SUCCESS. ASOCKERR_INVAL if there is no socket associated with * address family requested. ASOCKERR_GENERIC for all other errors. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocket_GetINETIPStr(AsyncSocket *asock, // IN int socketFamily, // IN char **ipRetStr) // OUT { struct sockaddr_storage addr; socklen_t addrLen = sizeof addr; int ret; AsyncSocketLock(asock); ret = AsyncSocketGetAddr(asock, socketFamily, &addr, &addrLen); if (ret == ASOCKERR_SUCCESS) { char addrBuf[NI_MAXHOST]; if (ipRetStr == NULL) { ret = ASOCKERR_INVAL; } else if (Posix_GetNameInfo((struct sockaddr *)&addr, addrLen, addrBuf, sizeof addrBuf, NULL, 0, NI_NUMERICHOST) == 0) { *ipRetStr = Util_SafeStrdup(addrBuf); } else { ASOCKWARN(asock, ("%s: could not find IP address.\n", __FUNCTION__)); ret = ASOCKERR_GENERIC; } } AsyncSocketUnlock(asock); return ret; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetLocalVMCIAddress -- * * Given an AsyncSocket object, returns the local VMCI context ID and * port number associated with it, or an error if the request is * meaningless for the underlying connection. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * * *---------------------------------------------------------------------------- */ int AsyncSocket_GetLocalVMCIAddress(AsyncSocket *asock, // IN uint32 *cid, // OUT: optional uint32 *port) // OUT: optional { ASSERT(asock); if (asock->localAddrLen != sizeof(struct sockaddr_vm)) { return ASOCKERR_GENERIC; } if (cid != NULL) { *cid = ((struct sockaddr_vm *)&asock->localAddr)->svm_cid; } if (port != NULL) { *port = ((struct sockaddr_vm *)&asock->localAddr)->svm_port; } return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetRemoteVMCIAddress -- * * Given an AsyncSocket object, returns the remote VMCI context ID and * port number associated with it, or an error if the request is * meaningless for the underlying connection. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * * *---------------------------------------------------------------------------- */ int AsyncSocket_GetRemoteVMCIAddress(AsyncSocket *asock, // IN uint32 *cid, // OUT: optional uint32 *port) // OUT: optional { ASSERT(asock); if (asock->remoteAddrLen != sizeof(struct sockaddr_vm)) { return ASOCKERR_GENERIC; } if (cid != NULL) { *cid = ((struct sockaddr_vm *)&asock->remoteAddr)->svm_cid; } if (port != NULL) { *port = ((struct sockaddr_vm *)&asock->remoteAddr)->svm_port; } return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocketListenImpl -- * * Initializes, binds, and listens on pre-populated address structure. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket, binds and listens. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocketListenImpl(struct sockaddr_storage *addr, // IN socklen_t addrLen, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN: optional Bool isWebSock, // IN Bool webSockUseSSL, // IN: const char *protocols[], // IN: optional int *outError) // OUT: optional { AsyncSocket *asock = AsyncSocketInit(addr->ss_family, pollParams, outError); if (asock != NULL) { #ifndef VMX86_TOOLS if (isWebSock) { AsyncSocketInitWebSocket(asock, clientData, webSockUseSSL, protocols); } #endif if (AsyncSocketBind(asock, addr, addrLen, outError) && AsyncSocketListen(asock, connectFn, clientData, outError)) { return asock; } } return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocketListenerCreateImpl -- * * Listens on specified address and/or port for resolved/requested socket * family and accepts new connections. Fires the connect callback with * new AsyncSocket object for each connection. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket, binds and listens. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocketListenerCreateImpl(const char *addrStr, // IN: optional unsigned int port, // IN: optional int socketFamily, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN Bool isWebSock, // IN Bool webSockUseSSL, // IN const char *protocols[], // IN: optional int *outError) // OUT: optional { AsyncSocket *asock = NULL; struct sockaddr_storage addr; socklen_t addrLen; char *ipString = NULL; int getaddrinfoError = AsyncSocketResolveAddr(addrStr, port, socketFamily, TRUE, &addr, &addrLen, &ipString); if (getaddrinfoError == 0) { asock = AsyncSocketListenImpl(&addr, addrLen, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, protocols, outError); if (asock) { ASOCKLG0(asock, ("Created new %s %s listener for (%s)\n", addr.ss_family == AF_INET ? "IPv4" : "IPv6", isWebSock ? "web socket" : "socket", ipString)); } else { Log(ASOCKPREFIX "Could not create %s listener socket, error %d: %s\n", addr.ss_family == AF_INET ? "IPv4" : "IPv6", *outError, AsyncSocket_Err2String(*outError)); } free(ipString); } else { Log(ASOCKPREFIX "Could not resolve listener socket address.\n"); if (outError) { *outError = ASOCKERR_LISTEN; } } return asock; } /* *---------------------------------------------------------------------------- * * AsyncSocketListenerCreate -- * * Listens on specified address and/or port for all resolved socket * families and accepts new connections. Fires the connect callback with * new AsyncSocket object for each connection. * * If address string is present and that string is not the "localhost" * loopback, then we will listen on resolved address only. * * If address string is NULL or is "localhost" we will listen on all * address families that will resolve on the host. * * If port requested is 0, we will let the system assign the first * available port. * * If address string is NULL and port requested is not 0, we will listen * on any address for all resolved protocols for the port requested. * * If address string is "localhost" and port is 0, we will use the first * port we are given if the host supports multiple address families. * If by chance we try to bind on a port that is available for one * protocol and not the other, we will attempt a second time with the * order of address families reversed. * * If address string is NULL, port cannot be 0. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket/s, binds and listens. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocketListenerCreate(const char *addrStr, // IN: optional unsigned int port, // IN: optional AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN Bool isWebSock, // IN Bool webSockUseSSL, // IN const char *protocols[], // IN: optional int *outError) // OUT: optional { if (addrStr != NULL && *addrStr != '\0' && Str_Strcmp(addrStr, "localhost")) { return AsyncSocketListenerCreateImpl(addrStr, port, AF_UNSPEC, connectFn, clientData, pollParams, FALSE, FALSE, protocols, outError); } else { Bool localhost = addrStr != NULL && !Str_Strcmp(addrStr, "localhost"); unsigned int tempPort = port; AsyncSocket *asock6 = NULL; AsyncSocket *asock4 = NULL; int tempError4; int tempError6; asock6 = AsyncSocketListenerCreateImpl(addrStr, port, AF_INET6, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, protocols, &tempError6); if (localhost && port == 0) { tempPort = AsyncSocket_GetPort(asock6); if (tempPort == MAX_UINT32) { Log(ASOCKPREFIX "Could not resolve IPv6 listener socket port number.\n"); tempPort = port; } } asock4 = AsyncSocketListenerCreateImpl(addrStr, tempPort, AF_INET, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, protocols, &tempError4); if (localhost && port == 0 && tempError4 == ASOCKERR_BINDADDRINUSE) { Log(ASOCKPREFIX "Failed to reuse IPv6 localhost port number for IPv4 " "listener socket.\n"); AsyncSocket_Close(asock6); tempError4 = ASOCKERR_SUCCESS; asock4 = AsyncSocketListenerCreateImpl(addrStr, port, AF_INET, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, protocols, &tempError4); tempPort = AsyncSocket_GetPort(asock4); if (tempPort == MAX_UINT32) { Log(ASOCKPREFIX "Could not resolve IPv4 listener socket port number.\n"); tempPort = port; } tempError6 = ASOCKERR_SUCCESS; asock6 = AsyncSocketListenerCreateImpl(addrStr, tempPort, AF_INET6, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, protocols, &tempError6); if (!asock6 && tempError6 == ASOCKERR_BINDADDRINUSE) { Log(ASOCKPREFIX "Failed to reuse IPv4 localhost port number for " "IPv6 listener socket.\n"); AsyncSocket_Close(asock4); } } if (asock6 && asock4) { AsyncSocket *asock; asock = AsyncSocketCreate(NULL); asock->state = AsyncSocketListening; asock->asockType = ASYNCSOCKET_TYPE_SOCKET; asock->listenAsock6 = asock6; asock->listenAsock4 = asock4; return asock; } else if (asock6) { return asock6; } else if (asock4) { return asock4; } if (outError) { /* Client only gets one error and the one for IPv6 is favored. */ if (!asock6) { *outError = tempError6; } else if (!asock4) { *outError = tempError4; } else { *outError = ASOCKERR_LISTEN; } } return NULL; } } /* *---------------------------------------------------------------------------- * * AsyncSocketListenerCreateLoopback -- * * Listens on loopback interface and port for all resolved socket * families and accepts new connections. Fires the connect callback with * new AsyncSocket object for each connection. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket/s, binds and listens. * *---------------------------------------------------------------------------- */ static AsyncSocket * AsyncSocketListenerCreateLoopback(unsigned int port, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN Bool isWebSock, // IN Bool webSockUseSSL, // IN int *outError) // OUT: optional { AsyncSocket *asock6 = NULL; AsyncSocket *asock4 = NULL; int tempError4; int tempError6; /* * "localhost6" does not work on Windows. "localhost" does * not work for IPv6 on old Linux versions like 2.6.18. So, * using IP address for both the cases to be consistent. */ asock6 = AsyncSocketListenerCreateImpl("::1", port, AF_INET6, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, NULL, &tempError6); asock4 = AsyncSocketListenerCreateImpl("127.0.0.1", port, AF_INET, connectFn, clientData, pollParams, isWebSock, webSockUseSSL, NULL, &tempError4); if (asock6 && asock4) { AsyncSocket *asock; asock = AsyncSocketCreate(NULL); asock->state = AsyncSocketListening; asock->asockType = ASYNCSOCKET_TYPE_SOCKET; asock->listenAsock6 = asock6; asock->listenAsock4 = asock4; return asock; } else if (asock6) { return asock6; } else if (asock4) { return asock4; } if (outError) { /* Client only gets one error and the one for IPv6 is favored. */ if (!asock6) { *outError = tempError6; } else if (!asock4) { *outError = tempError4; } else { *outError = ASOCKERR_LISTEN; } } return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Listen -- * * Listens on specified address and/or port for all resolved socket * families and accepts new connections. Fires the connect callback with * new AsyncSocket object for each connection. * * If address string is present and that string is not the "localhost" * loopback, then we will listen on resolved address only. * * If address string is NULL or is "localhost" we will listen on all * address families that will resolve on the host. * * If port requested is 0, we will let the system assign the first * available port. * * If address string is NULL and port requested is not 0, we will listen * on any address for all resolved protocols for the port requested. * * If address string is "localhost" and port is 0, we will use the first * port we are given if the host supports multiple address families. * If by chance we try to bind on a port that is available for one * protocol and not the other, we will attempt a second time with the * order of address families reversed. * * If address string is NULL, port cannot be 0. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket/s, binds and listens. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_Listen(const char *addrStr, // IN: optional unsigned int port, // IN: optional AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN int *outError) // OUT: optional { return AsyncSocketListenerCreate(addrStr, port, connectFn, clientData, pollParams, FALSE, FALSE, NULL, outError); } /* *---------------------------------------------------------------------------- * * AsyncSocket_ListenLoopback -- * * Listens on loopback interface and port for all resolved socket * families and accepts new connections. Fires the connect callback with * new AsyncSocket object for each connection. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket/s, binds and listens. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_ListenLoopback(unsigned int port, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN int *outError) // OUT: optional { return AsyncSocketListenerCreateLoopback(port, connectFn, clientData, pollParams, FALSE, FALSE, outError); } /* *---------------------------------------------------------------------------- * * AsyncSocket_ListenVMCI -- * * Listens on the specified port and accepts new connections. Fires the * connect callback with new AsyncSocket object for each connection. * * Results: * New AsyncSocket in listening state or NULL on error. * * Side effects: * Creates new socket, binds and listens. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_ListenVMCI(unsigned int cid, // IN unsigned int port, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketPollParams *pollParams, // IN int *outError) // OUT { struct sockaddr_vm addr; AsyncSocket *asock; int vsockDev = -1; memset(&addr, 0, sizeof addr); addr.svm_family = VMCISock_GetAFValueFd(&vsockDev); addr.svm_cid = cid; addr.svm_port = port; asock = AsyncSocketListenImpl((struct sockaddr_storage *)&addr, sizeof addr, connectFn, clientData, pollParams, FALSE, FALSE, NULL, outError); VMCISock_ReleaseAFValueFd(vsockDev); return asock; } /* *---------------------------------------------------------------------------- * * AsyncSocketInit -- * * This is an internal routine that sets up a SOCK_STREAM (TCP) socket. * * Results: * New AsyncSocket or NULL on error. * * Side effects: * Creates new socket. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocketInit(int socketFamily, // IN AsyncSocketPollParams *pollParams, // IN int *outError) // OUT { AsyncSocket *asock = NULL; int error = ASOCKERR_GENERIC; int sysErr; int fd; /* * Create a new socket */ if ((fd = socket(socketFamily, SOCK_STREAM, 0)) == -1) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "could not create new socket, error %d: %s\n", sysErr, Err_Errno2String(sysErr)); goto errorNoFd; } /* * Wrap it with an asock object */ if ((asock = AsyncSocket_AttachToFd(fd, pollParams, &error)) == NULL) { goto error; } return asock; error: SSLGeneric_close(fd); errorNoFd: if (outError) { *outError = error; } return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocketGetPort -- * * This is an internal routine that gets a port given an address. The * address must be in either AF_INET, AF_INET6 or AF_VMCI format. * * Results: * Port number (in host byte order for INET). * * Side effects: * None. * *---------------------------------------------------------------------------- */ static unsigned int AsyncSocketGetPort(struct sockaddr_storage *addr) { ASSERT(NULL != addr); if (AF_INET == addr->ss_family) { return ntohs(((struct sockaddr_in *)addr)->sin_port); } else if (AF_INET6 == addr->ss_family) { return ntohs(((struct sockaddr_in6 *)addr)->sin6_port); #ifndef _WIN32 } else if (AF_UNIX == addr->ss_family) { return MAX_UINT32; // Not applicable #endif } else { #ifdef VMX86_DEBUG int vsockDev = -1; ASSERT(VMCISock_GetAFValueFd(&vsockDev) == addr->ss_family); VMCISock_ReleaseAFValueFd(vsockDev); #endif return ((struct sockaddr_vm *)addr)->svm_port; } } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetPort -- * * Given an AsyncSocket object, returns the port number associated with * the requested address family's file descriptor if available. * * Results: * Port number in host byte order. MAX_UINT32 on error. * * Side effects: * None. * *---------------------------------------------------------------------------- */ unsigned int AsyncSocket_GetPort(AsyncSocket *asock) // IN { AsyncSocket *tempAsock; struct sockaddr_storage addr; socklen_t addrLen = sizeof addr; unsigned int ret = MAX_UINT32; if (asock->fd != -1) { tempAsock = asock; } else if (asock->listenAsock6 && asock->listenAsock6->fd != -1) { tempAsock = asock->listenAsock6; } else if (asock->listenAsock4 && asock->listenAsock4->fd != -1) { tempAsock = asock->listenAsock4; } else { return ret; } AsyncSocketLock(tempAsock); if (AsyncSocketGetAddr(tempAsock, AF_UNSPEC, &addr, &addrLen) == ASOCKERR_SUCCESS) { ret = AsyncSocketGetPort(&addr); } AsyncSocketUnlock(tempAsock); return ret; } /* *---------------------------------------------------------------------------- * * AsyncSocketOSVersionSupportsV4Mapped -- * * Determine if runtime environment supports IPv4-mapped IPv6 addressed * and all the functionality needed to deal with this scenario. * * Results: * Returns TRUE if supported. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool AsyncSocketOSVersionSupportsV4Mapped() { #ifdef _WIN32 OSVERSIONINFOW osvi = {sizeof(OSVERSIONINFOW)}; /* * Starting with msvc-12.0 / SDK v8.1 GetVersionEx is deprecated. * Bug 1259185 tracks switching to VerifyVersionInfo. */ #pragma warning(suppress : 4996) // 'function': was declared deprecated GetVersionExW(&osvi); /* Windows version is at least Vista or higher */ return osvi.dwMajorVersion >= 6; #else return TRUE; #endif } /* *---------------------------------------------------------------------------- * * AsyncSocketBind -- * * This is an internal routine that binds a socket to a port. * * Results: * Returns TRUE upon success, FALSE upon failure. * * Side effects: * Socket is bound to a particular port. * *---------------------------------------------------------------------------- */ Bool AsyncSocketBind(AsyncSocket *asock, // IN struct sockaddr_storage *addr, // IN socklen_t addrLen, // IN int *outError) // OUT { int error = ASOCKERR_BIND; int sysErr; unsigned int port; ASSERT(NULL != asock); ASSERT(NULL != asock->sslSock); ASSERT(NULL != addr); port = AsyncSocketGetPort(addr); ASOCKLG0(asock, ("creating new listening socket on port %d\n", port)); #ifndef _WIN32 /* * Don't ever use SO_REUSEADDR on Windows; it doesn't mean what you think * it means. */ if (addr->ss_family == AF_INET || addr->ss_family == AF_INET6) { int reuse = port != 0; if (setsockopt(asock->fd, SOL_SOCKET, SO_REUSEADDR, (const void *) &reuse, sizeof(reuse)) != 0) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "could not set SO_REUSEADDR, error %d: %s\n", sysErr, Err_Errno2String(sysErr)); } } #else /* * Always set SO_EXCLUSIVEADDRUSE on Windows, to prevent other applications * from stealing this socket. (Yes, Windows is that stupid). */ { int exclusive = 1; if (setsockopt(asock->fd, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, (const void *) &exclusive, sizeof(exclusive)) != 0) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "could not set SO_EXCLUSIVEADDRUSE, error %d: " "%s\n", sysErr, Err_Errno2String(sysErr)); } } #endif #if defined(IPV6_V6ONLY) /* * WINDOWS: By default V4MAPPED was not supported until Windows Vista. * IPV6_V6ONLY was disabled by default until Windows 7. So if we are binding * to a AF_INET6 socket and IPV6_V6ONLY existed, we need to turn it on no * matter what the setting is to disable V4 mapping. * * MAC OSX: Support for IPV6_V6ONLY can be found in 10.5+. * * LINUX: IPV6_V6ONLY was released after V4MAPPED was implemented. There is * no way to turn V4MAPPED off on those systems. The default behavior * differs from distro-to-distro so attempt to turn V4MAPPED off on all * systems that have IPV6_V6ONLY define. There is no good solution for the * case where we cannot enable IPV6_V6ONLY, if we error in this case and do * not have a IPv4 option then we render the application useless. * See AsyncSocketAcceptInternal for the IN6_IS_ADDR_V4MAPPED validation * for incomming addresses to close this loophole. */ if (addr->ss_family == AF_INET6 && AsyncSocketOSVersionSupportsV4Mapped()) { int on = 1; if (setsockopt(asock->fd, IPPROTO_IPV6, IPV6_V6ONLY, (const void *) &on, sizeof(on)) != 0) { Warning(ASOCKPREFIX "Cannot set IPV6_V6ONLY socket option.\n"); } } #else #error No compiler definition for IPV6_V6ONLY #endif /* * Bind to a port */ if (bind(asock->fd, (struct sockaddr *)addr, addrLen) != 0) { sysErr = ASOCK_LASTERROR(); if (sysErr == ASOCK_EADDRINUSE) { error = ASOCKERR_BINDADDRINUSE; } Warning(ASOCKPREFIX "Could not bind socket, error %d: %s\n", sysErr, Err_Errno2String(sysErr)); goto error; } return TRUE; error: SSL_Shutdown(asock->sslSock); free(asock); if (outError) { *outError = error; } return FALSE; } /* *---------------------------------------------------------------------------- * * AsyncSocketListen -- * * This is an internal routine that calls listen() on a socket. * * Results: * Returns TRUE upon success, FALSE upon failure. * * Side effects: * Socket is in listening state. * *---------------------------------------------------------------------------- */ Bool AsyncSocketListen(AsyncSocket *asock, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN int *outError) // OUT { VMwareStatus pollStatus; int error; ASSERT(NULL != asock); ASSERT(NULL != asock->sslSock); if (!connectFn) { Warning(ASOCKPREFIX "invalid arguments to listen!\n"); error = ASOCKERR_INVAL; goto error; } /* * Listen on the socket */ if (listen(asock->fd, 5) != 0) { int sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "could not listen on socket, error %d: %s\n", sysErr, Err_Errno2String(sysErr)); error = ASOCKERR_LISTEN; goto error; } /* * Register a read callback to fire each time the socket * is ready for accept. */ AsyncSocketLock(asock); pollStatus = AsyncSocketPollAdd(asock, TRUE, POLL_FLAG_READ | POLL_FLAG_PERIODIC, AsyncSocketAcceptCallback); if (pollStatus != VMWARE_STATUS_SUCCESS) { ASOCKWARN(asock, ("could not register accept callback!\n")); error = ASOCKERR_POLL; AsyncSocketUnlock(asock); goto error; } asock->state = AsyncSocketListening; asock->connectFn = connectFn; asock->clientData = clientData; AsyncSocketUnlock(asock); return TRUE; error: SSL_Shutdown(asock->sslSock); free(asock); if (outError) { *outError = error; } return FALSE; } /* *---------------------------------------------------------------------------- * * AsyncSocketConnectImpl -- * * AsyncSocket AF_INET/AF_INET6 connect. * * NOTE: This function can block. * * Results: * AsyncSocket * on success and NULL on failure. * On failure, error is returned in *outError. * * Side effects: * Allocates an AsyncSocket, registers a poll callback. * *---------------------------------------------------------------------------- */ static AsyncSocket * AsyncSocketConnectImpl(int socketFamily, const char *hostname, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *outError) { struct sockaddr_storage addr; int getaddrinfoError; int error; AsyncSocket *asock; char *ipString = NULL; socklen_t addrLen; /* * Resolve the hostname. Handles dotted decimal strings, too. */ getaddrinfoError = AsyncSocketResolveAddr(hostname, port, socketFamily, FALSE, &addr, &addrLen, &ipString); if (0 != getaddrinfoError) { Log(ASOCKPREFIX "Failed to resolve %s address '%s' and port %u\n", socketFamily == AF_INET ? "IPv4" : "IPv6", hostname, port); error = ASOCKERR_CONNECT; goto error; } Log(ASOCKPREFIX "creating new %s socket, connecting to %s (%s)\n", socketFamily == AF_INET ? "IPv4" : "IPv6", ipString, hostname); free(ipString); asock = AsyncSocketConnect(&addr, addrLen, connectFn, clientData, AsyncSocketConnectCallback, flags, pollParams, &error); if (!asock) { Warning(ASOCKPREFIX "%s connection attempt failed\n", socketFamily == AF_INET ? "IPv4" : "IPv6"); error = ASOCKERR_CONNECT; goto error; } return asock; error: if (outError) { *outError = error; } return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Connect -- * * AsyncSocket connect. Connection is attempted with AF_INET socket * family, when that fails AF_INET6 is attempted. * * NOTE: This function can block. * * Results: * AsyncSocket * on success and NULL on failure. * On failure, error is returned in *outError. * * Side effects: * Allocates an AsyncSocket, registers a poll callback. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_Connect(const char *hostname, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *outError) { int error = ASOCKERR_CONNECT; AsyncSocket *asock = NULL; if (!connectFn || !hostname) { error = ASOCKERR_INVAL; Warning(ASOCKPREFIX "invalid arguments to connect!\n"); goto error; } asock = AsyncSocketConnectImpl(AF_INET, hostname, port, connectFn, clientData, flags, pollParams, &error); if (!asock) { asock = AsyncSocketConnectImpl(AF_INET6, hostname, port, connectFn, clientData, flags, pollParams, &error); } error: if (!asock && outError) { *outError = error; } return asock; } /* *---------------------------------------------------------------------------- * * AsyncSocket_ConnectVMCI -- * * AsyncSocket AF_VMCI constructor. Connects to the specified cid:port, * and passes the caller a valid asock via the callback once the * connection has been established. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * Allocates an AsyncSocket, registers a poll callback. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_ConnectVMCI(unsigned int cid, // IN unsigned int port, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketConnectFlags flags, // IN AsyncSocketPollParams *pollParams, // IN int *outError) // OUT { int vsockDev = -1; struct sockaddr_vm addr; AsyncSocket *asock; memset(&addr, 0, sizeof addr); addr.svm_family = VMCISock_GetAFValueFd(&vsockDev); addr.svm_cid = cid; addr.svm_port = port; Log(ASOCKPREFIX "creating new socket, connecting to %u:%u\n", cid, port); asock = AsyncSocketConnect((struct sockaddr_storage *)&addr, sizeof addr, connectFn, clientData, AsyncSocketConnectCallback, flags, pollParams, outError); VMCISock_ReleaseAFValueFd(vsockDev); return asock; } #ifndef _WIN32 /* *---------------------------------------------------------------------------- * * AsyncSocket_ConnectUnixDomain -- * * AsyncSocket AF_UNIX constructor. Connects to the specified unix socket, * and passes the caller a valid asock via the callback once the * connection has been established. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * Allocates an AsyncSocket, registers a poll callback. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_ConnectUnixDomain(const char *path, // IN AsyncSocketConnectFn connectFn, // IN void *clientData, // IN AsyncSocketConnectFlags flags, // IN AsyncSocketPollParams *pollParams, // IN int *outError) // OUT { struct sockaddr_un addr; AsyncSocket *asock; memset(&addr, 0, sizeof addr); addr.sun_family = AF_UNIX; if (strlen(path) + 1 > sizeof addr.sun_path) { Warning(ASOCKPREFIX "Path '%s' is too long for a unix domain socket!\n", path); return NULL; } Str_Strcpy(addr.sun_path, path, sizeof addr.sun_path); Log(ASOCKPREFIX "creating new socket, connecting to %s\n", path); asock = AsyncSocketConnect((struct sockaddr_storage *)&addr, sizeof addr, connectFn, clientData, AsyncSocketConnectCallback, flags, pollParams, outError); return asock; } #endif /* *---------------------------------------------------------------------------- * * AsyncSocketConnect -- * AsyncSocketConnectWithAsock -- * * Internal AsyncSocket constructor. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_GENERIC. * * Side effects: * Allocates an AsyncSocket, registers a poll callback. * *---------------------------------------------------------------------------- */ static AsyncSocket * AsyncSocketConnect(struct sockaddr_storage *addr, socklen_t addrLen, AsyncSocketConnectFn connectFn, void *clientData, PollerFunction internalConnectFn, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *outError) { int fd; AsyncSocket *asock = NULL; int error = ASOCKERR_GENERIC; int sysErr; ASSERT(addr); if (!connectFn) { error = ASOCKERR_INVAL; Warning(ASOCKPREFIX "invalid arguments to connect!\n"); goto error; } if (!internalConnectFn) { error = ASOCKERR_INVAL; Warning(ASOCKPREFIX "invalid arguments to connect!\n"); goto error; } /* * Create a new IP socket */ if ((fd = socket(addr->ss_family, SOCK_STREAM, 0)) == -1) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "failed to create socket, error %d: %s\n", sysErr, Err_Errno2String(sysErr)); error = ASOCKERR_CONNECT; goto error; } /* * Wrap it with an asock */ if ((asock = AsyncSocket_AttachToFd(fd, pollParams, &error)) == NULL) { SSLGeneric_close(fd); goto error; } return AsyncSocketConnectWithAsock(asock, addr, addrLen, connectFn, clientData, internalConnectFn, pollParams, outError); error: if (outError) { *outError = error; } return NULL; } AsyncSocket * AsyncSocketConnectWithAsock(AsyncSocket *asock, struct sockaddr_storage *addr, socklen_t addrLen, AsyncSocketConnectFn connectFn, void *clientData, PollerFunction internalConnectFn, AsyncSocketPollParams *pollParams, int *outError) { VMwareStatus pollStatus; int sysErr; int error = ASOCKERR_GENERIC; /* * Call connect(), which can either succeed immediately or return an error * indicating that the connection is in progress. In the latter case, we * can poll the fd for write to find out when the connection attempt * has succeeded (or failed). In either case, we want to invoke the * caller's connect callback from Poll rather than directly, so if the * connection succeeds immediately, we just schedule the connect callback * as a one-time (RTime) callback instead. */ AsyncSocketLock(asock); if (connect(asock->fd, (struct sockaddr *)addr, addrLen) != 0) { if (ASOCK_LASTERROR() == ASOCK_ECONNECTING) { ASSERT(!(vmx86_server && addr->ss_family == AF_UNIX)); ASOCKLOG(1, asock, ("registering write callback for socket connect\n")); pollStatus = AsyncSocketPollAdd(asock, TRUE, POLL_FLAG_WRITE, internalConnectFn); } else { sysErr = ASOCK_LASTERROR(); Log(ASOCKPREFIX "connect failed, error %d: %s\n", sysErr, Err_Errno2String(sysErr)); error = ASOCKERR_CONNECT; goto errorHaveAsock; } } else { ASOCKLOG(2, asock, ("socket connected, registering RTime callback for connect\n")); pollStatus = AsyncSocketPollAdd(asock, FALSE, 0, internalConnectFn, 0); } if (pollStatus != VMWARE_STATUS_SUCCESS) { ASOCKWARN(asock, ("failed to register callback in connect!\n")); error = ASOCKERR_POLL; goto errorHaveAsock; } asock->state = AsyncSocketConnecting; asock->connectFn = connectFn; asock->clientData = clientData; /* Store a copy of the sockaddr_storage so we can look it up later. */ asock->remoteAddr = *addr; asock->remoteAddrLen = addrLen; AsyncSocketUnlock(asock); return asock; errorHaveAsock: SSL_Shutdown(asock->sslSock); AsyncSocketUnlock(asock); free(asock); if (outError) { *outError = error; } return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocketCreate -- * * AsyncSocket constructor for fields common to all AsyncSocket types. * * Results: * New AsyncSocket object. * * Side effects: * Allocates memory. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocketCreate(AsyncSocketPollParams *pollParams) // IN { AsyncSocket *s; s = Util_SafeCalloc(1, sizeof *s); s->id = Atomic_ReadInc32(&nextid); s->state = AsyncSocketConnected; s->fd = -1; s->refCount = 1; s->inRecvLoop = FALSE; s->sendBufFull = FALSE; s->sendBufTail = &(s->sendBufList); s->passFd.fd = -1; if (pollParams) { s->pollParams = *pollParams; } else { s->pollParams.pollClass = POLL_CS_MAIN; s->pollParams.flags = 0; s->pollParams.lock = NULL; s->pollParams.iPoll = NULL; } return s; } /* *---------------------------------------------------------------------------- * * AsyncSocket_AttachToSSLSock -- * * AsyncSocket constructor. Wraps an existing SSLSock object with an * AsyncSocket and returns the latter. * * Results: * New AsyncSocket object or NULL on error. * * Side effects: * Allocates memory, makes the underlying fd for the socket non-blocking. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_AttachToSSLSock(SSLSock sslSock, AsyncSocketPollParams *pollParams, int *outError) { AsyncSocket *s; int fd; int error; ASSERT(sslSock); fd = SSL_GetFd(sslSock); if ((AsyncSocketMakeNonBlocking(fd)) != ASOCKERR_SUCCESS) { int sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "failed to make fd %d non-blocking!: %d, %s\n", fd, sysErr, Err_Errno2String(sysErr)); error = ASOCKERR_GENERIC; goto error; } s = AsyncSocketCreate(pollParams); s->sslSock = sslSock; s->fd = fd; s->asockType = ASYNCSOCKET_TYPE_SOCKET; if (s->pollParams.iPoll == NULL) { s->vt = &asyncStreamSocketVTable; } else { s->vt = &asyncStreamSocketIPollVTable; } /* From now on socket is ours. */ SSL_SetCloseOnShutdownFlag(sslSock); ASOCKLOG(1, s, ("new asock id %u attached to fd %d\n", s->id, s->fd)); return s; error: if (outError) { *outError = error; } return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocket_AttachToFd -- * * AsyncSocket constructor. Wraps a valid socket fd with an AsyncSocket * object. * * Results: * New AsyncSocket or NULL on error. * * Side effects: * If function succeeds, fd is owned by AsyncSocket and should not be * used (f.e. closed) anymore. * *---------------------------------------------------------------------------- */ AsyncSocket * AsyncSocket_AttachToFd(int fd, AsyncSocketPollParams *pollParams, int *outError) { SSLSock sslSock; AsyncSocket *asock; /* * Create a new SSL socket object with the current socket */ if (!(sslSock = SSL_New(fd, FALSE))) { if (outError) { *outError = ENOMEM; } LOG(0, (ASOCKPREFIX "failed to create SSL socket object\n")); return NULL; } asock = AsyncSocket_AttachToSSLSock(sslSock, pollParams, outError); if (asock) { return asock; } SSL_Shutdown(sslSock); return NULL; } /* *---------------------------------------------------------------------------- * * AsyncSocket_UseNodelay -- * * Sets or unset TCP_NODELAY on the socket, which disables or * enables Nagle's algorithm, respectively. * * Results: * ASOCKERR_SUCCESS on success, ASOCKERR_GENERIC otherwise. * * Side Effects: * Increased bandwidth usage for short messages on this socket * due to TCP overhead, in exchange for lower latency. * *---------------------------------------------------------------------------- */ int AsyncSocket_UseNodelay(AsyncSocket *asock, // IN/OUT: Bool nodelay) // IN: { int flag = nodelay ? 1 : 0; AsyncSocketLock(asock); if (setsockopt(asock->fd, IPPROTO_TCP, TCP_NODELAY, (const void *) &flag, sizeof(flag)) != 0) { asock->genericErrno = Err_Errno(); LOG(0, (ASOCKPREFIX "could not set TCP_NODELAY, error %d: %s\n", Err_Errno(), Err_ErrString())); AsyncSocketUnlock(asock); return ASOCKERR_GENERIC; } else { AsyncSocketUnlock(asock); return ASOCKERR_SUCCESS; } } /* *---------------------------------------------------------------------------- * * AsyncSocket_SetTCPTimeouts -- * * Allow caller to set a number of TCP-specific timeout * parameters on the socket for the active connection. * * Parameters: * keepIdle -- The number of seconds a TCP connection must be idle before * keep-alive probes are sent. * keepIntvl -- The number of seconds between TCP keep-alive probes once * they are being sent. * keepCnt -- The number of keep-alive probes to send before killing * the connection if no response is received from the peer. * * Results: * ASOCKERR_SUCCESS on success, ASOCKERR_GENERIC otherwise. * * Side Effects: * None. * *---------------------------------------------------------------------------- */ #ifdef VMX86_SERVER int AsyncSocket_SetTCPTimeouts(AsyncSocket *asock, // IN/OUT: int keepIdle, // IN int keepIntvl, // IN int keepCnt) // IN { int val; int opt; ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); AsyncSocketLock(asock); val = keepIdle; opt = TCP_KEEPIDLE; if (setsockopt(asock->fd, IPPROTO_TCP, opt, &val, sizeof val) != 0) { goto error; } val = keepIntvl; opt = TCP_KEEPINTVL; if (setsockopt(asock->fd, IPPROTO_TCP, opt, &val, sizeof val) != 0) { goto error; } val = keepCnt; opt = TCP_KEEPCNT; if (setsockopt(asock->fd, IPPROTO_TCP, opt, &val, sizeof val) != 0) { goto error; } AsyncSocketUnlock(asock); return ASOCKERR_SUCCESS; error: asock->genericErrno = Err_Errno(); LOG(0, (ASOCKPREFIX "could not set TCP Timeout %d, error %d: %s\n", opt, Err_Errno(), Err_ErrString())); AsyncSocketUnlock(asock); return ASOCKERR_GENERIC; } #endif /* *---------------------------------------------------------------------------- * * AsyncSocketRecvSocket -- * * Does the socket specific portion of a AsyncSocket_Recv call. * * Results: * ASOCKERR_*. * * Side effects: * Could register poll callback. * *---------------------------------------------------------------------------- */ int AsyncSocketRecvSocket(AsyncSocket *asock, // IN: void *buf, // IN: unused int len) // IN: unused { int retVal = ASOCKERR_SUCCESS; if (!asock->recvCb) { VMwareStatus pollStatus; /* * Register the Poll callback */ ASOCKLOG(3, asock, ("installing recv periodic poll callback\n")); pollStatus = AsyncSocketPollAdd(asock, TRUE, POLL_FLAG_READ | POLL_FLAG_PERIODIC, asock->vt->recvCallback); if (pollStatus != VMWARE_STATUS_SUCCESS) { ASOCKWARN(asock, ("failed to install recv callback!\n")); retVal = ASOCKERR_POLL; goto out; } asock->recvCb = TRUE; } if (AsyncSocketHasDataPending(asock) && !asock->inRecvLoop) { ASOCKLOG(0, asock, ("installing recv RTime poll callback\n")); if (AsyncSocketPollAdd(asock, FALSE, 0, asock->vt->recvCallback, 0) != VMWARE_STATUS_SUCCESS) { retVal = ASOCKERR_POLL; goto out; } asock->recvCbTimer = TRUE; } out: return retVal; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Recv -- * AsyncSocket_RecvPartial -- * * Registers a callback that will fire once the specified amount of data * has been received on the socket. * * In the case of AsyncSocket_RecvPartial, the callback is fired * once all or part of the data has been received on the socket. * * Data that was not retrieved at the last call of SSL_read() could still * be buffered inside the SSL layer and will be retrieved on the next * call to SSL_read(). However poll/select might not mark the socket as * for reading since there might not be any data in the underlying network * socket layer. Hence in the read callback, we keep spinning until all * all the data buffered inside the SSL layer is retrieved before * returning to the poll loop (See AsyncSocketFillRecvBuffer()). * * However, we might not have come out of Poll in the first place, e.g. * if this is the first call to AsyncSocket_Recv() after creating a new * connection. In this situation, if there is buffered SSL data pending, * we have to schedule an RTTime callback to force retrieval of the data. * This could also happen if the client calls AsyncSocket_RecvBlocking, * some data is left in the SSL layer, and the client then calls * AsyncSocket_Recv. We use the inRecvLoop variable to detect and handle * this condition, i.e., if inRecvLoop is FALSE, we need to schedule the * RTime callback. * * TCP usage: * AsyncSocket_Recv(AsyncSocket *asock, * void *buf, * int len, * AsyncSocketRecvFn recvFn, * void *clientData) * * Results: * ASOCKERR_*. * * Side effects: * Could register poll callback. * *---------------------------------------------------------------------------- */ int AsyncSocket_Recv(AsyncSocket *asock, void *buf, int len, void *cb, void *cbData) { return AsyncSocketRecv(asock, buf, len, FALSE, cb, cbData); } int AsyncSocket_RecvPartial(AsyncSocket *asock, void *buf, int len, void *cb, void *cbData) { /* * Not yet implemented/tested on windows named pipe (though support * there should be easy). */ ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); return AsyncSocketRecv(asock, buf, len, TRUE, cb, cbData); } /* *---------------------------------------------------------------------------- * * AsyncSocketRecv -- * * Internal function to implement AsyncSocket_Recv and * AsyncSocket_RecvPartial. * * Results: * ASOCKERR_*. * * Side effects: * Could register poll callback. * *---------------------------------------------------------------------------- */ int AsyncSocketRecv(AsyncSocket *asock, // IN: void *buf, // IN: unused int len, // IN: unused Bool fireOnPartial, // IN: void *cb, // IN: void *cbData) // IN: { AsyncSocketRecvFn recvFn = NULL; void *clientData = NULL; int retVal; if (!asock) { Warning(ASOCKPREFIX "Recv called with invalid arguments!\n"); return ASOCKERR_INVAL; } if (!asock->errorFn) { ASOCKWARN(asock, ("%s: no registered error handler!\n", __FUNCTION__)); return ASOCKERR_INVAL; } recvFn = cb; clientData = cbData; /* * XXX We might want to allow passing NULL for the recvFn, to indicate that * the client is no longer interested in reading from the socket. This * would be useful e.g. for HTTP, where the client sends a request and * then the client->server half of the connection is closed. */ if (!buf || !recvFn || len <= 0) { Warning(ASOCKPREFIX "Recv called with invalid arguments!\n"); return ASOCKERR_INVAL; } AsyncSocketLock(asock); if (asock->state != AsyncSocketConnected) { ASOCKWARN(asock, ("recv called but state is not connected!\n")); retVal = ASOCKERR_NOTCONNECTED; goto outHaveLock; } if (asock->inBlockingRecv) { ASOCKWARN(asock, ("Recv called while a blocking recv is pending.\n")); retVal = ASOCKERR_INVAL; goto outHaveLock; } if (asock->recvBuf && asock->recvPos != 0) { ASOCKWARN(asock, ("Recv called -- partially read buffer discarded.\n")); } ASSERT(asock->vt); ASSERT(asock->vt->recv); retVal = asock->vt->recv(asock, buf, len); if (retVal != ASOCKERR_SUCCESS) { goto outHaveLock; } asock->recvBuf = buf; asock->recvFn = recvFn; asock->recvLen = len; asock->recvFireOnPartial = fireOnPartial; asock->recvPos = 0; asock->clientData = clientData; retVal = ASOCKERR_SUCCESS; outHaveLock: AsyncSocketUnlock(asock); return retVal; } /* *---------------------------------------------------------------------------- * * AsyncSocket_RecvPassedFd -- * * See AsyncSocket_Recv. Besides that it allows for receiving one * file descriptor... * * Results: * ASOCKERR_*. * * Side effects: * Could register poll callback. * *---------------------------------------------------------------------------- */ int AsyncSocket_RecvPassedFd(AsyncSocket *asock, // IN/OUT: socket void *buf, // OUT: buffer with data int len, // IN: length void *cb, // IN: completion calback void *cbData) // IN: callback's data { int err; ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (!asock) { Warning(ASOCKPREFIX "Recv called with invalid arguments!\n"); return ASOCKERR_INVAL; } if (!asock->errorFn) { ASOCKWARN(asock, ("%s: no registered error handler!\n", __FUNCTION__)); return ASOCKERR_INVAL; } AsyncSocketLock(asock); if (asock->passFd.fd != -1) { SSLGeneric_close(asock->passFd.fd); asock->passFd.fd = -1; } asock->passFd.expected = TRUE; err = AsyncSocket_Recv(asock, buf, len, cb, cbData); if (err != ASOCKERR_SUCCESS) { asock->passFd.expected = FALSE; } AsyncSocketUnlock(asock); return err; } /* *---------------------------------------------------------------------------- * * AsyncSocketPoll -- * * Blocks on the specified socket until there's data pending or a * timeout occurs. * * If the specified socket is a dual stack listener, we will poll on all * listening sockets and will return when one is ready with data for a * connection. If both socket families happen to race with connect data, * we will favor IPv6 for the return. * * Results: * ASOCKERR_SUCCESS if it worked, ASOCKERR_GENERIC on system call * failures * ASOCKERR_TIMEOUT if we just didn't receive enough data. * * Side effects: * None. *---------------------------------------------------------------------------- */ static int AsyncSocketPoll(AsyncSocket *s, // IN: Bool read, // IN: int timeoutMS, // IN: AsyncSocket **outAsock) // OUT: { #ifndef _WIN32 struct pollfd p[2]; int retval; #else /* * We use select() to do this on Windows, since there ain't no poll(). * Fortunately, select() doesn't have the 1024 fd value limit. */ int retval; struct timeval tv; struct fd_set rwfds; struct fd_set exceptfds; #endif AsyncSocket *asock[2]; int numSock = 0; int i; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(*outAsock == NULL); if (read && s->fd == -1) { if (!s->listenAsock4 && !s->listenAsock6) { ASSERT(FALSE); ASOCKLG0(s, ("%s: Failed to find listener socket.\n", __FUNCTION__)); return ASOCKERR_GENERIC; } if (s->listenAsock6 && s->listenAsock6->fd != -1) { asock[numSock++] = s->listenAsock6; } if (s->listenAsock4 && s->listenAsock4->fd != -1) { asock[numSock++] = s->listenAsock4; } } else { asock[numSock++] = s; } for (i = 0; i < numSock; i++) { if (read && SSL_Pending(asock[i]->sslSock)) { *outAsock = asock[i]; return ASOCKERR_SUCCESS; } } while (1) { #ifndef _WIN32 for (i = 0; i < numSock; i++) { p[i].fd = asock[i]->fd; p[i].events = read ? POLLIN : POLLOUT; } retval = poll(p, numSock, timeoutMS); #else tv.tv_sec = timeoutMS / 1000; tv.tv_usec = (timeoutMS % 1000) * 1000; FD_ZERO(&rwfds); FD_ZERO(&exceptfds); for (i = 0; i < numSock; i++) { FD_SET(asock[i]->fd, &rwfds); FD_SET(asock[i]->fd, &exceptfds); } retval = select(1, read ? &rwfds : NULL, read ? NULL : &rwfds, &exceptfds, timeoutMS >= 0 ? &tv : NULL); #endif switch (retval) { case 1: case 2: { Bool failed = FALSE; #ifndef _WIN32 for (i = 0; i < numSock; i++) { if (p[i].revents & (POLLERR | POLLNVAL)) { failed = TRUE; } } #else for (i = 0; i < numSock; i++) { if (FD_ISSET(asock[i]->fd, &exceptfds)) { failed = TRUE; } } #endif if (failed) { int sockErr = 0; int sysErr; int sockErrLen = sizeof sockErr; for (i = 0; i < numSock; i++) { if (getsockopt(asock[i]->fd, SOL_SOCKET, SO_ERROR, (void *) &sockErr, (void *) &sockErrLen) == 0) { if (sockErr) { asock[i]->genericErrno = sockErr; ASOCKLG0(asock[i], ("%s: Socket error lookup returned %d: %s\n", __FUNCTION__, sockErr, Err_Errno2String(sockErr))); } } else { sysErr = ASOCK_LASTERROR(); asock[i]->genericErrno = sysErr; ASOCKLG0(asock[i], ("%s: Last socket error %d: %s\n", __FUNCTION__, sysErr, Err_Errno2String(sysErr))); } } return ASOCKERR_GENERIC; } /* * If one socket is ready, and it wasn't in an exception state, * everything is ok. The socket is ready for reading/writing. */ #ifndef _WIN32 for (i = 0; i < numSock; i++) { if (p[i].revents & (read ? POLLIN : POLLOUT)) { *outAsock = asock[i]; return ASOCKERR_SUCCESS; } } #else for (i = 0; i < numSock; i++) { if (FD_ISSET(asock[i]->fd, &rwfds)) { *outAsock = asock[i]; return ASOCKERR_SUCCESS; } } #endif ASOCKWARN(s, ("%s: Failed to return a ready socket.\n", __FUNCTION__)); return ASOCKERR_GENERIC; } case 0: /* * No sockets were ready within the specified time. */ ASOCKLG0(s, ("%s: Timeout waiting for a ready socket.\n", __FUNCTION__)); return ASOCKERR_TIMEOUT; case -1: { int sysErr = ASOCK_LASTERROR(); if (sysErr == EINTR) { /* * We were somehow interrupted by signal. Let's loop and retry. */ ASOCKLG0(s, ("%s: Socket interrupted by a signal.\n", __FUNCTION__)); continue; } s->genericErrno = sysErr; ASOCKLG0(s, ("%s: Failed with error %d: %s\n", __FUNCTION__, sysErr, Err_Errno2String(sysErr))); return ASOCKERR_GENERIC; } default: NOT_REACHED(); } } } /* *---------------------------------------------------------------------------- * * AsyncSocket_RecvBlocking -- * AsyncSocket_RecvPartialBlocking -- * AsyncSocket_SendBlocking -- * * Implement "blocking + timeout" operations on the socket. These are * simple wrappers around the AsyncSocketBlockingWork function, which * operates on the actual non-blocking socket, using poll to determine * when it's ok to keep reading/writing. If we can't finish within the * specified time, we give up and return the ASOCKERR_TIMEOUT error. * * Note that if these are called from a callback and a lock is being * used (pollParams.lock), the whole blocking operation takes place * with that lock held. Regardless, it is the caller's responsibility * to make sure the synchronous and asynchronous operations do not mix. * * Results: * ASOCKERR_SUCCESS if we finished the operation, ASOCKERR_* error codes * otherwise. * * Side effects: * Reads/writes the socket. * *---------------------------------------------------------------------------- */ int AsyncSocket_RecvBlocking(AsyncSocket *s, void *buf, int len, int *received, int timeoutMS) { return AsyncSocketBlockingWork(s, TRUE, buf, len, received, timeoutMS, FALSE); } int AsyncSocket_RecvPartialBlocking(AsyncSocket *s, void *buf, int len, int *received, int timeoutMS) { return AsyncSocketBlockingWork(s, TRUE, buf, len, received, timeoutMS, TRUE); } int AsyncSocket_SendBlocking(AsyncSocket *s, void *buf, int len, int *sent, int timeoutMS) { return AsyncSocketBlockingWork(s, FALSE, buf, len, sent, timeoutMS, FALSE); } /* *---------------------------------------------------------------------------- * * AsyncSocketBlockingWork -- * * Try to complete the specified read/write operation within the * specified time. * * Results: * ASOCKERR_*. * * Side effects: * None. *---------------------------------------------------------------------------- */ int AsyncSocketBlockingWork(AsyncSocket *s, // IN: Bool read, // IN: void *buf, // IN/OUT: int len, // IN: int *completed, // OUT: int timeoutMS, // IN: Bool partial) // IN: { VmTimeType now, done; int sysErr; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (s == NULL || buf == NULL || len <= 0) { Warning(ASOCKPREFIX "Recv called with invalid arguments!\n"); return ASOCKERR_INVAL; } if (s->state != AsyncSocketConnected) { ASOCKWARN(s, ("recv called but state is not connected!\n")); return ASOCKERR_NOTCONNECTED; } if (completed) { *completed = 0; } now = Hostinfo_SystemTimerUS() / 1000; done = now + timeoutMS; do { int numBytes, error; AsyncSocket *asock = NULL; if ((error = AsyncSocketPoll(s, read, done - now, &asock)) != ASOCKERR_SUCCESS) { return error; } ASSERT(asock == s); if ((numBytes = read ? SSL_Read(s->sslSock, buf, len) : SSL_Write(s->sslSock, buf, len)) > 0) { if (completed) { *completed += numBytes; } len -= numBytes; if (len == 0 || partial) { return ASOCKERR_SUCCESS; } buf = (uint8*)buf + numBytes; } else if (numBytes == 0) { ASOCKLG0(s, ("blocking %s detected peer closed connection\n", read ? "recv" : "send")); return ASOCKERR_REMOTE_DISCONNECT; } else if ((sysErr = ASOCK_LASTERROR()) != ASOCK_EWOULDBLOCK) { s->genericErrno = sysErr; ASOCKWARN(s, ("blocking %s error %d: %s\n", read ? "recv" : "send", sysErr, Err_Errno2String(sysErr))); return ASOCKERR_GENERIC; } now = Hostinfo_SystemTimerUS() / 1000; } while ((now < done && timeoutMS > 0) || (timeoutMS < 0)); return ASOCKERR_TIMEOUT; } /* *---------------------------------------------------------------------------- * * AsyncSocketSendSocket -- * * Does the socket specific portion of a AsyncSocket_Send call. * * Results: * ASOCKERR_*. * * Side effects: * May register poll callback or perform I/O. * *---------------------------------------------------------------------------- */ int AsyncSocketSendSocket(AsyncSocket *asock, // IN: Bool bufferListWasEmpty, // IN: void *buf, // IN: unused int len) // IN: unused { int retVal = ASOCKERR_SUCCESS; if (bufferListWasEmpty && !asock->sendCb) { #ifdef _WIN32 /* * If the send buffer list was empty, we schedule a one-time callback * to "prime" the output. This is necessary to support the FD_WRITE * network event semantic for sockets on Windows (see WSAEventSelect * documentation). The event won't signal unless a previous write() on * the socket failed with WSAEWOULDBLOCK, so we have to perform at * least one partial write before we can start polling for write. * * XXX: This can be a device callback once all poll implementations * know to get around this Windows quirk. Both PollVMX and PollDefault * already make 0-byte send() to force WSAEWOULDBLOCK. */ if (AsyncSocketPollAdd(asock, FALSE, 0, asock->vt->sendCallback, asock->pollParams.iPoll != NULL ? 1 : 0) != VMWARE_STATUS_SUCCESS) { retVal = ASOCKERR_POLL; return retVal; } asock->sendCbTimer = TRUE; asock->sendCb = TRUE; #else if (asock->sendLowLatency) { /* * For low-latency sockets, call the callback directly from * this thread. It is non-blocking and will schedule device * callbacks if necessary to complete the operation. * * Unfortunately we can't make this the default as current * consumers of asyncsocket are not expecting the completion * callback to be invoked prior to the call to * AsyncSocket_Send() returning. */ asock->vt->sendCallback((void *)asock); } else { if (AsyncSocketPollAdd(asock, TRUE, POLL_FLAG_WRITE, asock->vt->sendCallback) != VMWARE_STATUS_SUCCESS) { retVal = ASOCKERR_POLL; return retVal; } asock->sendCb = TRUE; } #endif } return retVal; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Send -- * * Queues the provided data for sending on the socket. If a send callback * is provided, the callback is fired after the data has been written to * the socket. Note that this only guarantees that the data has been * copied to the transmit buffer, we make no promises about whether it * has actually been transmitted, or received by the client, when the * callback is fired. * * Send callbacks should also be able to deal with being called if none * or only some of the queued buffer has been transmitted, since the send * callbacks for any remaining buffers are fired by AsyncSocket_Close(). * This condition can be detected by checking the len parameter passed to * the send callback. * * Results: * ASOCKERR_*. * * Side effects: * May register poll callback or perform I/O. * *---------------------------------------------------------------------------- */ int AsyncSocket_Send(AsyncSocket *asock, void *buf, int len, AsyncSocketSendFn sendFn, void *clientData) { int retVal; SendBufList *listBeforeAppend = asock->sendBufList; Bool bufferListWasEmpty = FALSE; /* * Note: I think it should be fine to send with a length of zero and a * buffer of NULL or any other garbage value. However the code * downstream of here is unprepared for it (silently misbehaves). Hence * the <= zero check instead of just a < zero check. --Jeremy. */ if (!asock || !buf || len <= 0) { Warning(ASOCKPREFIX "Send called with invalid arguments! asynchSock: %p " "buffer: %p length: %d\n", asock, buf, len); return ASOCKERR_INVAL; } LOG(2, ("%s: sending %d bytes\n", __FUNCTION__, len)); AsyncSocketLock(asock); if (asock->state != AsyncSocketConnected) { ASOCKWARN(asock, ("send called but state is not connected!\n")); retVal = ASOCKERR_NOTCONNECTED; goto outHaveLock; } ASSERT(asock->vt); ASSERT(asock->vt->prepareSend); retVal = asock->vt->prepareSend(asock, buf, len, sendFn, clientData, &bufferListWasEmpty); if (retVal != ASOCKERR_SUCCESS) { goto outUndoAppend; } ASSERT(asock->vt->send); retVal = asock->vt->send(asock, bufferListWasEmpty, buf, len); if (retVal != ASOCKERR_SUCCESS) { goto outUndoAppend; } retVal = ASOCKERR_SUCCESS; goto outHaveLock; outUndoAppend: if (asock->sendBufList != listBeforeAppend) { SendBufList *appendedBuffer = asock->sendBufList; asock->sendBufList = listBeforeAppend; if (asock->sendBufList == NULL) { asock->sendBufTail = &(asock->sendBufList); } free(appendedBuffer); } outHaveLock: AsyncSocketUnlock(asock); return retVal; } /* *---------------------------------------------------------------------------- * * AsyncSocketResolveAddr -- * * Resolves a hostname and port. * * Results: * Zero upon success. This returns whatever getaddrinfo() returns. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocketResolveAddr(const char *hostname, unsigned int port, int family, Bool passive, struct sockaddr_storage *addr, socklen_t *addrLen, char **addrString) { struct addrinfo hints; struct addrinfo *aiTop = NULL; struct addrinfo *aiIterator = NULL; int getaddrinfoError = 0; char portString[PORT_STRING_LEN]; ASSERT(NULL != addr); if (port > MAX_UINT16) { Log(ASOCKPREFIX "port number requested (%d) is out of range.\n", port); return EAI_SERVICE; } Str_Sprintf(portString, sizeof(portString), "%d", port); memset(&hints, 0, sizeof(hints)); hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; if (passive) { hints.ai_flags = AI_PASSIVE; } getaddrinfoError = Posix_GetAddrInfo(hostname, portString, &hints, &aiTop); if (0 != getaddrinfoError) { Log(ASOCKPREFIX "getaddrinfo failed for host %s: %s\n", hostname, gai_strerror(getaddrinfoError)); goto bye; } for (aiIterator = aiTop; NULL != aiIterator ; aiIterator = aiIterator->ai_next) { if ((family == AF_UNSPEC && (aiIterator->ai_family == AF_INET || aiIterator->ai_family == AF_INET6)) || family == aiIterator->ai_family) { if (addrString != NULL) { char tempAddrString[ADDR_STRING_LEN]; static char unknownAddr[] = "(Unknown)"; #if defined(_WIN32) DWORD len = ARRAYSIZE(tempAddrString); if (WSAAddressToStringA(aiIterator->ai_addr, aiIterator->ai_addrlen, NULL, tempAddrString, &len)) { *addrString = Util_SafeStrdup(unknownAddr); } else { *addrString = Util_SafeStrdup(tempAddrString); } #else if (aiIterator->ai_family == AF_INET && !inet_ntop(aiIterator->ai_family, &(((struct sockaddr_in *)aiIterator->ai_addr)->sin_addr), tempAddrString, INET6_ADDRSTRLEN)) { *addrString = Util_SafeStrdup(unknownAddr); } else if (aiIterator->ai_family == AF_INET6 && !inet_ntop(aiIterator->ai_family, &(((struct sockaddr_in6 *)aiIterator->ai_addr)->sin6_addr), tempAddrString, INET6_ADDRSTRLEN)) { *addrString = Util_SafeStrdup(unknownAddr); } else { *addrString = Str_SafeAsprintf(NULL, aiIterator->ai_family == AF_INET6 ? "[%s]:%u" : "%s:%u", tempAddrString, port); } #endif } memcpy(addr, aiIterator->ai_addr, aiIterator->ai_addrlen); *addrLen = aiIterator->ai_addrlen; break; } } bye: if (NULL != aiTop) { Posix_FreeAddrInfo(aiTop); } return getaddrinfoError; } /* *---------------------------------------------------------------------------- * * AsyncSocketCheckAndDispatchRecv -- * * Check if the recv buffer is full and dispatch the client callback. * * Handles the possibility that the client registers a new receive buffer * or closes the socket in their callback. * * Results: * TRUE if the socket was closed or the receive was cancelled, * FALSE if the caller should continue to try to receive data. * * Side effects: * Could fire recv completion or trigger socket destruction. * *---------------------------------------------------------------------------- */ Bool AsyncSocketCheckAndDispatchRecv(AsyncSocket *s, // IN int *result) // OUT { ASSERT(s); ASSERT(result); ASSERT(s->recvFn); ASSERT(s->recvBuf); ASSERT(s->recvLen > 0); ASSERT(s->recvPos <= s->recvLen); if (s->recvPos == s->recvLen || s->recvFireOnPartial) { void *recvBuf = s->recvBuf; ASOCKLOG(3, s, ("recv buffer full, calling recvFn\n")); /* * We do this dance in case the handler frees the buffer (so * that there's no possible window where there are dangling * references here. Obviously if the handler frees the buffer, * but them fails to register a new one, we'll put back the * dangling reference in the automatic reset case below, but * there's currently a limit to how far we go to shield clients * who use our API in a broken way. */ s->recvBuf = NULL; s->recvFn(recvBuf, s->recvPos, s, s->clientData); if (s->state == AsyncSocketClosed) { ASOCKLG0(s, ("owner closed connection in recv callback\n")); *result = ASOCKERR_CLOSED; return TRUE; } else if (s->recvFn == NULL && s->recvLen == 0) { /* * Further recv is cancelled from within the last recvFn, see * AsyncSocket_CancelRecv(). So exit from the loop. */ *result = ASOCKERR_SUCCESS; return TRUE; } else if (s->recvLen - s->recvPos == 0) { /* Automatically reset keeping the current handler */ s->recvPos = 0; s->recvBuf = recvBuf; } } return FALSE; } /* *---------------------------------------------------------------------------- * * AsyncSocketFillRecvBuffer -- * * Called when an asock has data ready to be read via the poll callback. * * Results: * ASOCKERR_SUCCESS if everything worked, * ASOCKERR_REMOTE_DISCONNECT if peer closed connection gracefully, * ASOCKERR_CLOSED if trying to read from a closed socket. * ASOCKERR_GENERIC for other errors. * * Side effects: * Reads data, could fire recv completion or trigger socket destruction. * *---------------------------------------------------------------------------- */ int AsyncSocketFillRecvBuffer(AsyncSocket *s) { int recvd; int needed; int sysErr = 0; int result; int pending = 0; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(AsyncSocketIsLocked(s)); ASSERT(s->state == AsyncSocketConnected); /* * When a socket has received all its desired content and FillRecvBuffer is * called again for the same socket, just return ASOCKERR_SUCCESS. The * reason we need this hack is that if a client which registered a receive * callback asynchronously later changes its mind to do it synchronously, * (e.g. aioMgr wait function), then FillRecvBuffer can be potentially be * called twice for the same receive event. */ needed = s->recvLen - s->recvPos; if (!s->recvBuf && needed == 0) { return ASOCKERR_SUCCESS; } ASSERT(needed > 0); AsyncSocketAddRef(s); /* * See comment in AsyncSocket_Recv */ s->inRecvLoop = TRUE; do { /* * Try to read the remaining bytes to complete the current recv request. */ if (s->passFd.expected) { int fd; recvd = SSL_RecvDataAndFd(s->sslSock, (uint8 *) s->recvBuf + s->recvPos, needed, &fd); if (fd != -1) { s->passFd.fd = fd; s->passFd.expected = FALSE; } } else { recvd = SSL_Read(s->sslSock, (uint8 *) s->recvBuf + s->recvPos, needed); } ASOCKLOG(3, s, ("need\t%d\trecv\t%d\tremain\t%d\n", needed, recvd, needed - recvd)); if (recvd > 0) { s->sslConnected = TRUE; s->recvPos += recvd; if (AsyncSocketCheckAndDispatchRecv(s, &result)) { goto exit; } } else if (recvd == 0) { ASOCKLG0(s, ("recv detected client closed connection\n")); /* * We treat this as an error so that the owner can detect closing * of connection by peer (via the error handler callback). */ result = ASOCKERR_REMOTE_DISCONNECT; goto exit; } else if ((sysErr = ASOCK_LASTERROR()) == ASOCK_EWOULDBLOCK) { ASOCKLOG(4, s, ("recv would block\n")); break; } else { ASOCKLG0(s, ("recv error %d: %s\n", sysErr, Err_Errno2String(sysErr))); s->genericErrno = sysErr; result = ASOCKERR_GENERIC; goto exit; } /* * At this point, s->recvFoo have been updated to point to the * next chained Recv buffer. By default we're done at this * point, but we may want to continue if the SSL socket has data * buffered in userspace already (SSL_Pending). */ needed = s->recvLen - s->recvPos; ASSERT(needed > 0); pending = SSL_Pending(s->sslSock); needed = MIN(needed, pending); } while (needed); /* * Reach this point only when previous SSL_Pending returns 0 or * error is ASOCK_EWOULDBLOCK */ ASSERT(pending == 0 || sysErr == ASOCK_EWOULDBLOCK); /* * Both a spurious wakeup and receiving any data even if it wasn't enough * to fire the callback are both success. We were ready and now * presumably we aren't ready anymore. */ result = ASOCKERR_SUCCESS; exit: s->inRecvLoop = FALSE; AsyncSocketRelease(s, FALSE); return result; } /* *---------------------------------------------------------------------------- * * AsyncSocketDispatchSentBuffer -- * * Pop off the head of the send buffer list and call its callback. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void AsyncSocketDispatchSentBuffer(AsyncSocket *s) { /* * We're done with the current buffer, so pop it off and nuke it. * We do the list management *first*, so that the list is in a * consistent state. */ SendBufList *head = s->sendBufList; SendBufList tmp = *head; s->sendBufList = head->next; if (s->sendBufList == NULL) { s->sendBufTail = &(s->sendBufList); } s->sendPos = 0; free(tmp.encodedBuf); free(head); if (tmp.sendFn) { /* * XXX * Firing the send completion could trigger the socket's * destruction (since the callback could turn around and call * AsyncSocket_Close()). Since we're in the middle of a loop on * the asock's queue, we avoid a use-after-free by deferring * the actual freeing of the asock structure. This is shady but * it works. --rrdharan */ tmp.sendFn(tmp.buf, tmp.len, s, tmp.clientData); } } /* *---------------------------------------------------------------------------- * * AsyncSocketWriteBuffers -- * * The meat of AsyncSocket's sending functionality. This function * actually writes to the wire assuming there's space in the buffers * for the socket. * * Results: * ASOCKERR_SUCESS if everything worked, else ASOCKERR_GENERIC. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int AsyncSocketWriteBuffers(AsyncSocket *s) { int result; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(AsyncSocketIsLocked(s)); if (s->sendBufList == NULL) { return ASOCKERR_SUCCESS; /* Vacuously true */ } if (s->state != AsyncSocketConnected) { ASOCKWARN(s, ("write buffers on a disconnected socket (%d)!\n", s->state)); return ASOCKERR_GENERIC; } AsyncSocketAddRef(s); while (s->sendBufList && s->state == AsyncSocketConnected) { SendBufList *head = s->sendBufList; int error = 0; int sent = 0; int left = head->len - s->sendPos; int sizeToSend = head->len; if (head->encodedBuf) { sent = SSL_Write(s->sslSock, (uint8 *) head->encodedBuf + s->sendPos, left); } else { sent = SSL_Write(s->sslSock, (uint8 *) head->buf + s->sendPos, left); } ASOCKLOG(3, s, ("left\t%d\tsent\t%d\tremain\t%d\n", left, sent, left - sent)); if (sent > 0) { s->sendBufFull = FALSE; s->sslConnected = TRUE; if ((s->sendPos += sent) == sizeToSend) { AsyncSocketDispatchSentBuffer(s); } } else if (sent == 0) { ASOCKLG0(s, ("socket write() should never return 0.\n")); NOT_REACHED(); } else if ((error = ASOCK_LASTERROR()) != ASOCK_EWOULDBLOCK) { ASOCKLG0(s, ("send error %d: %s\n", error, Err_Errno2String(error))); s->genericErrno = error; result = ASOCKERR_GENERIC; goto exit; } else { /* * Ran out of space to send. This is actually successful completion * (our contract obligates us to send as much data as space allows * and we fulfilled that). * * Indicate send buffer is full. */ s->sendBufFull = TRUE; break; } } result = ASOCKERR_SUCCESS; exit: AsyncSocketRelease(s, FALSE); return result; } /* *---------------------------------------------------------------------------- * * AsyncSocketAcceptInternal -- * * The meat of 'accept'. This function can be invoked either via a * poll callback or blocking. We call accept to get the new socket fd, * create a new asock, and call the newFn callback previously supplied * by the call to AsyncSocket_Listen. * * Results: * ASOCKERR_SUCCESS if everything works, else an error code. * ASOCKERR_GENERIC is returned to hide accept() system call's * nitty-gritty, it implies that we should try accept() again and not * report error to client. * ASOCKERR_ACCEPT to report accept operation's error to client. * * Side effects: * Accepts on listening fd, creates new asock. * *---------------------------------------------------------------------------- */ static int AsyncSocketAcceptInternal(AsyncSocket *s) { AsyncSocket *newsock; int sysErr; int fd; struct sockaddr_storage remoteAddr; socklen_t remoteAddrLen = sizeof remoteAddr; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(AsyncSocketIsLocked(s)); ASSERT(s->state == AsyncSocketListening); if ((fd = accept(s->fd, (struct sockaddr *)&remoteAddr, &remoteAddrLen)) == -1) { sysErr = ASOCK_LASTERROR(); s->genericErrno = sysErr; if (sysErr == ASOCK_EWOULDBLOCK) { ASOCKWARN(s, ("spurious accept notification\n")); return ASOCKERR_GENERIC; #ifndef _WIN32 /* * This sucks. Linux accept() can return ECONNABORTED for connections * that closed before we got to actually call accept(), but Windows * just ignores this case. So we have to special case for Linux here. * We return ASOCKERR_GENERIC here because we still want to continue * accepting new connections. */ } else if (sysErr == ECONNABORTED) { ASOCKLG0(s, ("accept: new connection was aborted\n")); return ASOCKERR_GENERIC; #endif } else { ASOCKWARN(s, ("accept failed on fd %d, error %d: %s\n", s->fd, sysErr, Err_Errno2String(sysErr))); return ASOCKERR_ACCEPT; } } if (remoteAddr.ss_family == AF_INET6 && AsyncSocketOSVersionSupportsV4Mapped()) { struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&remoteAddr; /* * Remote address should not be a V4MAPPED address. Validate for the rare * case that IPV6_V6ONLY is not defined and V4MAPPED is enabled by * default when setting up socket listener. */ if (IN6_IS_ADDR_V4MAPPED(&(addr6->sin6_addr))) { ASOCKWARN(s, ("accept rejected on fd %d due to a IPv4-mapped IPv6 " "remote connection address.\n", s->fd)); SSLGeneric_close(fd); return ASOCKERR_ACCEPT; } } newsock = AsyncSocket_AttachToFd(fd, &s->pollParams, NULL); if (!newsock) { SSLGeneric_close(fd); return ASOCKERR_ACCEPT; } newsock->remoteAddr = remoteAddr; newsock->remoteAddrLen = remoteAddrLen; newsock->state = AsyncSocketConnected; newsock->vt = s->vt; ASSERT(s->vt); ASSERT(s->vt->dispatchConnect); s->vt->dispatchConnect(s, newsock); return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocketConnectInternal -- * * The meat of connect. This function is invoked either via a poll * callback or the blocking API and verifies that connect() succeeded * or reports is failure. On success we call the registered 'new * connection' function. * * Results: * ASOCKERR_SUCCESS if it all worked out or ASOCKERR_GENERIC. * * Side effects: * Creates new asock, fires newFn callback. * *---------------------------------------------------------------------------- */ static int AsyncSocketConnectInternal(AsyncSocket *s) { int optval = 0, optlen = sizeof optval, sysErr; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(AsyncSocketIsLocked(s)); ASSERT(s->state == AsyncSocketConnecting); /* Remove when bug 859728 is fixed */ if (vmx86_server && s->remoteAddr.ss_family == AF_UNIX) { goto done; } if (getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &optval, (void *)&optlen) != 0) { sysErr = ASOCK_LASTERROR(); s->genericErrno = sysErr; Warning(ASOCKPREFIX "getsockopt for connect on fd %d failed with " "error %d : %s\n", s->fd, sysErr, Err_Errno2String(sysErr)); return ASOCKERR_GENERIC; } if (optval != 0) { s->genericErrno = optval; ASOCKLOG(1, s, ("connection SO_ERROR: %s\n", Err_Errno2String(optval))); return ASOCKERR_GENERIC; } s->localAddrLen = sizeof s->localAddr; if (getsockname(s->fd, (struct sockaddr *)&s->localAddr, &s->localAddrLen) != 0) { sysErr = ASOCK_LASTERROR(); s->genericErrno = sysErr; Warning(ASOCKPREFIX "getsockname for connect on fd %d failed with " "error %d: %s\n", s->fd, sysErr, Err_Errno2String(sysErr)); return ASOCKERR_GENERIC; } done: s->state = AsyncSocketConnected; s->connectFn(s, s->clientData); return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetGenericErrno -- * * Used when an ASOCKERR_GENERIC is returned due to a system error. * The errno that was returned by the system is stored in the asock * struct and returned to the user in this function. * * XXX: This function is not thread-safe. The errno should be returned * in a parameter to any function that can return ASOCKERR_GENERIC. * * Results: * int error code * * Side effects: * None * *---------------------------------------------------------------------------- */ int AsyncSocket_GetGenericErrno(AsyncSocket *s) // IN: { ASSERT(s); return s->genericErrno; } /* *---------------------------------------------------------------------------- * * AsyncSocket_WaitForConnection -- * * Spins a socket currently listening or connecting until the * connection completes or the allowed time elapses. * * Results: * ASOCKERR_SUCCESS if it worked, ASOCKERR_GENERIC on failures, and * ASOCKERR_TIMEOUT if nothing happened in the allotted time. * * Side effects: * None. *---------------------------------------------------------------------------- */ int AsyncSocket_WaitForConnection(AsyncSocket *s, // IN: int timeoutMS) // IN: { Bool read = FALSE; int error; VmTimeType now, done; Bool removed = FALSE; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); AsyncSocketLock(s); if (s->state == AsyncSocketConnected) { error = ASOCKERR_SUCCESS; AsyncSocketUnlock(s); goto out; } if (s->state != AsyncSocketListening && s->state != AsyncSocketConnecting) { error = ASOCKERR_GENERIC; AsyncSocketUnlock(s); goto out; } read = s->state == AsyncSocketListening; /* * For listening sockets, unregister AsyncSocketAcceptCallback before * starting polling and re-register before returning. * * ConnectCallback() is either registered as a device or rtime callback * depending on the prior return value of connect(). So we try to remove it * from both. */ if (read) { if (s->fd == -1) { if (s->listenAsock4) { AsyncSocketLock(s->listenAsock4); AsyncSocketCancelListenCbSocket(s->listenAsock4); AsyncSocketUnlock(s->listenAsock4); } if (s->listenAsock6) { AsyncSocketLock(s->listenAsock6); AsyncSocketCancelListenCbSocket(s->listenAsock6); AsyncSocketUnlock(s->listenAsock6); } } else { AsyncSocketCancelListenCbSocket(s); } removed = TRUE; } else { removed = AsyncSocketPollRemove(s, TRUE, POLL_FLAG_WRITE, AsyncSocketConnectCallback) || AsyncSocketPollRemove(s, FALSE, 0, AsyncSocketConnectCallback); ASSERT(removed); } AsyncSocketUnlock(s); now = Hostinfo_SystemTimerUS() / 1000; done = now + timeoutMS; do { AsyncSocket *asock = NULL; if ((error = AsyncSocketPoll(s, read, done - now, &asock)) != ASOCKERR_SUCCESS) { goto out; } AsyncSocketLock(asock); now = Hostinfo_SystemTimerUS() / 1000; if (read) { if (AsyncSocketAcceptInternal(asock) != ASOCKERR_SUCCESS) { ASOCKLG0(s, ("wait for connection: accept failed\n")); /* * Just fall through, we'll loop and try again as long as we still * have time remaining. */ } else { error = ASOCKERR_SUCCESS; AsyncSocketUnlock(asock); goto out; } } else { error = AsyncSocketConnectInternal(asock); AsyncSocketUnlock(asock); goto out; } AsyncSocketUnlock(asock); } while ((now < done && timeoutMS > 0) || (timeoutMS < 0)); error = ASOCKERR_TIMEOUT; out: if (read && removed) { if (s->fd == -1) { if (s->listenAsock4 && s->listenAsock4->state != AsyncSocketClosed) { AsyncSocketLock(s->listenAsock4); if (!AsyncSocketAddListenCbSocket(s->listenAsock4)) { error = ASOCKERR_POLL; } AsyncSocketUnlock(s->listenAsock4); } if (s->listenAsock6 && s->listenAsock6->state != AsyncSocketClosed) { AsyncSocketLock(s->listenAsock6); if (!AsyncSocketAddListenCbSocket(s->listenAsock6)) { error = ASOCKERR_POLL; } AsyncSocketUnlock(s->listenAsock6); } } else if (s->state != AsyncSocketClosed) { AsyncSocketLock(s); if (!AsyncSocketAddListenCbSocket(s)) { error = ASOCKERR_POLL; } AsyncSocketUnlock(s); } } return error; } /* *---------------------------------------------------------------------------- * * AsyncSocket_DoOneMsg -- * * Spins a socket until the specified amount of time has elapsed or * data has arrived / been sent. * * Results: * ASOCKERR_SUCCESS if it worked, ASOCKERR_GENERIC on system call * failures * ASOCKERR_TIMEOUT if nothing happened in the allotted time. * * Side effects: * None. *---------------------------------------------------------------------------- */ int AsyncSocket_DoOneMsg(AsyncSocket *s, Bool read, int timeoutMS) { int retVal; AsyncSocket *asock = NULL; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (!s) { Warning(ASOCKPREFIX "DoOneMsg called with invalid paramters.\n"); return ASOCKERR_INVAL; } if (read) { /* * Bug 158571: There could other threads polling on the same asyncsocket. * If two threads land up polling on the same socket at the same time, * the first thread to be scheduled reads the data from the socket, * while the second one blocks infinitely. This hangs the VM. To prevent * this, we temporarily remove the poll callback and then reinstate it * after reading the data. */ AsyncSocketLock(s); ASSERT(s->state == AsyncSocketConnected); ASSERT(s->recvCb); /* We are supposed to call someone... */ AsyncSocketAddRef(s); s->vt->cancelRecvCb(s); s->recvCb = TRUE; /* We need to know if the callback cancel recv. */ s->inBlockingRecv++; AsyncSocketUnlock(s); /* We may sleep in poll. */ retVal = AsyncSocketPoll(s, read, timeoutMS, &asock); AsyncSocketLock(s); s->inBlockingRecv--; if (retVal != ASOCKERR_SUCCESS) { if (retVal == ASOCKERR_GENERIC) { ASOCKWARN(s, ("%s: failed to poll on the socket during read.\n", __FUNCTION__)); } } else { ASSERT(asock == s); retVal = AsyncSocketFillRecvBuffer(s); } /* * If socket got closed in AsyncSocketFillRecvBuffer, we cannot add poll * callback - AsyncSocket_Close() would remove it if we would not remove * it above. */ if (s->state != AsyncSocketClosed && s->recvCb) { ASSERT(s->refCount > 1); /* We should not be last user of socket. */ ASSERT(s->state == AsyncSocketConnected); /* * If AsyncSocketPoll or AsyncSocketFillRecvBuffer fails, do not * add the recv callback as it may never fire. */ s->recvCb = FALSE; /* For re-registering the poll callback. */ if (retVal == ASOCKERR_SUCCESS || retVal == ASOCKERR_TIMEOUT) { retVal = s->vt->recv(s, (uint8 *)s->recvBuf + s->recvPos, s->recvLen - s->recvPos); } if (retVal != ASOCKERR_SUCCESS) { s->recvBuf = NULL; } } /* This may destroy socket s if it is in AsyncSocketClosed state now. */ AsyncSocketRelease(s, TRUE); } else { if ((retVal = AsyncSocketPoll(s, read, timeoutMS, &asock)) != ASOCKERR_SUCCESS) { if (retVal == ASOCKERR_GENERIC) { ASOCKWARN(s, ("%s: failed to poll on the socket during write.\n", __FUNCTION__)); } } else { ASSERT(asock == s); AsyncSocketLock(s); retVal = AsyncSocketWriteBuffers(s); AsyncSocketUnlock(s); } } return retVal; } /* *---------------------------------------------------------------------------- * * AsyncSocket_Flush -- * * Try to send any pending out buffers until we run out of buffers, or * the timeout expires. * * Results: * ASOCKERR_SUCCESS if it worked, ASOCKERR_GENERIC on system call * failures, and ASOCKERR_TIMEOUT if we couldn't send enough data * before the timeout expired. * * Side effects: * None. *---------------------------------------------------------------------------- */ int AsyncSocket_Flush(AsyncSocket *s, int timeoutMS) { VmTimeType now, done; int retVal; ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (s == NULL) { Warning(ASOCKPREFIX "Flush called with invalid arguments!\n"); return ASOCKERR_INVAL; } AsyncSocketLock(s); AsyncSocketAddRef(s); if (s->state != AsyncSocketConnected) { ASOCKWARN(s, ("flush called but state is not connected!\n")); retVal = ASOCKERR_INVAL; goto outHaveLock; } now = Hostinfo_SystemTimerUS() / 1000; done = now + timeoutMS; while (s->sendBufList) { AsyncSocket *asock = NULL; AsyncSocketUnlock(s); /* We may sleep in poll. */ retVal = AsyncSocketPoll(s, FALSE, done - now, &asock); AsyncSocketLock(s); if (retVal != ASOCKERR_SUCCESS) { ASOCKWARN(s, ("flush failed\n")); goto outHaveLock; } ASSERT(asock == s); if ((retVal = AsyncSocketWriteBuffers(s)) != ASOCKERR_SUCCESS) { goto outHaveLock; } ASSERT(s->state == AsyncSocketConnected); /* Setting timeoutMS to -1 means never timeout. */ if (timeoutMS >= 0) { now = Hostinfo_SystemTimerUS() / 1000; /* Don't timeout if you've sent everything */ if (now > done && s->sendBufList) { ASOCKWARN(s, ("flush timed out\n")); retVal = ASOCKERR_TIMEOUT; goto outHaveLock; } } } retVal = ASOCKERR_SUCCESS; outHaveLock: AsyncSocketRelease(s, TRUE); return retVal; } /* *---------------------------------------------------------------------------- * * AsyncSocket_SetErrorFn -- * * Sets the error handling function for the asock. The error function * is invoked automatically on I/O errors. Passing NULL as the error * function restores the default behavior, which is to just destroy the * AsyncSocket on any errors. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_INVAL. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocket_SetErrorFn(AsyncSocket *asock, // IN/OUT AsyncSocketErrorFn errorFn, // IN void *clientData) // IN { if (!asock) { Warning(ASOCKPREFIX "%s called with invalid arguments!\n", __FUNCTION__); return ASOCKERR_INVAL; } AsyncSocketLock(asock); asock->errorFn = errorFn; asock->errorClientData = clientData; AsyncSocketUnlock(asock); return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocketCancelListenCbSocket -- * * Socket specific code for canceling callbacks for a listening socket. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void AsyncSocketCancelListenCbSocket(AsyncSocket *asock) // IN: { Bool removed; ASSERT(AsyncSocketIsLocked(asock)); removed = AsyncSocketPollRemove(asock, TRUE, POLL_FLAG_READ | POLL_FLAG_PERIODIC, AsyncSocketAcceptCallback); ASSERT(removed); } /* *---------------------------------------------------------------------------- * * AsyncSocketAddListenCbSocket -- * * Socket specific code for adding callbacks for a listening socket. * * Results: * TRUE if Poll callback successfully added. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool AsyncSocketAddListenCbSocket(AsyncSocket *asock) // IN: { VMwareStatus pollStatus; ASSERT(AsyncSocketIsLocked(asock)); pollStatus = AsyncSocketPollAdd(asock, TRUE, POLL_FLAG_READ | POLL_FLAG_PERIODIC, AsyncSocketAcceptCallback); if (pollStatus != VMWARE_STATUS_SUCCESS) { ASOCKWARN(asock, ("failed to install listen accept callback!\n")); } return pollStatus == VMWARE_STATUS_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocketCancelRecvCbSocket -- * * Socket specific code for canceling callbacks when a receive * request is being canceled. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void AsyncSocketCancelRecvCbSocket(AsyncSocket *asock) // IN: { ASSERT(AsyncSocketIsLocked(asock)); if (asock->recvCbTimer) { AsyncSocketPollRemove(asock, FALSE, 0, asock->vt->recvCallback); asock->recvCbTimer = FALSE; } if (asock->recvCb) { Bool removed; ASOCKLOG(1, asock, ("Removing poll recv callback while cancelling recv.\n")); removed = AsyncSocketPollRemove(asock, TRUE, POLL_FLAG_READ | POLL_FLAG_PERIODIC, asock->vt->recvCallback); VERIFY(removed || asock->pollParams.iPoll); asock->recvCb = FALSE; } } /* *---------------------------------------------------------------------------- * * AsyncSocketCancelCbForCloseSocket -- * * Socket specific code for canceling callbacks when a socket is * being closed. * * Results: * None. * * Side effects: * Unregisters send/recv Poll callbacks, and fires the send * triggers for any remaining output buffers. May also change * the socket state. * *---------------------------------------------------------------------------- */ void AsyncSocketCancelCbForCloseSocket(AsyncSocket *asock) // IN: { Bool removed; /* * Remove the read and write poll callbacks. * * We could fire the current recv completion callback here, but in * practice clients won't want to know about partial reads since it just * complicates the common case (i.e. every read callback would need to * check the len parameter). * * For writes, however, we *do* fire all of the callbacks. The argument * here is that the common case for writes is "fire and forget", e.g. * send this buffer and free it. Firing the triggers at close time * simplifies client code, since the clients aren't forced to keep track * of send buffers themselves. Clients can figure out how much data was * actually transmitted (if they care) by checking the len parameter * passed to the send callback. * * A modification suggested by Jeremy is to pass a list of unsent * buffers and their completion callbacks to the error handler if one is * registered, and only fire the callbacks here if there was no error * handler invoked. */ ASSERT(!asock->recvBuf || asock->recvCb); if (asock->recvCbTimer) { AsyncSocketPollRemove(asock, FALSE, 0, asock->vt->recvCallback); asock->recvCbTimer = FALSE; } if (asock->recvCb) { ASOCKLOG(1, asock, ("recvCb is non-NULL, removing recv callback\n")); removed = AsyncSocketPollRemove(asock, TRUE, POLL_FLAG_READ | POLL_FLAG_PERIODIC, asock->vt->recvCallback); /* Callback might be temporarily removed in AsyncSocket_DoOneMsg. */ ASSERT_NOT_TESTED(removed || asock->pollParams.iPoll); asock->recvCb = FALSE; asock->recvBuf = NULL; } if (asock->sendCb) { ASOCKLOG(1, asock, ("sendBufList is non-NULL, removing send callback\n")); /* * The send callback could be either a device or RTime callback, so * we check the latter if it wasn't the former. */ if (asock->sendCbTimer) { removed = AsyncSocketPollRemove(asock, FALSE, 0, asock->vt->sendCallback); } else { removed = AsyncSocketPollRemove(asock, TRUE, POLL_FLAG_WRITE, asock->vt->sendCallback); } ASSERT(removed || asock->pollParams.iPoll); asock->sendCb = FALSE; asock->sendCbTimer = FALSE; } } /* *---------------------------------------------------------------------------- * * AsyncSocketCancelCbForCloseInt -- * * Cancel future asynchronous send and recv by unregistering * their Poll callbacks, and change the socket state to * AsyncSocketCBCancelled if the socket state is AsyncSocketConnected. * * The function can be called in a send/recv error handler before * actually closing the socket in a separate thread, to prevent other * code calling AsyncSocket_Send/Recv from re-registering the * callbacks again. The next operation should be just AsyncSocket_Close(). * This helps to avoid unnecessary send/recv callbacks before the * socket is closed. * * Results: * None. * * Side effects: * Unregisters send/recv Poll callbacks, and fires the send * triggers for any remaining output buffers. May also change * the socket state. * *---------------------------------------------------------------------------- */ static void AsyncSocketCancelCbForCloseInt(AsyncSocket *asock) // IN: { ASSERT(AsyncSocketIsLocked(asock)); if (asock->state == AsyncSocketConnected) { asock->state = AsyncSocketCBCancelled; } ASSERT(asock->vt); ASSERT(asock->vt->cancelCbForClose); asock->vt->cancelCbForClose(asock); AsyncSocketAddRef(asock); while (asock->sendBufList) { /* * Pop each remaining buffer and fire its completion callback. */ SendBufList *cur = asock->sendBufList; int pos = asock->sendPos; /* * Free the encoded data if it exists. */ free(cur->encodedBuf); asock->sendBufList = asock->sendBufList->next; asock->sendPos = 0; if (cur->sendFn) { cur->sendFn(cur->buf, pos, asock, cur->clientData); } free(cur); } AsyncSocketRelease(asock, FALSE); } /* *---------------------------------------------------------------------------- * * AsyncSocket_CancelCbForClose -- * * This is the external version of AsyncSocketCancelCbForCloseInt(). It * takes care of acquiring any necessary lock before calling the internal * function. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void AsyncSocket_CancelCbForClose(AsyncSocket *asock) // IN: { AsyncSocketLock(asock); AsyncSocketCancelCbForCloseInt(asock); AsyncSocketUnlock(asock); } /* *---------------------------------------------------------------------------- * * AsyncSocketCloseSocket -- * * AsyncSocket destructor for SSL sockets. * * Results: * None. * * Side effects: * Closes the socket fd. * *---------------------------------------------------------------------------- */ void AsyncSocketCloseSocket(AsyncSocket *asock) // IN { SSL_Shutdown(asock->sslSock); if (asock->passFd.fd != -1) { SSLGeneric_close(asock->passFd.fd); } } /* *---------------------------------------------------------------------------- * * AsyncSocketCancelCbForConnectingCloseSocket -- * * Cancels outstanding connect requests for a socket that is going * away. * * Results: * TRUE on callback removed. FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------------- */ Bool AsyncSocketCancelCbForConnectingCloseSocket(AsyncSocket *asock) // IN { return AsyncSocketPollRemove(asock, TRUE, POLL_FLAG_WRITE, AsyncSocketConnectCallback) || AsyncSocketPollRemove(asock, FALSE, 0, AsyncSocketConnectCallback); } /* *---------------------------------------------------------------------------- * * AsyncSocket_Close -- * * AsyncSocket destructor. The destructor should be safe to call at any * time. It's invoked automatically for I/O errors on slots that have no * error handler set, and should be called manually by the error handler * as necessary. It could also be called as part of the normal program * flow. * * Results: * ASOCKERR_*. * * Side effects: * Closes the socket fd, unregisters all Poll callbacks, and fires the * send triggers for any remaining output buffers. * *---------------------------------------------------------------------------- */ int AsyncSocket_Close(AsyncSocket *asock) { Bool isListener = TRUE; if (!asock) { return ASOCKERR_INVAL; } AsyncSocketLock(asock); if (asock->state == AsyncSocketClosed) { Warning("%s() called on already closed asock!\n", __FUNCTION__); AsyncSocketUnlock(asock); return ASOCKERR_CLOSED; } if (asock->listenAsock4 || asock->listenAsock6) { ASSERT(asock->refCount == 1); if (asock->listenAsock4) { AsyncSocket_Close(asock->listenAsock4); } if (asock->listenAsock6) { AsyncSocket_Close(asock->listenAsock6); } } else { Bool removed; AsyncSocketState oldState; isListener = FALSE; /* * Set the new state to closed, and then check the old state and do the * right thing accordingly */ ASOCKLOG(1, asock, ("closing socket\n")); oldState = asock->state; asock->state = AsyncSocketClosed; ASSERT(asock->vt); switch(oldState) { case AsyncSocketListening: ASOCKLOG(1, asock, ("old state was listening, removing accept " "callback\n")); ASSERT(asock->vt->cancelListenCb); asock->vt->cancelListenCb(asock); break; case AsyncSocketConnecting: ASOCKLOG(1, asock, ("old state was connecting, removing connect " "callback\n")); ASSERT(asock->vt->cancelCbForConnectingClose); removed = asock->vt->cancelCbForConnectingClose(asock); if (!removed) { ASOCKLOG(1, asock, ("connect callback is not present in the poll " "list.\n")); } break; case AsyncSocketConnected: ASOCKLOG(1, asock, ("old state was connected\n")); AsyncSocketCancelCbForCloseInt(asock); break; case AsyncSocketCBCancelled: ASOCKLOG(1, asock, ("old state was CB-cancelled\n")); break; default: NOT_REACHED(); } ASSERT(asock->vt->close); asock->vt->close(asock); } AsyncSocketRelease(asock, TRUE); return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetState -- * * Returns the state of the provided asock or ASOCKERR_INVAL. Note that * unless this is called from a callback function, the state should be * treated as transient (except the state AsyncSocketClosed). * * Results: * AsyncSocketState enum. * * Side effects: * None. * *---------------------------------------------------------------------------- */ AsyncSocketState AsyncSocket_GetState(AsyncSocket *asock) { return (asock ? asock->state : ASOCKERR_INVAL); } /* *---------------------------------------------------------------------------- * * AsyncSocket_IsSendBufferFull -- * * Indicate if socket send buffer is full. Note that unless this is * called from a callback function, the return value should be treated * as transient. * * Results: * 0: send space probably available, * 1: send has reached maximum, * ASOCKERR_GENERIC: null socket. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocket_IsSendBufferFull(AsyncSocket *asock) { return (asock ? asock->sendBufFull : ASOCKERR_GENERIC); } /* *---------------------------------------------------------------------------- * * AsyncSocket_GetID -- * * Returns a unique identifier for the asock. * * Results: * Integer id or ASOCKERR_INVAL. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocket_GetID(AsyncSocket *asock) { return (asock ? asock->id : ASOCKERR_INVAL); } /* *---------------------------------------------------------------------------- * * AsyncSocketSendInternal -- * * Internal send method for 'regular' socket connections, allocates & prepares * a buffer and enqueues it. * * Results: * ASOCKERR_SUCCESS if there are no errors. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int AsyncSocketSendInternal(AsyncSocket *asock, // IN void *buf, // IN int len, // IN AsyncSocketSendFn sendFn, // IN void *clientData, // IN Bool *bufferListWasEmpty) // IN { SendBufList *newBuf; ASSERT(bufferListWasEmpty); /* * Allocate and initialize new send buffer entry */ newBuf = Util_SafeCalloc(1, sizeof *newBuf); newBuf->buf = buf; newBuf->len = len; newBuf->sendFn = sendFn; newBuf->clientData = clientData; /* * Append new send buffer to the tail of list. */ *asock->sendBufTail = newBuf; asock->sendBufTail = &(newBuf->next); if (asock->sendBufList == newBuf) { *bufferListWasEmpty = TRUE; } return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocketDispatchConnect -- * * Simple dispatch to call the connect callback for the socket pair. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void AsyncSocketDispatchConnect(AsyncSocket *asock, AsyncSocket *newsock) { asock->connectFn(newsock, asock->clientData); } /* *---------------------------------------------------------------------------- * * AsyncSocketHasDataPendingSocket -- * * Determine if the SSL socket has any pending/unread data. * * Results: * TRUE if this socket has pending data. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool AsyncSocketHasDataPendingSocket(AsyncSocket *asock) // IN { return SSL_Pending(asock->sslSock); } /* *---------------------------------------------------------------------------- * * AsyncSocketHasDataPending -- * * Determine if the SSL or WebSocket has any pending/unread data. * * Results: * TRUE if this socket has pending data. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool AsyncSocketHasDataPending(AsyncSocket *asock) // IN: { ASSERT(asock->vt); ASSERT(asock->vt->hasDataPending); return asock->vt->hasDataPending(asock); } /* *---------------------------------------------------------------------------- * * AsyncSocketMakeNonBlocking -- * * Make the specified socket non-blocking if it isn't already. * * Results: * ASOCKERR_SUCCESS if the operation succeeded, ASOCKERR_GENERIC otherwise. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static int AsyncSocketMakeNonBlocking(int fd) { #ifdef _WIN32 int retval; u_long argp = 1; /* non-zero => enable non-blocking mode */ retval = ioctlsocket(fd, FIONBIO, &argp); if (retval != 0) { ASSERT(retval == SOCKET_ERROR); return ASOCKERR_GENERIC; } #elif defined(__APPLE__) int argp = 1; if (ioctl(fd, FIONBIO, &argp) < 0) { return ASOCKERR_GENERIC; } #else int flags; if ((flags = fcntl(fd, F_GETFL)) < 0) { return ASOCKERR_GENERIC; } if (!(flags & O_NONBLOCK) && (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0)) { return ASOCKERR_GENERIC; } #endif return ASOCKERR_SUCCESS; } /* *---------------------------------------------------------------------------- * * AsyncSocketHandleError -- * * Internal error handling helper. Changes the socket's state to error, * and calls the registered error handler or closes the socket. * * Results: * None. * * Side effects: * Lots. * *---------------------------------------------------------------------------- */ void AsyncSocketHandleError(AsyncSocket *asock, int asockErr) { ASSERT(asock); if (asock->errorFn) { ASOCKLOG(3, asock, ("firing error callback\n")); asock->errorFn(asockErr, asock, asock->errorClientData); } else { ASOCKLOG(3, asock, ("no error callback, closing socket\n")); AsyncSocket_Close(asock); } } /* *---------------------------------------------------------------------------- * * AsyncSocketAcceptCallback -- * * Poll callback for listening fd waiting to complete an accept * operation. We call accept to get the new socket fd, create a new * asock, and call the newFn callback previously supplied by the call to * AsyncSocket_Listen. * * Results: * None. * * Side effects: * Accepts on listening fd, creates new asock. * *---------------------------------------------------------------------------- */ static void AsyncSocketAcceptCallback(void *clientData) { AsyncSocket *asock = clientData; int retval; ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(asock->pollParams.iPoll == NULL); ASSERT(AsyncSocketIsLocked(asock)); AsyncSocketAddRef(asock); retval = AsyncSocketAcceptInternal(asock); /* * See comment for return value of AsyncSocketAcceptInternal(). */ if (retval == ASOCKERR_ACCEPT) { AsyncSocketHandleError(asock, retval); } AsyncSocketRelease(asock, FALSE); } /* *---------------------------------------------------------------------------- * * AsyncSocketConnectCallback -- * * Poll callback for connecting fd. Calls through to * AsyncSocketConnectInternal to do the real work. * * Results: * None. * * Side effects: * Creates new asock, fires newFn callback. * *---------------------------------------------------------------------------- */ static void AsyncSocketConnectCallback(void *clientData) { AsyncSocket *asock = clientData; int retval; ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(asock->pollParams.iPoll == NULL); ASSERT(AsyncSocketIsLocked(asock)); AsyncSocketAddRef(asock); retval = AsyncSocketConnectInternal(asock); if (retval != ASOCKERR_SUCCESS) { ASSERT(retval == ASOCKERR_GENERIC); /* Only one we're expecting */ AsyncSocketHandleError(asock, retval); } AsyncSocketRelease(asock, FALSE); } /* *---------------------------------------------------------------------------- * * AsyncSocketRecvCallback -- * * Poll callback for input waiting on the socket. We try to pull off the * remaining data requested by the current receive function. * * Results: * None. * * Side effects: * Reads data, could fire recv completion or trigger socket destruction. * *---------------------------------------------------------------------------- */ void AsyncSocketRecvCallback(void *clientData) { AsyncSocket *asock = clientData; int error; ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(AsyncSocketIsLocked(asock)); AsyncSocketAddRef(asock); error = AsyncSocketFillRecvBuffer(asock); if (error == ASOCKERR_GENERIC || error == ASOCKERR_REMOTE_DISCONNECT) { AsyncSocketHandleError(asock, error); } AsyncSocketRelease(asock, FALSE); } /* *---------------------------------------------------------------------------- * * AsyncSocketIPollRecvCallback -- * * Poll callback for input waiting on the socket. IVmdbPoll does not * handle callback locks, so this function first locks the asyncsocket * and verify that the recv callback has not been cancelled before * calling AsyncSocketFillRecvBuffer to do the real work. * * Results: * None. * * Side effects: * Reads data, could fire recv completion or trigger socket destruction. * *---------------------------------------------------------------------------- */ static void AsyncSocketIPollRecvCallback(void *clientData) // IN: { #ifdef VMX86_TOOLS NOT_IMPLEMENTED(); #else AsyncSocket *asock = clientData; MXUserRecLock *lock; ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(asock->pollParams.lock == NULL || !MXUser_IsCurThreadHoldingRecLock(asock->pollParams.lock)); AsyncSocketLock(asock); if (asock->recvCbTimer) { /* IVmdbPoll only has periodic callbacks. */ AsyncSocketIPollRemove(asock, FALSE, 0, asock->vt->recvCallback); asock->recvCbTimer = FALSE; } asock->inIPollCb |= IN_IPOLL_RECV; lock = asock->pollParams.lock; if (asock->recvCb && asock->inBlockingRecv == 0) { /* * There is no need to take a reference here -- the fact that this * callback is running means AsyncsocketIPollRemove would not release a * reference if it is called. */ int error = AsyncSocketFillRecvBuffer(asock); if (error == ASOCKERR_GENERIC || error == ASOCKERR_REMOTE_DISCONNECT) { AsyncSocketHandleError(asock, error); } } asock->inIPollCb &= ~IN_IPOLL_RECV; if (asock->recvCb) { AsyncSocketUnlock(asock); } else { /* * Callback has been unregistered. Per above, we need to release the * reference explicitly. */ AsyncSocketRelease(asock, TRUE); if (lock != NULL) { MXUser_DecRefRecLock(lock); } } #endif } /* *---------------------------------------------------------------------------- * * AsyncSocketSendCallback -- * * Poll callback for output socket buffer space available (socket is * writable). We iterate over all the remaining buffers in our queue, * writing as much as we can until we fill the socket buffer again. If we * don't finish, we register ourselves as a device write callback. * * Results: * None. * * Side effects: * Writes data, could trigger write completion or socket destruction. * *---------------------------------------------------------------------------- */ void AsyncSocketSendCallback(void *clientData) { AsyncSocket *s = clientData; int retval; ASSERT(s); ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(AsyncSocketIsLocked(s)); AsyncSocketAddRef(s); s->sendCb = FALSE; /* AsyncSocketSendCallback is never periodic */ s->sendCbTimer = FALSE; retval = AsyncSocketWriteBuffers(s); if (retval != ASOCKERR_SUCCESS) { AsyncSocketHandleError(s, retval); } else if (s->sendBufList && !s->sendCb) { VMwareStatus pollStatus; /* * We didn't finish, so we need to reschedule the Poll callback (the * write callback is *not* periodic). */ #ifdef _WIN32 /* * If any data has been sent out or read in from the sslSock, * SSL has finished the handshaking. Otherwise, * we have to schedule a realtime callback for write. See bug 37147 */ if (!s->sslConnected) { pollStatus = AsyncSocketPollAdd(s, FALSE, 0, s->vt->sendCallback, 100000); VERIFY(pollStatus == VMWARE_STATUS_SUCCESS); s->sendCbTimer = TRUE; } else #endif { pollStatus = AsyncSocketPollAdd(s, TRUE, POLL_FLAG_WRITE, s->vt->sendCallback); VERIFY(pollStatus == VMWARE_STATUS_SUCCESS); } s->sendCb = TRUE; } AsyncSocketRelease(s, FALSE); } /* *---------------------------------------------------------------------------- * * AsyncSocketIPollSendCallback -- * * IVmdbPoll callback for output socket buffer space available. IVmdbPoll * does not handle callback locks, so this function first locks the * asyncsocket and verify that the send callback has not been cancelled. * IVmdbPoll only has periodic callbacks, so this function unregisters * itself before calling AsyncSocketSendCallback to do the real work. * * Results: * None. * * Side effects: * Writes data, could trigger write completion or socket destruction. * *---------------------------------------------------------------------------- */ static void AsyncSocketIPollSendCallback(void *clientData) // IN: { #ifdef VMX86_TOOLS NOT_IMPLEMENTED(); #else AsyncSocket *s = clientData; MXUserRecLock *lock; ASSERT(s); ASSERT(s->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); AsyncSocketLock(s); s->inIPollCb |= IN_IPOLL_SEND; lock = s->pollParams.lock; if (s->sendCb) { /* * Unregister this callback as we want the non-periodic behavior. There * is no need to take a reference here -- the fact that this callback is * running means AsyncsocketIPollRemove would not release a reference. * We would release that reference at the end. */ if (s->sendCbTimer) { AsyncSocketIPollRemove(s, FALSE, 0, AsyncSocketIPollSendCallback); } else { AsyncSocketIPollRemove(s, TRUE, POLL_FLAG_WRITE, AsyncSocketIPollSendCallback); } AsyncSocketSendCallback(s); } s->inIPollCb &= ~IN_IPOLL_SEND; AsyncSocketRelease(s, TRUE); if (lock != NULL) { MXUser_DecRefRecLock(lock); } #endif } /* *----------------------------------------------------------------------------- * * AsyncSocketAddRef -- * * Increments reference count on AsyncSocket struct. * * Results: * New reference count. * * Side effects: * None. * *----------------------------------------------------------------------------- */ int AsyncSocketAddRef(AsyncSocket *s) { ASSERT(s && s->refCount > 0); ASOCKLOG(1, s, ("%s (count now %d)\n", __FUNCTION__, s->refCount + 1)); return ++s->refCount; } /* *----------------------------------------------------------------------------- * * AsyncSocketRelease -- * * Decrements reference count on AsyncSocket struct, freeing it when it * reaches 0. If "unlock" is TRUE, releases the lock after decrementing * the count. * * Results: * New reference count; 0 if freed. * * Side effects: * May free struct. * *----------------------------------------------------------------------------- */ int AsyncSocketRelease(AsyncSocket *s, // IN: Bool unlock) // IN: release lock { int count = --s->refCount; if (unlock) { AsyncSocketUnlock(s); } if (0 == count) { ASOCKLOG(1, s, ("Final release; freeing asock struct\n")); if (s->vt && s->vt->release) { s->vt->release(s); } free(s); return 0; } ASOCKLOG(1, s, ("Release (count now %d)\n", count)); return count; } /* *----------------------------------------------------------------------------- * * AsyncSocketPollAdd -- * * Add a poll callback. Wrapper for Poll_Callback since we always call * it in one of two basic forms. * * If socket is FALSE, user has to pass in the timeout value * * Results: * VMwareStatus result code from Poll_Callback * * Side effects: * Only the obvious. * *----------------------------------------------------------------------------- */ VMwareStatus AsyncSocketPollAdd(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback, ...) { int type, info; ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (socket) { ASSERT(asock->fd != -1); type = POLL_DEVICE; flags |= POLL_FLAG_SOCKET; info = asock->fd; } else { va_list marker; va_start(marker, callback); type = POLL_REALTIME; info = va_arg(marker, int); va_end(marker); } if (asock->pollParams.iPoll != NULL) { return AsyncSocketIPollAdd(asock, socket, flags, callback, info); } return Poll_Callback(asock->pollParams.pollClass, flags | asock->pollParams.flags, callback, asock, type, info, asock->pollParams.lock); } /* *----------------------------------------------------------------------------- * * AsyncSocketPollRemove -- * * Remove a poll callback. Wrapper for Poll_CallbackRemove since we * always call it in one of two basic forms. * * Results: * TRUE if removed, FALSE if not found. * * Side effects: * Only the obvious. * *----------------------------------------------------------------------------- */ Bool AsyncSocketPollRemove(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback) { int type; ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (asock->pollParams.iPoll != NULL) { return AsyncSocketIPollRemove(asock, socket, flags, callback); } if (socket) { ASSERT(asock->fd != -1); type = POLL_DEVICE; flags |= POLL_FLAG_SOCKET; } else { type = POLL_REALTIME; } return Poll_CallbackRemove(asock->pollParams.pollClass, flags | asock->pollParams.flags, callback, asock, type); } /* *----------------------------------------------------------------------------- * * AsyncSocketIPollAdd -- * * Add a poll callback. Wrapper for IVmdbPoll.Register[Timer]. * * If socket is FALSE, user has to pass in the timeout value * * Results: * VMwareStatus result code. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static VMwareStatus AsyncSocketIPollAdd(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback, int info) { #ifdef VMX86_TOOLS return VMWARE_STATUS_ERROR; #else VMwareStatus status = VMWARE_STATUS_SUCCESS; VmdbRet ret; IVmdbPoll *poll; ASSERT(asock->pollParams.iPoll); ASSERT(AsyncSocketIsLocked(asock)); /* Protect asyncsocket and lock from disappearing */ AsyncSocketAddRef(asock); if (asock->pollParams.lock != NULL) { MXUser_IncRefRecLock(asock->pollParams.lock); } poll = asock->pollParams.iPoll; if (socket) { int pollFlags = (flags & POLL_FLAG_READ) != 0 ? VMDB_PRF_READ : VMDB_PRF_WRITE; ret = poll->Register(poll, pollFlags, callback, asock, info); } else { ret = poll->RegisterTimer(poll, callback, asock, info); } if (ret != VMDB_S_OK) { Log(ASOCKPREFIX "failed to register callback (%s %d): error %d\n", socket ? "socket" : "delay", info, ret); if (asock->pollParams.lock != NULL) { MXUser_DecRefRecLock(asock->pollParams.lock); } AsyncSocketRelease(asock, FALSE); status = VMWARE_STATUS_ERROR; } return status; #endif } /* *----------------------------------------------------------------------------- * * AsyncSocketIPollRemove -- * * Remove a poll callback. Wrapper for IVmdbPoll.Unregister[Timer]. * * Results: * TRUE if the callback was registered and has been cancelled successfully. * FALSE if the callback was not registered, or the callback is already * scheduled to fire (and is guaranteed to fire). * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool AsyncSocketIPollRemove(AsyncSocket *asock, Bool socket, int flags, PollerFunction callback) { #ifdef VMX86_TOOLS return FALSE; #else IVmdbPoll *poll; Bool ret; ASSERT(asock->pollParams.iPoll); ASSERT(AsyncSocketIsLocked(asock)); poll = asock->pollParams.iPoll; if (socket) { int pollFlags = (flags & POLL_FLAG_READ) != 0 ? VMDB_PRF_READ : VMDB_PRF_WRITE; ret = poll->Unregister(poll, pollFlags, callback, asock); } else { ret = poll->UnregisterTimer(poll, callback, asock); } if (ret && !((asock->inIPollCb & IN_IPOLL_RECV) != 0 && callback == asock->vt->recvCallback) && !((asock->inIPollCb & IN_IPOLL_SEND) != 0 && callback == asock->vt->sendCallback)) { MXUserRecLock *lock = asock->pollParams.lock; /* * As the callback has been unregistered and we are not currently in * the callback being removed, we can safely release the reference taken * when registering the callback. */ AsyncSocketRelease(asock, FALSE); if (lock != NULL) { MXUser_DecRefRecLock(lock); } } return ret; #endif } /* *----------------------------------------------------------------------------- * * AsyncSocket_CancelRecv -- * AsyncSocket_CancelRecvEx -- * * Call this function if you know what you are doing. This should be * called if you want to synchronously receive the outstanding data on * the socket. It removes the recv poll callback. It also returns number of * partially read bytes (if any). A partially read response may exist as * AsyncSocketRecvCallback calls the recv callback only when all the data * has been received. * * Results: * ASOCKERR_SUCCESS or ASOCKERR_INVAL. * * Side effects: * Subsequent client call to AsyncSocket_Recv can reinstate async behaviour. * *----------------------------------------------------------------------------- */ int AsyncSocket_CancelRecv(AsyncSocket *asock, // IN int *partialRecvd, // OUT void **recvBuf, // OUT void **recvFn) // OUT { return AsyncSocket_CancelRecvEx(asock, partialRecvd, recvBuf, recvFn, FALSE); } int AsyncSocket_CancelRecvEx(AsyncSocket *asock, // IN int *partialRecvd, // OUT void **recvBuf, // OUT void **recvFn, // OUT Bool cancelOnSend) // IN { int retVal; ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (!asock) { Warning(ASOCKPREFIX "Invalid socket while cancelling recv request!\n"); return ASOCKERR_INVAL; } AsyncSocketLock(asock); if (asock->state != AsyncSocketConnected) { Warning(ASOCKPREFIX "Failed to cancel request on disconnected socket!\n"); retVal = ASOCKERR_INVAL; goto outHaveLock; } if (asock->inBlockingRecv) { Warning(ASOCKPREFIX "Cannot cancel request while a blocking recv is " "pending.\n"); retVal = ASOCKERR_INVAL; goto outHaveLock; } if (!cancelOnSend && (asock->sendBufList || asock->sendCb)) { Warning(ASOCKPREFIX "Can't cancel request as socket has send operation " "pending.\n"); retVal = ASOCKERR_INVAL; goto outHaveLock; } ASSERT(asock->vt); ASSERT(asock->vt->cancelRecvCb); asock->vt->cancelRecvCb(asock); if (partialRecvd && asock->recvLen > 0) { ASOCKLOG(1, asock, ("Partially read %d bytes out of %d bytes while " "cancelling recv request.\n", asock->recvPos, asock->recvLen)); *partialRecvd = asock->recvPos; } if (recvFn) { *recvFn = asock->recvFn; } if (recvBuf) { *recvBuf = asock->recvBuf; } asock->recvBuf = NULL; asock->recvFn = NULL; asock->recvPos = 0; asock->recvLen = 0; if (asock->passFd.fd != -1) { SSLGeneric_close(asock->passFd.fd); asock->passFd.fd = -1; } asock->passFd.expected = FALSE; retVal = ASOCKERR_SUCCESS; outHaveLock: AsyncSocketUnlock(asock); return retVal; } /* *----------------------------------------------------------------------------- * * AsyncSocket_GetReceivedFd -- * * Retrieve received file descriptor from socket. * * Results: * File descriptor. Or -1 if none was received. * * Side effects: * None. * *----------------------------------------------------------------------------- */ int AsyncSocket_GetReceivedFd(AsyncSocket *asock) // IN { int fd; ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (!asock) { Warning(ASOCKPREFIX "Invalid socket while receiving fd!\n"); return -1; } AsyncSocketLock(asock); if (asock->state != AsyncSocketConnected) { Warning(ASOCKPREFIX "Failed to receive fd on disconnected socket!\n"); AsyncSocketUnlock(asock); return -1; } fd = asock->passFd.fd; asock->passFd.fd = -1; asock->passFd.expected = FALSE; AsyncSocketUnlock(asock); return fd; } #ifndef USE_SSL_DIRECT /* *----------------------------------------------------------------------------- * * AsyncSocket_ConnectSSL -- * * Initialize the socket's SSL object, by calling SSL_ConnectAndVerify. * NOTE: This call is blocking. * * Results: * TRUE if SSL_ConnectAndVerify succeeded, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool AsyncSocket_ConnectSSL(AsyncSocket *asock, // IN SSLVerifyParam *verifyParam, // IN/OPT void *sslContext) // IN/OPT { ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); if (sslContext == NULL) { sslContext = SSL_DefaultContext(); } return SSL_ConnectAndVerifyWithContext(asock->sslSock, verifyParam, sslContext); } /* *----------------------------------------------------------------------------- * * AsyncSocket_AcceptSSL -- * * Initialize the socket's SSL object, by calling SSL_Accept. * * Results: * TRUE if SSL_Accept succeeded, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool AsyncSocket_AcceptSSL(AsyncSocket *asock) // IN { ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); return SSL_Accept(asock->sslSock); } #endif /* ! USE_SSL_DIRECT */ /* *---------------------------------------------------------------------------- * * AsyncSocketSslAcceptCallback -- * * Poll callback for redrive an outstanding ssl accept operation * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void AsyncSocketSslAcceptCallback(void *clientData) { int sslOpCode; AsyncSocket *asock = clientData; VMwareStatus pollStatus; ASSERT(asock); ASSERT(asock->pollParams.iPoll == NULL); ASSERT(AsyncSocketIsLocked(asock)); AsyncSocketAddRef(asock); sslOpCode = SSL_TryCompleteAccept(asock->sslSock); if (sslOpCode > 0) { (*asock->sslAcceptFn)(TRUE, asock, clientData); } else if (sslOpCode < 0) { (*asock->sslAcceptFn)(FALSE, asock, clientData); } else { /* register the poll callback to redrive the SSL accept */ pollStatus = AsyncSocketPollAdd(asock, TRUE, SSL_WantRead(asock->sslSock) ? POLL_FLAG_READ : POLL_FLAG_WRITE, AsyncSocketSslAcceptCallback); if (pollStatus != VMWARE_STATUS_SUCCESS) { ASOCKWARN(asock, ("failed to reinstall ssl accept callback!\n")); (*asock->sslAcceptFn)(FALSE, asock, clientData); } } AsyncSocketRelease(asock, FALSE); } /* *----------------------------------------------------------------------------- * * AsyncSocket_StartSslAccept -- * * Start an asynchronous SSL accept operation. * * The supplied callback function is called when the operation is complete * or an error occurs. * * Note: The client callback could be invoked from this function or * from a poll callback. If there is any requirement to always * invoke the client callback from outside this function, consider * changing this code to use a poll timer callback with timeout * set to zero. * * Note: sslCtx is typed as void *, so that the async socket code does * not have to include the openssl header. This is in sync with * SSL_AcceptWithContext(), where the sslCtx param is typed as void * * Results: * None. * Error is always reported using the callback supplied. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void AsyncSocket_StartSslAccept(AsyncSocket *asock, // IN void *sslCtx, // IN AsyncSocketSslAcceptFn sslAcceptFn, // IN void *clientData) // IN { Bool ok; ASSERT(asock); ASSERT(asock->asockType != ASYNCSOCKET_TYPE_NAMEDPIPE); ASSERT(sslAcceptFn); AsyncSocketLock(asock); if (asock->sslAcceptFn) { ASOCKWARN(asock, ("A SSL accept operation has already been initiated.\n")); goto done; } ok = SSL_SetupAcceptWithContext(asock->sslSock, sslCtx); if (!ok) { /* Something went wrong already */ (*sslAcceptFn)(FALSE, asock, clientData); goto done; } asock->sslAcceptFn = sslAcceptFn; asock->clientData = clientData; AsyncSocketSslAcceptCallback(asock); done: AsyncSocketUnlock(asock); } /* *----------------------------------------------------------------------------- * * AsyncSocket_SetBufferSizes -- * * Set socket level recv/send buffer sizes if they are less than given sizes. * * Result * TRUE: on success * FALSE: on failure * * Side-effects * None * *----------------------------------------------------------------------------- */ Bool AsyncSocket_SetBufferSizes(AsyncSocket *asock, // IN int sendSz, // IN int recvSz) // IN { int err; int buffSz; int len = sizeof buffSz; int sysErr; int fd; if (!asock) { return FALSE; } fd = asock->fd; err = getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&buffSz, &len); if (err) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "Could not get recv buffer size for socket %d, " "error %d: %s\n", fd, sysErr, Err_Errno2String(sysErr)); return FALSE; } if (buffSz < recvSz) { buffSz = recvSz; err = setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&buffSz, len); if (err) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "Could not set recv buffer size for socket %d " "to %d, error %d: %s\n", fd, buffSz, sysErr, Err_Errno2String(sysErr)); return FALSE; } } err = getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&buffSz, &len); if (err) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "Could not get send buffer size for socket %d, " "error %d: %s\n", fd, sysErr, Err_Errno2String(sysErr)); return FALSE; } if (buffSz < sendSz) { buffSz = sendSz; err = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&buffSz, len); if (err) { sysErr = ASOCK_LASTERROR(); Warning(ASOCKPREFIX "Could not set send buffer size for socket %d " "to %d, error %d: %s\n", fd, buffSz, sysErr, Err_Errno2String(sysErr)); return FALSE; } } return TRUE; } /* *----------------------------------------------------------------------------- * * AsyncSocket_SetSendLowLatencyMode -- * * Put the socket into a mode where we attempt to issue sends * directly from within AsyncSocket_Send(). Ordinarily, we would * set up a Poll callback from within AsyncSocket_Send(), which * introduces some non-zero latency to the send path. In * low-latency-send mode, that delay is potentially avoided. This * does introduce a behavioural change; the send completion * callback may be triggered before the call to Send() returns. As * not all clients may be expecting this, we don't enable this mode * unless requested by the client. * * Result * None * * Side-effects * See description above. * *----------------------------------------------------------------------------- */ void AsyncSocket_SetSendLowLatencyMode(AsyncSocket *asock, // IN Bool enable) // IN { asock->sendLowLatency = enable; } open-vm-tools-10.0.7-3227872/lib/asyncsocket/asyncSocketInt.h0000644000000000000000000003122312660700525022062 0ustar rootroot/********************************************************* * Copyright (C) 2011,2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #ifndef __ASYNC_SOCKET_INT_H__ #define __ASYNC_SOCKET_INT_H__ /* * asyncsocket.h -- * * The AsyncSocket object is a fairly simple wrapper around a basic TCP * socket. It's potentially asynchronous for both read and write * operations. Reads are "requested" by registering a receive function * that is called once the requested amount of data has been read from * the socket. Similarly, writes are queued along with a send function * that is called once the data has been written. Errors are reported via * a separate callback. */ #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #ifdef _WIN32 /* * We redefine strcpy/strcat because the Windows SDK uses it for getaddrinfo(). * When we upgrade SDKs, this redefinition can go away. * Note: Now we are checking if we have secure libs for string operations */ #if !(defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L) #define strcpy(dst,src) Str_Strcpy((dst), (src), 0x7FFFFFFF) #define strcat(dst,src) Str_Strcat((dst), (src), 0x7FFFFFFF) #endif #include #include #include #include #include #if !(defined(__GOT_SECURE_LIB__) && __GOT_SECURE_LIB__ >= 200402L) #undef strcpy #undef strcat #endif #else #include #include #include #include #include #include #include #include #include #include #include #include #endif #include "vmware.h" #include "random.h" #ifdef USE_SSL_DIRECT #include "sslDirect.h" #else #include "ssl.h" #endif #ifdef _WIN32 #define ASOCK_LASTERROR() WSAGetLastError() #define ASOCK_ENOTCONN WSAENOTCONN #define ASOCK_ENOTSOCK WSAENOTSOCK #define ASOCK_EADDRINUSE WSAEADDRINUSE #define ASOCK_ECONNECTING WSAEWOULDBLOCK #define ASOCK_EWOULDBLOCK WSAEWOULDBLOCK #else #define ASOCK_LASTERROR() errno #define ASOCK_ENOTCONN ENOTCONN #define ASOCK_ENOTSOCK ENOTSOCK #define ASOCK_EADDRINUSE EADDRINUSE #define ASOCK_ECONNECTING EINPROGRESS #define ASOCK_EWOULDBLOCK EWOULDBLOCK #endif typedef enum { WEB_SOCKET_FRAME_OPCODE_BINARY = 0x02, WEB_SOCKET_FRAME_OPCODE_CLOSE = 0x08, } WebSocketFrameOpcode; typedef enum { WEB_SOCKET_STATE_CONNECTING = 0, WEB_SOCKET_STATE_OPEN = 1, WEB_SOCKET_STATE_CLOSING = 2, WEB_SOCKET_STATE_CLOSED = 3, } WebSocketState; typedef enum { WEB_SOCKET_NEED_FRAME_TYPE = 0, WEB_SOCKET_NEED_FRAME_SIZE = 1, WEB_SOCKET_NEED_EXTENDED_FRAME_SIZE = 2, WEB_SOCKET_NEED_FRAME_MASK = 3, WEB_SOCKET_NEED_FRAME_DATA = 4, } WebSocketDecodeState; /* * Bitmask indicates when masking should be applyed or removed, * None at all (rare - RFC 6455 expects masking in at least one * direction), applied to frames we receive, or applied to frames * we sent. Both is possible (but again rare - RFC 6455 indicates * masking is only required on frames from the client/browser to the * server. */ typedef enum { WEB_SOCKET_MASKING_NONE = 0, WEB_SOCKET_MASKING_RECV = 1, WEB_SOCKET_MASKING_SEND = 1 << 1, } WebSocketMaskingRequired; typedef enum { ASYNCSOCKET_TYPE_SOCKET = 0, ASYNCSOCKET_TYPE_NAMEDPIPE = 1, } AsyncSocketType; /* * Output buffer list data type, for the queue of outgoing buffers */ typedef struct SendBufList { struct SendBufList *next; void *buf; int len; AsyncSocketSendFn sendFn; void *clientData; /* * If the data needs to be encoded somehow before sending over the * wire, this will point to an internally-allocated buffer * containing the encoded version of buf. The len field above will * hold the length of the encoded data. */ char *encodedBuf; } SendBufList; struct AsyncSocket { uint32 id; AsyncSocketState state; int fd; SSLSock sslSock; AsyncSocketType asockType; const struct AsyncSocketVTable *vt; unsigned int refCount; int genericErrno; AsyncSocketErrorFn errorFn; void *errorClientData; VmTimeType drainTimeoutUS; struct sockaddr_storage localAddr; socklen_t localAddrLen; struct sockaddr_storage remoteAddr; socklen_t remoteAddrLen; AsyncSocketConnectFn connectFn; AsyncSocketRecvFn recvFn; AsyncSocketSslAcceptFn sslAcceptFn; void *clientData; /* shared by recvFn, connectFn and sslAcceptFn */ AsyncSocketPollParams pollParams; void *recvBuf; int recvPos; int recvLen; Bool recvCb; Bool recvCbTimer; Bool recvFireOnPartial; SendBufList *sendBufList; SendBufList **sendBufTail; int sendPos; Bool sendCb; Bool sendCbTimer; Bool sendCbRT; Bool sendBufFull; Bool sendLowLatency; Bool sslConnected; uint8 inIPollCb; Bool inRecvLoop; uint32 inBlockingRecv; AsyncSocket *listenAsock4; AsyncSocket *listenAsock6; struct { Bool expected; int fd; } passFd; struct { char *origin; char *host; char *hostname; char *uri; char *cookie; int version; WebSocketMaskingRequired maskingRequirements; WebSocketFrameOpcode frameOpcode; WebSocketState state; void *connectClientData; // Saved error reporting values. AsyncSocketErrorFn errorFn; void *errorClientData; char *socketBuffer; // Accumulates incoming data (including framing etc.) char *decodeBuffer; // Accumulates incoming data after removing framing int32 socketBufferWriteOffset; int32 socketBufferReadOffset; int32 decodeBufferWriteOffset; int32 decodeBufferReadOffset; size_t frameBytesRemaining; size_t frameSize; Bool maskPresent; uint8 maskBytes[4]; uint8 maskOffset; const char **streamProtocols; // null terminated list of protocols const char *streamProtocol; // points to one of the above. WebSocketDecodeState decodeState; Bool useSSL; SSLVerifyParam *sslVerifyParam; // Used for certificate verifications char *upgradeNonceBase64; rqContext *randomContext; uint16 closeStatus; } webSocket; #ifdef _WIN32 struct { char *pipeName; uint32 connectCount; HANDLE pipe; OVERLAPPED rd; OVERLAPPED wr; } namedPipe; #endif struct { struct VSockSocket *socket; Bool signalCb; Bool sendCb; uint32 opMask; void *partialRecvBuf; uint32 partialRecvLen; } vmci; }; typedef struct AsyncSocketVTable { void (*dispatchConnect)(AsyncSocket *asock, AsyncSocket *newsock); int (*prepareSend)(AsyncSocket *asock, void *buf, int len, AsyncSocketSendFn sendFn, void *clientData, Bool *bufferListWasEmpty); int (*send)(AsyncSocket *asock, Bool bufferListWasEmpty, void *buf, int len); int (*recv)(AsyncSocket *asock, void *buf, int len); PollerFunction sendCallback; PollerFunction recvCallback; Bool (*hasDataPending)(AsyncSocket *asock); void (*cancelListenCb)(AsyncSocket *asock); void (*cancelRecvCb)(AsyncSocket *asock); void (*cancelCbForClose)(AsyncSocket *asock); Bool (*cancelCbForConnectingClose)(AsyncSocket *asock); void (*close)(AsyncSocket *asock); void (*release)(AsyncSocket *asock); } AsyncSocketVTable; AsyncSocket *AsyncSocketInit(int socketFamily, AsyncSocketPollParams *pollParams, int *outError); Bool AsyncSocketBind(AsyncSocket *asock, struct sockaddr_storage *addr, socklen_t addrLen, int *outError); Bool AsyncSocketListen(AsyncSocket *asock, AsyncSocketConnectFn connectFn, void *clientData, int *outError); int AsyncSocketResolveAddr(const char *hostname, unsigned int port, int family, Bool passive, struct sockaddr_storage *addr, socklen_t *addrLen, char **addrString); AsyncSocket *AsyncSocketConnectWithAsock(AsyncSocket *asock, struct sockaddr_storage *addr, socklen_t addrLen, AsyncSocketConnectFn connectFn, void *clientData, PollerFunction internalConnectFn, AsyncSocketPollParams *pollParams, int *outError); int AsyncSocketAddRef(AsyncSocket *s); int AsyncSocketRelease(AsyncSocket *s, Bool unlock); void AsyncSocketLock(AsyncSocket *asock); void AsyncSocketUnlock(AsyncSocket *asock); Bool AsyncSocketIsLocked(AsyncSocket *asock); void AsyncSocketHandleError(AsyncSocket *asock, int asockErr); int AsyncSocketFillRecvBuffer(AsyncSocket *s); void AsyncSocketDispatchSentBuffer(AsyncSocket *s); Bool AsyncSocketCheckAndDispatchRecv(AsyncSocket *s, int *error); int AsyncSocketSendInternal(AsyncSocket *asock, void *buf, int len, AsyncSocketSendFn sendFn, void *clientData, Bool *bufferListWasEmpty); int AsyncSocketSendSocket(AsyncSocket *asock, Bool bufferListWasEmpty, void *buf, int len); void AsyncSocketSendCallback(void *clientData); AsyncSocket *AsyncSocketCreate(AsyncSocketPollParams *pollParams); void AsyncSocketDispatchConnect(AsyncSocket *asock, AsyncSocket *newsock); void AsyncSocketRecvCallback(void *clientData); int AsyncSocketRecvSocket(AsyncSocket *asock, void *buf, int len); void AsyncSocketCancelListenCbSocket(AsyncSocket *asock); void AsyncSocketCancelRecvCbSocket(AsyncSocket *asock); void AsyncSocketCancelCbForCloseSocket(AsyncSocket *asock); Bool AsyncSocketCancelCbForConnectingCloseSocket(AsyncSocket *asock); void AsyncSocketCloseSocket(AsyncSocket *asock); #ifndef VMX86_TOOLS void AsyncSocketInitWebSocket(AsyncSocket *asock, void *clientData, Bool useSSL, const char *protocols[]); #endif AsyncSocket *AsyncSocketListenImpl(struct sockaddr_storage *addr, socklen_t addrLen, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, Bool isWebSock, Bool webSockUseSSL, const char *protocols[], int *outError); AsyncSocket *AsyncSocketListenerCreate(const char *addrStr, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, Bool isWebSock, Bool webSockUseSSL, const char *protocols[], int *outError); #endif // __ASYNC_SOCKET_INT_H__ open-vm-tools-10.0.7-3227872/lib/asyncsocket/Makefile.in0000644000000000000000000004044712660700525021025 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/asyncsocket DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libAsyncSocket_la_LIBADD = am_libAsyncSocket_la_OBJECTS = asyncsocket.lo libAsyncSocket_la_OBJECTS = $(am_libAsyncSocket_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libAsyncSocket_la_SOURCES) DIST_SOURCES = $(libAsyncSocket_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libAsyncSocket.la libAsyncSocket_la_SOURCES = asyncsocket.c AM_CFLAGS = -DUSE_SSL_DIRECT all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/asyncsocket/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/asyncsocket/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libAsyncSocket.la: $(libAsyncSocket_la_OBJECTS) $(libAsyncSocket_la_DEPENDENCIES) $(LINK) $(libAsyncSocket_la_OBJECTS) $(libAsyncSocket_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asyncsocket.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/rpcOut/0000755000000000000000000000000012660700526015676 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/rpcOut/Makefile.am0000644000000000000000000000173212660700526017735 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libRpcOut.la libRpcOut_la_SOURCES = libRpcOut_la_SOURCES += rpcout.c open-vm-tools-10.0.7-3227872/lib/rpcOut/rpcout.c0000644000000000000000000003722612660700526017370 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * rpcout.c -- * * Remote Procedure Call between VMware and guest applications * C implementation. * * This module contains implements the out (guest=>host) direction only. * The in and out modules are separate since some applications (e.g. * drivers that want to do RPC-based logging) only want/need/can have the * out direction. */ #if defined(__KERNEL__) || defined(_KERNEL) || defined(KERNEL) # include "kernelStubs.h" #else # include # include # include # include # include "str.h" # include "debug.h" #endif #include "vmware.h" #include "rpcout.h" #include "message.h" /* * The RpcOut object */ struct RpcOut { Message_Channel channel; Bool started; }; /* *----------------------------------------------------------------------------- * * RpcOutInitialize -- * * Initializes an already allocated RpcOut object. * * Results: * None. * * Side effects: * See above. * *----------------------------------------------------------------------------- */ static void RpcOutInitialize(RpcOut *rpcOut) { memset(rpcOut, 0, sizeof *rpcOut); } /* *----------------------------------------------------------------------------- * * RpcOut_Construct -- * * Constructor for the RpcOut object * * Results: * New RpcOut object. * * Side effects: * Allocates memory. * *----------------------------------------------------------------------------- */ RpcOut * RpcOut_Construct(void) { RpcOut *rpcOut = malloc(sizeof *rpcOut); RpcOutInitialize(rpcOut); return rpcOut; } /* *----------------------------------------------------------------------------- * * RpcOut_Destruct -- * * Destructor for the RpcOut object. * * Results: * None. * * Side effects: * Frees RpcOut object memory. * *----------------------------------------------------------------------------- */ void RpcOut_Destruct(RpcOut *out) // IN { ASSERT(out != NULL); ASSERT(!out->started); free(out); } /* *----------------------------------------------------------------------------- * * RpcOut_startWithReceiveBuffer -- * * Open the channel. This variant of RpcOut_start allows the * caller to pre-allocate the receiver buffer, but by doing so it * allows for some simple operations without the need to call * malloc. * * Passing in NULL and size 0 will cause this function to fall * back to using malloc. * * Result: * TRUE on success * FALSE on failure * * Side-effects: * None * *----------------------------------------------------------------------------- */ Bool RpcOut_startWithReceiveBuffer(RpcOut *out, char *receiveBuffer, size_t receiveBufferSize) { ASSERT(out != NULL); ASSERT(!out->started); out->started = Message_OpenAllocated(RPCI_PROTOCOL_NUM, &out->channel, receiveBuffer, receiveBufferSize); if (!out->started) { Debug("RpcOut: couldn't open channel with RPCI protocol\n"); } return out->started; } /* *----------------------------------------------------------------------------- * * RpcOut_start -- * * Open the channel * * Result: * TRUE on success * FALSE on failure * * Side-effects: * None * *----------------------------------------------------------------------------- */ Bool RpcOut_start(RpcOut *out) // IN { return RpcOut_startWithReceiveBuffer(out, NULL, 0); } /* *----------------------------------------------------------------------------- * * RpcOut_send -- * * Make VMware synchroneously execute a TCLO command * * Unlike the other send varieties, RpcOut_send requires that the * caller pass non-NULL reply and repLen arguments. * * Result * TRUE on success. 'reply' contains the result of the rpc * FALSE on error. 'reply' will contain a description of the error * * In both cases, the caller should not free the reply. * * Side-effects * None * *----------------------------------------------------------------------------- */ Bool RpcOut_send(RpcOut *out, // IN char const *request, // IN size_t reqLen, // IN char const **reply, // OUT size_t *repLen) // OUT { unsigned char *myReply; size_t myRepLen; Bool success; ASSERT(out != NULL); ASSERT(out->started); if (Message_Send(&out->channel, (const unsigned char *)request, reqLen) == FALSE) { *reply = "RpcOut: Unable to send the RPCI command"; *repLen = strlen(*reply); return FALSE; } if (Message_Receive(&out->channel, &myReply, &myRepLen) == FALSE) { *reply = "RpcOut: Unable to receive the result of the RPCI command"; *repLen = strlen(*reply); return FALSE; } if (myRepLen < 2 || ( (success = strncmp((const char *)myReply, "1 ", 2) == 0) == FALSE && strncmp((const char *)myReply, "0 ", 2))) { *reply = "RpcOut: Invalid format for the result of the RPCI command"; *repLen = strlen(*reply); return FALSE; } *reply = ((const char *)myReply) + 2; *repLen = myRepLen - 2; return success; } /* *----------------------------------------------------------------------------- * * RpcOut_stop -- * * Close the channel * * Result * TRUE on success * FALSE on failure * * Side-effects * Frees the result of the last command. * *----------------------------------------------------------------------------- */ Bool RpcOut_stop(RpcOut *out) // IN { Bool status = TRUE; ASSERT(out != NULL); if (out->started) { /* Try to close the channel */ if (Message_CloseAllocated(&out->channel) == FALSE) { Debug("RpcOut: couldn't close channel\n"); status = FALSE; } out->started = FALSE; } return status; } /* *----------------------------------------------------------------------------- * * RpcOut_sendOne -- * * Make VMware execute a RPCI command * * VMware closes a channel when it detects that there has been no activity * on it for a while. Because we do not know how often this program will * make VMware execute a RPCI, we open/close one channel per RPCI command * * Return value: * TRUE on success. '*reply' contains an allocated result of the rpc * FALSE on error. '*reply' contains an allocated description of the error * or NULL. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool RpcOut_sendOne(char **reply, // OUT: Result size_t *repLen, // OUT: Length of the result char const *reqFmt, // IN: RPCI command ...) // Unspecified { va_list args; Bool status; char *request; size_t reqLen = 0; status = FALSE; /* Format the request string */ va_start(args, reqFmt); request = Str_Vasprintf(&reqLen, reqFmt, args); va_end(args); /* * If Str_Vasprintf failed, write NULL into the reply if the caller wanted * a reply back. */ if (request == NULL) { if (reply) { *reply = NULL; } return FALSE; } /* * If the command doesn't contain a space, add one to the end to maintain * compatibility with old VMXs. * * For a long time, the GuestRpc logic in the VMX was wired to expect a * trailing space in every command, even commands without arguments. That is * no longer true, but we must continue to add a trailing space because we * don't know whether we're talking to an old or new VMX. */ if (strchr(request, ' ') == NULL) { char *tmp; tmp = Str_Asprintf(NULL, "%s ", request); free(request); request = tmp; /* * If Str_Asprintf failed, write NULL into reply if the caller wanted * a reply back. */ if (request == NULL) { if (reply != NULL) { *reply = NULL; } return FALSE; } } status = RpcOut_SendOneRaw(request, reqLen, reply, repLen); free(request); return status; } /* *----------------------------------------------------------------------------- * * RpcOutSendOneRawWork -- * * Helper function to make VMware execute a RPCI command. See * RpcOut_SendOneRaw and RpcOut_SendOneRawPreallocated. * *----------------------------------------------------------------------------- */ static Bool RpcOutSendOneRawWork(void *request, // IN: RPCI command size_t reqLen, // IN: Size of request buffer char *callerReply, // IN: caller supplied reply buffer size_t callerReplyLen, // IN: size of caller supplied buf char **reply, // OUT: Result size_t *repLen) // OUT: Length of the result { Bool status; /* Stack allocate so this can be used in kernel logging. See 1389199. */ RpcOut out; char const *myReply; size_t myRepLen; Debug("Rpci: Sending request='%s'\n", (char *)request); RpcOutInitialize(&out); if (!RpcOut_startWithReceiveBuffer(&out, callerReply, callerReplyLen)) { myReply = "RpcOut: Unable to open the communication channel"; myRepLen = strlen(myReply); if (callerReply != NULL) { unsigned s = MIN(callerReplyLen - 1, myRepLen); ASSERT(reply == NULL); memcpy(callerReply, myReply, s); callerReply[s] = '\0'; } return FALSE; } status = RpcOut_send(&out, request, reqLen, &myReply, &myRepLen); /* On failure, we already have the description of the error */ Debug("Rpci: Sent request='%s', reply='%s', len=%"FMTSZ"u, status=%d\n", (char *)request, myReply, myRepLen, status); if (reply != NULL) { /* * If we got a non-NULL reply, make a copy of it, because the reply * we got back is inside the channel buffer, which will get destroyed * at the end of this function. */ if (myReply != NULL) { /* * We previously used strdup to duplicate myReply, but that * breaks if you are sending binary (not string) data over the * backdoor. Don't assume the data is a string. * * myRepLen is strlen(myReply), so we need an extra byte to * cover the NUL terminator. */ *reply = malloc(myRepLen + 1); if (*reply != NULL) { memcpy(*reply, myReply, myRepLen); /* * The message layer already writes a trailing NUL but we might * change that someday, so do it again here. */ (*reply)[myRepLen] = 0; } } else { /* * Our reply was NULL, so just pass the NULL back up to the caller. */ *reply = NULL; } /* * Only set the length if the caller wanted it and if we got a good * reply. */ if (repLen != NULL && *reply != NULL) { *repLen = myRepLen; } } if (RpcOut_stop(&out) == FALSE) { /* * We couldn't stop the channel. Free anything we allocated, give our * client a reply of NULL, and return FALSE. */ if (reply != NULL) { free(*reply); *reply = NULL; } Debug("Rpci: unable to close the communication channel\n"); status = FALSE; } return status; } /* *----------------------------------------------------------------------------- * * RpcOut_SendOneRaw -- * * Make VMware execute a RPCI command * * VMware closes a channel when it detects that there has been no activity * on it for a while. Because we do not know how often this program will * make VMware execute a RPCI, we open/close one channel per RPCI command. * * This function sends a message over the backdoor without using * any of the Str_ functions on the request buffer; Str_Asprintf() in * particular uses FormatMessage on Win32, which corrupts some UTF-8 * strings. Using this function directly instead of using RpcOut_SendOne() * avoids these problems. * * If this is not an issue, you can use RpcOut_sendOne(), which has * varargs. * * Note: It is the caller's responsibility to ensure that the RPCI command * followed by a space appear at the start of the request buffer. See * the command in RpcOut_sendOne for details. * * Return value: * TRUE on success. '*reply' contains an allocated result of the rpc * FALSE on error. '*reply' contains an allocated description of the * error or NULL. * * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool RpcOut_SendOneRaw(void *request, // IN: RPCI command size_t reqLen, // IN: Size of request buffer char **reply, // OUT: Result size_t *repLen) // OUT: Length of the result { return RpcOutSendOneRawWork(request, reqLen, NULL, 0, reply, repLen); } /* *----------------------------------------------------------------------------- * * RpcOut_SendOneRawPreallocated -- * * Make VMware execute a RPCI command. * * A variant of RpcOut_SendOneRaw in which the caller supplies the * receive buffer instead of dynamically allocating it. This * allows the caller to call this function in situations where * malloc is not allowed. But if the response from the host is too * large the rpc will fail instead of attempting to grow its own * receive buffer. * * * Return value: * TRUE on success. 'reply' contains an allocated result of the rpc * FALSE on error. 'reply' contains an allocated description of the * error or NULL. * * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool RpcOut_SendOneRawPreallocated(void *request, // IN: RPCI command size_t reqLen, // IN: Size of request buffer char *reply, // OUT: Result size_t repLen) // IN: Length of the result { return RpcOutSendOneRawWork(request, reqLen, reply, repLen, NULL, NULL); } open-vm-tools-10.0.7-3227872/lib/rpcOut/Makefile.in0000644000000000000000000004025312660700526017747 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/rpcOut DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libRpcOut_la_LIBADD = am_libRpcOut_la_OBJECTS = rpcout.lo libRpcOut_la_OBJECTS = $(am_libRpcOut_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libRpcOut_la_SOURCES) DIST_SOURCES = $(libRpcOut_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libRpcOut.la libRpcOut_la_SOURCES = rpcout.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/rpcOut/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/rpcOut/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libRpcOut.la: $(libRpcOut_la_OBJECTS) $(libRpcOut_la_DEPENDENCIES) $(LINK) $(libRpcOut_la_OBJECTS) $(libRpcOut_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcout.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/poll/0000755000000000000000000000000012660700526015370 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/poll/Makefile.am0000644000000000000000000000172112660700526017425 0ustar rootroot################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libPoll.la libPoll_la_SOURCES = libPoll_la_SOURCES += poll.c open-vm-tools-10.0.7-3227872/lib/poll/poll.c0000644000000000000000000017445512660700526016522 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * poll.c -- management of the event callback queues, selects, ... */ #include "vmware.h" #include "pollImpl.h" #ifdef _WIN32 #include "vmci_sockets.h" #include #include "err.h" #endif /* * Maximum time (us.) to sleep when there is nothing else to do * before this time elapses. It has an impact on how often the * POLL_MAIN_LOOP events are fired. --hpreg */ #define MAX_SLEEP_TIME (1 * 1000 * 1000) /* 1 s. */ static const PollImpl *pollImpl = NULL; /* *---------------------------------------------------------------------- * * PollSanitizeFlags -- * * For historical reasons we translate POLL_DEVICE with zero flags * to POLL_FLAG_READ. No-one knows why anymore. * * Results: * Updated flags value. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE int PollSanitizeFlags(PollEventType type, // IN: Event type int flags) // IN: Flags { if (type == POLL_DEVICE) { /* * Either read or write must be requested for devices. * On Windows use POLL_FLAG_READ for waiting on events. */ ASSERT((flags & (POLL_FLAG_READ | POLL_FLAG_WRITE)) != 0); } return flags; } /* *---------------------------------------------------------------------- * * Poll_InitWithImpl -- * * Module initialization. An implementation of Poll should call * this is initialize the function table and then start Poll. * * Results: void * * Side effects: poll is alive * *---------------------------------------------------------------------- */ void Poll_InitWithImpl(const PollImpl *impl) { ASSERT(pollImpl == NULL); pollImpl = impl; pollImpl->Init(); } /* *---------------------------------------------------------------------- * * Poll_Exit -- * * module de-initalization * * Warning: * * This function is intended to be called from vmxScsiLib or * nbdScsiLib only. It has *not* been used, nor tested, in the * context of the VMX product. * *---------------------------------------------------------------------- */ void Poll_Exit(void) { pollImpl->Exit(); pollImpl = NULL; } /* *---------------------------------------------------------------------------- * * Poll_LockingEnabled -- * * Determine if locking is enabled in the underlying poll implementation. * * Results: * TRUE if locking is enabled. * * Side effects: * None. * *---------------------------------------------------------------------------- */ Bool Poll_LockingEnabled(void) { return pollImpl->LockingEnabled(); } /* *---------------------------------------------------------------------- * * Poll_LoopTimeout -- * * The poll loop. * This is supposed to be the main loop for most programs. * * Result: * Void. * * Side effects: * Fiat lux! * *---------------------------------------------------------------------- */ void Poll_LoopTimeout(Bool loop, // IN: loop forever if TRUE, else do one pass. Bool *exit, // IN: NULL or set to TRUE to end loop. PollClass class, // IN: class of events (POLL_CLASS_*) int timeout) // IN: maximum time to sleep { pollImpl->LoopTimeout(loop, exit, class, timeout); } /* *---------------------------------------------------------------------- * * Poll_Loop -- * * Run Poll_LoopTimeout with the default timeout of * MAX_SLEEP_TIME (1 second) * *---------------------------------------------------------------------- */ void Poll_Loop(Bool loop, // IN: loop forever if TRUE, else do one pass Bool *exit, // IN: NULL or set to TRUE to end loop. PollClass class) // IN: class of events (POLL_CLASS_*) { Poll_LoopTimeout(loop, exit, class, MAX_SLEEP_TIME); } /* *---------------------------------------------------------------------- * * Poll_CallbackRemove -- * * remove a callback from the real-time queue, the virtual time * queue, the file descriptor select set, or the main loop queue. * * Results: * TRUE if entry found and removed, FALSE otherwise * * Side effects: * queues modified * *---------------------------------------------------------------------- */ Bool Poll_CallbackRemove(PollClassSet classSet, int flags, PollerFunction f, void *clientData, PollEventType type) { ASSERT(f); flags = PollSanitizeFlags(type, flags); return pollImpl->CallbackRemove(classSet, flags, f, clientData, type); } /* *---------------------------------------------------------------------- * * Poll_Callback -- * * Insert a callback into one of the queues (e.g., the real-time * queue, the virtual time queue, the file descriptor select * set, or the main loop queue). * * For the POLL_REALTIME or POLL_DEVICE queues, entries can be * inserted for good, to fire on a periodic basis (by setting the * POLL_FLAG_PERIODIC flag). * * Otherwise, the callback fires only once. * * For periodic POLL_REALTIME callbacks, "info" is the time in * microseconds between execution of the callback. For * POLL_DEVICE callbacks, info is a file descriptor. * * *---------------------------------------------------------------------- */ VMwareStatus Poll_Callback(PollClassSet classSet, int flags, PollerFunction f, void *clientData, PollEventType type, PollDevHandle info, MXUserRecLock *lock) { ASSERT(f); flags = PollSanitizeFlags(type, flags); return pollImpl->Callback(classSet, flags, f, clientData, type, info, lock); } /* *---------------------------------------------------------------------- * * Poll_CallbackRemoveOneByCB -- * * Remove poll entry previously added by Poll_Callback. If there * are multiple entries queued specifying same callback, it is * indeterminate which one will be removed and returned. * * Results: * TRUE if entry found and removed, *clientData is set to entry's * client data * FALSE if entry was not found * * Side effects: * queues modified * *---------------------------------------------------------------------- */ Bool Poll_CallbackRemoveOneByCB(PollClassSet classSet, int flags, PollerFunction f, PollEventType type, void **clientData) { ASSERT(f); ASSERT(clientData); flags = PollSanitizeFlags(type, flags); return pollImpl->CallbackRemoveOneByCB(classSet, flags, f, type, clientData); } /* *---------------------------------------------------------------------------- * * Poll_NotifyChange -- * * Wake up a sleeping Poll_LoopTimeout() when there is a change * it should notice, and no normal event can be expected to wake * it up in a timely manner. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void Poll_NotifyChange(PollClassSet classSet) // IN { pollImpl->NotifyChange(classSet); } /* *---------------------------------------------------------------------- * * Wrappers for Poll_Callback and Poll_CallbackRemove -- special cases * with fewer arguments. * *---------------------------------------------------------------------- */ VMwareStatus Poll_CB_Device(PollerFunction f, void *clientData, PollDevHandle info, Bool periodic) { return Poll_Callback(POLL_CS_MAIN, POLL_FLAG_READ | POLL_FLAG_REMOVE_AT_POWEROFF | (periodic ? POLL_FLAG_PERIODIC : 0), f, clientData, POLL_DEVICE, info, NULL); } Bool Poll_CB_DeviceRemove(PollerFunction f, void *clientData, Bool periodic) { return Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_READ | POLL_FLAG_REMOVE_AT_POWEROFF | (periodic ? POLL_FLAG_PERIODIC : 0), f, clientData, POLL_DEVICE); } VMwareStatus Poll_CB_RTime(PollerFunction f, void *clientData, int info, //microsecs Bool periodic, MXUserRecLock *lock) { return Poll_Callback(POLL_CS_MAIN, POLL_FLAG_REMOVE_AT_POWEROFF | (periodic ? POLL_FLAG_PERIODIC : 0), f, clientData, POLL_REALTIME, info, lock); } Bool Poll_CB_RTimeRemove(PollerFunction f, void *clientData, Bool periodic) { return Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_REMOVE_AT_POWEROFF | (periodic ? POLL_FLAG_PERIODIC : 0), f, clientData, POLL_REALTIME); } #ifdef _WIN32 /* *----------------------------------------------------------------------------- * * PollSocketPairStartConnecting -- * * Helper function that does most of the work of creating * a socket pair. * * Results: * Socket bound to a local address, and another connecting * to that address. * INVALID_SOCKET on error. Use WSAGetLastError() for detail. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static SOCKET PollSocketPairStartConnecting(Bool vmci, // IN: vmci socket? Bool stream, // IN: stream socket? Bool blocking, // IN: blocking socket? SOCKET *s) // OUT: connecting socket { SOCKET temp = INVALID_SOCKET; struct sockaddr *addr; int addrlen; struct sockaddr_vm vaddr; struct sockaddr_in iaddr; int savedError; int socketCommType = stream ? SOCK_STREAM : SOCK_DGRAM; if (vmci) { addrlen = sizeof vaddr; memset(&vaddr, 0, sizeof vaddr); vaddr.svm_family = VMCISock_GetAFValue(); vaddr.svm_cid = VMADDR_CID_ANY; vaddr.svm_port = VMADDR_PORT_ANY; *s = socket(vaddr.svm_family, socketCommType, 0); if (*s == INVALID_SOCKET) { Log("%s: Could not create vmci socket.\n", __FUNCTION__); goto out; } temp = socket(vaddr.svm_family, socketCommType, 0); if (temp == INVALID_SOCKET) { Log("%s: Could not create second vmci socket.\n", __FUNCTION__); goto out; } addr = (struct sockaddr *)&vaddr; } else { addrlen = sizeof iaddr; memset(&iaddr, 0, sizeof iaddr); iaddr.sin_family = AF_INET; iaddr.sin_addr.s_addr = inet_addr("127.0.0.1"); iaddr.sin_port = 0; *s = socket(AF_INET, socketCommType, 0); if (*s == INVALID_SOCKET) { Log("%s: Could not create inet socket.\n", __FUNCTION__); goto out; } temp = socket(AF_INET, socketCommType, 0); if (temp == INVALID_SOCKET) { Log("%s: Could not create second inet socket.\n", __FUNCTION__); goto out; } addr = (struct sockaddr *)&iaddr; } if (bind(temp, addr, sizeof *addr) == SOCKET_ERROR) { Log("%s: Could not bind socket.\n", __FUNCTION__); goto outCloseTemp; } if (!blocking) { unsigned long a = 1; if (ioctlsocket(*s, FIONBIO, &a) == SOCKET_ERROR) { Log("%s: Could not make socket non-blocking.\n", __FUNCTION__); goto outCloseTemp; } } if (stream && listen(temp, 1) == SOCKET_ERROR) { Log("%s: Could not listen on a socket.\n", __FUNCTION__); goto outCloseTemp; } if (getsockname(temp, addr, &addrlen) == SOCKET_ERROR) { Log("%s: getsockname() failed.\n", __FUNCTION__); goto outCloseTemp; } if (vmci) { vaddr.svm_cid = VMCISock_GetLocalCID(); } if (connect(*s, addr, addrlen) == SOCKET_ERROR) { if (blocking || WSAGetLastError() != WSAEWOULDBLOCK) { Log("%s: Could not connect to a local socket.\n", __FUNCTION__); goto outCloseTemp; } } else if (!blocking) { Log("%s: non-blocking socket connected immediately!\n", __FUNCTION__); goto outCloseTemp; } return temp; outCloseTemp: savedError = GetLastError(); closesocket(temp); SetLastError(savedError); out: return INVALID_SOCKET; } /* *----------------------------------------------------------------------------- * * Poll_SocketPair -- * * Emulate basic socketpair() using windows API. * * Results: * Two sockets connected to each other. * * Side effects: * A TCP/IP or VMCI connection is created. * *----------------------------------------------------------------------------- */ int Poll_SocketPair(Bool vmci, // IN: create vmci pair? Bool stream, // IN: stream socket? int fds[2]) // OUT: 2 sockets connected to each other { SOCKET temp = INVALID_SOCKET; fds[0] = INVALID_SOCKET; fds[1] = INVALID_SOCKET; temp = PollSocketPairStartConnecting(vmci, stream, TRUE, (SOCKET *)&fds[0]); if (temp == INVALID_SOCKET) { goto out; } if (stream) { fds[1] = accept(temp, NULL, NULL); if (fds[1] == INVALID_SOCKET) { Log("%s: Could not accept on a local socket.\n", __FUNCTION__); goto out; } closesocket(temp); } else { fds[1] = temp; } return 0; out: Warning("%s: Error creating a %s socket pair: %d/%s\n", __FUNCTION__, vmci ? "vmci" : "inet", WSAGetLastError(), Err_ErrString()); closesocket(temp); closesocket(fds[0]); closesocket(fds[1]); return SOCKET_ERROR; } #endif // _WIN32 //#define POLL_UNITTEST 1 //#define POLL_TESTLOCK 1 //#define POLL_TESTVMCI 1 #if POLL_UNITTEST // All the way to EOF #if _WIN32 #include #include #include "err.h" #include "random.h" #else #include #include #endif #include "vmci_sockets.h" #if POLL_TESTLOCK #include "vthread.h" #include "util.h" #include "../../vmx/public/mutexRankVMX.h" #define GRAB_LOCK(_lock) \ if (_lock) { \ MXUser_AcquireRecLock(_lock); \ } #define DROP_LOCK(_lock) \ if (_lock) { \ MXUser_ReleaseRecLock(_lock); \ } #define NUM_TEST_ITERS 10 #else #define GRAB_LOCK(_lock) #define DROP_LOCK(_lock) #endif /* * Make this queue length a little bit less than poll implementation's max * to allow for some sockets in the test program itself. */ #define MAX_QUEUE_LENGTH 4090 #define MAX_VMX_QUEUE_LENGTH 450 static char reinstallPoll[1]; static char removePoll[1]; static unsigned int realTimeCount; static unsigned int mainLoopCount; static int fds[2]; static unsigned int deviceRCount; static unsigned int deviceWCount; static unsigned int state; static unsigned int successCount; static unsigned int failureCount; static unsigned int dummyCount; static Bool isVMX; static Bool useLocking; static Bool testVMCI; static MXUserRecLock *cbLock; static unsigned int lockErrors; #if POLL_TESTLOCK static volatile Bool exitThread; #endif static volatile Bool rtDeleted; static volatile Bool mlDeleted; static volatile Bool drDeleted; static volatile Bool dwDeleted; static unsigned int rtCbRace; static unsigned int mlCbRace; static unsigned int drCbRace; static unsigned int dwCbRace; typedef struct SocketPair { int fds[2]; int count; } SocketPair; static SocketPair socketPairs[MAX_QUEUE_LENGTH]; #ifdef _WIN32 static HANDLE events[2]; static unsigned int deviceEv0Count; static unsigned int deviceEv1Count; static SOCKET boundSocket; #endif /* *---------------------------------------------------------------------------- * * CheckLockState -- * * If testing with lock, verify that lock is held by the calling thread. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static INLINE void CheckLockState(void) { if (cbLock && !MXUser_IsCurThreadHoldingRecLock(cbLock)) { lockErrors++; } } /* *----------------------------------------------------------------------------- * * PollUnitTest_RealTime -- * * Real time test Poll callback. * * Increment the callback's counter, and if 'clientData' is not NULL, * self reschedule. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void PollUnitTest_RealTime(void *clientData) // IN { realTimeCount++; CheckLockState(); rtCbRace += (rtDeleted != FALSE); if (clientData == reinstallPoll) { Poll_Callback(POLL_CS_MAIN, 0, PollUnitTest_RealTime, clientData, POLL_REALTIME, 0, cbLock); } else if (clientData == removePoll) { Bool ret; ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_RealTime, clientData, POLL_REALTIME); ASSERT(ret); } else { ASSERT(clientData == NULL); } } /* *----------------------------------------------------------------------------- * * PollUnitTest_MainLoop -- * * Main loop test Poll callback. * * Increment the callback's counter, and if 'clientData' is not NULL, * self reschedule. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void PollUnitTest_MainLoop(void *clientData) // IN { mainLoopCount++; CheckLockState(); mlCbRace += (mlDeleted != FALSE); if (clientData == reinstallPoll) { Poll_Callback(POLL_CS_MAIN, 0, PollUnitTest_MainLoop, clientData, POLL_MAIN_LOOP, 0, cbLock); } else if (clientData == removePoll) { Bool ret; ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_MainLoop, clientData, POLL_MAIN_LOOP); ASSERT(ret); } else { ASSERT(clientData == NULL); } } /* *----------------------------------------------------------------------------- * * PollUnitTest_DeviceR -- * * Device read test Poll callback. * * Increment the callback's counter, and if 'clientData' is not NULL, * self reschedule. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void PollUnitTest_DeviceR(void *clientData) // IN { #ifdef _WIN32 /* * Windows won't tell us a socket is readable unless some kind of * read is performed. Read, then re-fill the buffer. */ char buf[sizeof fds]; recv(fds[1], buf, sizeof fds, 0); send(fds[0], (const char *)fds, sizeof fds, 0); ASSERT(!memcmp(buf, fds, sizeof fds)); #endif deviceRCount++; CheckLockState(); drCbRace += (drDeleted != FALSE); if (clientData == reinstallPoll) { Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceR, clientData, POLL_DEVICE, fds[1], cbLock); } else if (clientData == removePoll) { Bool ret; ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, clientData, POLL_DEVICE); ASSERT(ret); } else { ASSERT(clientData == NULL); } } /* *----------------------------------------------------------------------------- * * PollUnitTest_DeviceW -- * * Device write test Poll callback. * * Increment the callback's counter, and if 'clientData' is not NULL, * self reschedule. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void PollUnitTest_DeviceW(void *clientData) // IN { deviceWCount++; CheckLockState(); dwCbRace += (dwDeleted != FALSE); if (clientData == reinstallPoll) { Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, clientData, POLL_DEVICE, fds[1], cbLock); } else if (clientData == removePoll) { Bool ret; ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, clientData, POLL_DEVICE); ASSERT(ret); } else { ASSERT(clientData == NULL); } } /* *----------------------------------------------------------------------------- * * PollUnitTest_DeviceRQ -- * * Device read test Poll callback, the queue test version. * * Increment the callback's counter, and self reschedule. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void PollUnitTest_DeviceRQ(void *clientData) // IN { int queueIndex = (int)(intptr_t)clientData; #ifdef _WIN32 /* * Windows won't tell us a socket is readable unless some kind of * read is performed. Read, then re-fill the buffer. */ char buf[sizeof fds]; recv(socketPairs[queueIndex].fds[1], buf, sizeof fds, 0); send(socketPairs[queueIndex].fds[0], (const char *)fds, sizeof fds, 0); ASSERT(!memcmp(buf, fds, sizeof fds)); #endif deviceRCount++; socketPairs[queueIndex].count++; CheckLockState(); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceRQ, clientData, POLL_DEVICE, socketPairs[queueIndex].fds[1], cbLock); } #if defined(POLL_TESTLOCK) && defined(_WIN32) /* *----------------------------------------------------------------------------- * * PollUnitTest_DeviceEvent -- * * Device read test Poll callback for Event. * * Increment the callback's counter, and if 'clientData' is not NULL, * self reschedule. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void PollUnitTest_DeviceEvent(void *clientData) // IN { CheckLockState(); if (clientData == NULL) { deviceEv0Count++; SetEvent(events[0]); } else { ASSERT(clientData == reinstallPoll); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_READ, PollUnitTest_DeviceEvent clientData, POLL_DEVICE, (PollDevHandle)events[1], cbLock); deviceEv1Count++; SetEvent(events[1]); } } #endif /* *----------------------------------------------------------------------------- * * PollUnitTest_TestResult -- * * Log and count test result. * * Results: * None. * * Side effects: * Outputs the result of the test with Warning(). * *----------------------------------------------------------------------------- */ static void PollUnitTest_TestResult(Bool success) // IN: TRUE on success, FALSE on failure { if (success && lockErrors == 0) { successCount++; Warning("%s: success\n", __FUNCTION__); } else { failureCount++; if (useLocking) { Warning("%s: failure (lockErrors = %u)\n", __FUNCTION__, lockErrors); } else { Warning("%s: failure\n", __FUNCTION__); } } lockErrors = 0; } /* *---------------------------------------------------------------------------- * * PollUnitTest_DummyCallback -- * * Used for tickling the poll loop periodically. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void PollUnitTest_DummyCallback(void *clientData) // IN: unused { dummyCount++; } #if POLL_TESTLOCK /* *---------------------------------------------------------------------------- * * PollAddRemoveCBThread -- * * This thread continuously creates a lock, adds a poll callback that * will take the lock, removes the callback, and destroys the lock. It * is designed to race against the thread running Poll_Loop(). * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void PollAddRemoveCBThread(void *clientData) // IN: unused { Bool ret; uint32 numIters = 0; int periodicFlag[2] = { 0, POLL_FLAG_PERIODIC }; void *cbData[2] = { reinstallPoll, NULL }; uint32 prevCounts[4] = { realTimeCount, mainLoopCount, deviceRCount, deviceWCount }; uint32 perIterError[4] = { 0 }; uint32 prevDummyCount; uint32 dummyDiff; uint32 oddIter; while (!exitThread) { oddIter = numIters++ & 0x1; /* Add and remove real time and main loop callbacks */ cbLock = MXUser_CreateRecLock("pollUnitTestLock", RANK_pollUnitTestLock); VERIFY(cbLock); rtDeleted = FALSE; Poll_Callback(POLL_CS_MAIN, periodicFlag[oddIter], PollUnitTest_RealTime, cbData[oddIter], POLL_REALTIME, 5000, cbLock); mlDeleted = FALSE; Poll_Callback(POLL_CS_MAIN, periodicFlag[1 - oddIter], PollUnitTest_MainLoop, cbData[1 - oddIter], POLL_MAIN_LOOP, 0, cbLock); prevDummyCount = dummyCount; Util_Usleep(15000); /* This tells us if poll thread gets to run during our sleep. */ dummyDiff = dummyCount - prevDummyCount; MXUser_AcquireRecLock(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, periodicFlag[oddIter], PollUnitTest_RealTime, cbData[oddIter], POLL_REALTIME); rtDeleted = TRUE; MXUser_ReleaseRecLock(cbLock); ASSERT(ret); MXUser_AcquireRecLock(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, periodicFlag[1 - oddIter], PollUnitTest_MainLoop, cbData[1 - oddIter], POLL_MAIN_LOOP); mlDeleted = TRUE; MXUser_ReleaseRecLock(cbLock); ASSERT(ret); MXUser_DestroyRecLock(cbLock); if (exitThread) { break; } /* If dummyCallback fires multiple times, our callbacks should too. */ perIterError[0] += (realTimeCount - prevCounts[0] < 2 && dummyDiff > 2); perIterError[1] += (mainLoopCount - prevCounts[1] < 2 && dummyDiff > 2); prevCounts[0] = realTimeCount; prevCounts[1] = mainLoopCount; /* Add and remove device callbacks */ cbLock = MXUser_CreateRecLock("pollUnitTestLock", RANK_pollUnitTestLock); VERIFY(cbLock); drDeleted = FALSE; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | periodicFlag[oddIter], PollUnitTest_DeviceR, cbData[oddIter], POLL_DEVICE, fds[1], cbLock); dwDeleted = FALSE; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | periodicFlag[1 - oddIter], PollUnitTest_DeviceW, cbData[1 - oddIter], POLL_DEVICE, fds[1], cbLock); prevDummyCount = dummyCount; Util_Usleep(10000); dummyDiff = dummyCount - prevDummyCount; MXUser_AcquireRecLock(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | periodicFlag[oddIter], PollUnitTest_DeviceR, cbData[oddIter], POLL_DEVICE); drDeleted = TRUE; MXUser_ReleaseRecLock(cbLock); ASSERT(ret); MXUser_AcquireRecLock(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | periodicFlag[1 - oddIter], PollUnitTest_DeviceW, cbData[1 - oddIter], POLL_DEVICE); dwDeleted = TRUE; MXUser_ReleaseRecLock(cbLock); ASSERT(ret); MXUser_DestroyRecLock(cbLock); if (!exitThread) { perIterError[2] += (deviceRCount - prevCounts[2] < 2 && dummyDiff > 2); perIterError[3] += (deviceWCount - prevCounts[3] < 2 && dummyDiff > 2); prevCounts[2] = deviceRCount; prevCounts[3] = deviceWCount; } } cbLock = NULL; PollUnitTest_TestResult(perIterError[0] == 0 && perIterError[1] == 0 && perIterError[2] == 0 && perIterError[3] == 0); } #ifdef _WIN32 /* *---------------------------------------------------------------------------- * * PollLockContentionThread -- * * Create lock contention on cbLock. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void PollLockContentionThread(void *clientData) // IN: unused { rqContext *rCtxt = Random_QuickSeed((uint32)time(NULL)); while (!exitThread) { MXUser_AcquireRecLock(cbLock); Sleep(Random_Quick(rCtxt) % 5); MXUser_ReleaseRecLock(cbLock); Sleep(Random_Quick(rCtxt) % 5 + 10); } } #endif #endif // POLL_TESTLOCK /* *----------------------------------------------------------------------------- * * PollUnitTest_StateMachine -- * * State machine. The heart of Poll's unit test. Sequentially run all * tests. * * Results: * None * * Side effects: * Outputs the result of the tests with Warning(). * *----------------------------------------------------------------------------- */ static void PollUnitTest_StateMachine(void *clientData) // IN: Unused { #if POLL_TESTLOCK static VThreadID cbRaceThread; static unsigned int raceTestIter; #endif static unsigned int queueTestIter; #ifdef _WIN32 static unsigned int eventTestIter; #endif static unsigned int maxInetSockets; static unsigned int maxVMCISockets; static unsigned int queueLen; Bool ret; int i, retval; int queueReads = 0; #ifdef _WIN32 maxVMCISockets = MAXIMUM_WAIT_OBJECTS - 2; #else maxVMCISockets = 60; #endif isVMX = VThread_CurID() == VTHREAD_VMX_ID; queueLen = isVMX ? MAX_VMX_QUEUE_LENGTH : MAX_QUEUE_LENGTH; switch (state) { case 0: Warning("%s: Poll unit test: start%s%s\n", __FUNCTION__, testVMCI ? " vmci tests" : "", useLocking ? " locking tests" : ""); Warning("%s: Testing RealTime 0 0\n", __FUNCTION__); realTimeCount = 0; Poll_Callback(POLL_CS_MAIN, 0, PollUnitTest_RealTime, NULL, POLL_REALTIME, 0, cbLock); state++; break; case 1: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, 0, PollUnitTest_RealTime, NULL, POLL_REALTIME); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && realTimeCount == 1); state++; break; case 2: Warning("%s: Testing RealTime 1 0\n", __FUNCTION__); realTimeCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_RealTime, NULL, POLL_REALTIME, 100000, cbLock); state++; break; case 3: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_RealTime, NULL, POLL_REALTIME); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && realTimeCount > 1); state++; break; case 4: Warning("%s: Testing RealTime 0 1\n", __FUNCTION__); realTimeCount = 0; Poll_Callback(POLL_CS_MAIN, 0, PollUnitTest_RealTime, reinstallPoll, POLL_REALTIME, 0, cbLock); state++; break; case 5: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, 0, PollUnitTest_RealTime, reinstallPoll, POLL_REALTIME); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && realTimeCount > 1); state++; break; case 6: Warning("%s: Testing RealTime 1 1\n", __FUNCTION__); realTimeCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_RealTime, removePoll, POLL_REALTIME, 100000, cbLock); state++; break; case 7: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_RealTime, NULL, POLL_REALTIME); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && realTimeCount == 1); state++; break; case 8: Warning("%s: Testing MainLoop 0 0\n", __FUNCTION__); /* * A periodic real time callback ensures that we go over the main loop * queue more than once for the duration of each state. */ Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_DummyCallback, NULL, POLL_REALTIME, 100000, NULL); mainLoopCount = 0; Poll_Callback(POLL_CS_MAIN, 0, PollUnitTest_MainLoop, NULL, POLL_MAIN_LOOP, 0, cbLock); state++; break; case 9: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, 0, PollUnitTest_MainLoop, NULL, POLL_MAIN_LOOP); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && mainLoopCount == 1); state++; break; case 10: Warning("%s: Testing MainLoop 1 0\n", __FUNCTION__); mainLoopCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_MainLoop, NULL, POLL_MAIN_LOOP, 0, cbLock); state++; break; case 11: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_MainLoop, NULL, POLL_MAIN_LOOP); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && mainLoopCount > 1); state++; break; case 12: Warning("%s: Testing MainLoop 0 1\n", __FUNCTION__); mainLoopCount = 0; Poll_Callback(POLL_CS_MAIN, 0, PollUnitTest_MainLoop, reinstallPoll, POLL_MAIN_LOOP, 0, cbLock); state++; break; case 13: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, 0, PollUnitTest_MainLoop, reinstallPoll, POLL_MAIN_LOOP); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && mainLoopCount > 1); state++; break; case 14: Warning("%s: Testing MainLoop 1 1\n", __FUNCTION__); mainLoopCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_MainLoop, removePoll, POLL_MAIN_LOOP, 0, cbLock); state++; break; case 15: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_MainLoop, removePoll, POLL_MAIN_LOOP); DROP_LOCK(cbLock); Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_DummyCallback, NULL, POLL_REALTIME); PollUnitTest_TestResult(ret == FALSE && mainLoopCount == 1); state++; break; case 16: Warning("%s: Testing DeviceR 0 0\n", __FUNCTION__); deviceRCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceR, NULL, POLL_DEVICE, fds[1], cbLock); state++; break; case 17: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceR, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && deviceRCount == 1); state++; break; case 18: Warning("%s: Testing DeviceR 1 0\n", __FUNCTION__); deviceRCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, NULL, POLL_DEVICE, fds[1], cbLock); state++; break; case 19: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceRCount > 1); state++; break; case 20: Warning("%s: Testing DeviceR 0 1\n", __FUNCTION__); deviceRCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceR, reinstallPoll, POLL_DEVICE, fds[1], cbLock); state++; break; case 21: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceR, reinstallPoll, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceRCount > 1); state++; break; case 22: Warning("%s: Testing DeviceR 1 1\n", __FUNCTION__); deviceRCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, removePoll, POLL_DEVICE, fds[1], cbLock); state++; break; case 23: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, removePoll, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && deviceRCount == 1); state++; break; case 24: Warning("%s: Testing DeviceW 0 0\n", __FUNCTION__); deviceWCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, NULL, POLL_DEVICE, fds[1], cbLock); state++; break; case 25: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && deviceWCount == 1); state++; break; case 26: Warning("%s: Testing DeviceW 1 0\n", __FUNCTION__); deviceWCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, NULL, POLL_DEVICE, fds[1], cbLock); state++; break; case 27: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceWCount > 1); state++; break; case 28: Warning("%s: Testing DeviceW 0 1\n", __FUNCTION__); deviceWCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, reinstallPoll, POLL_DEVICE, fds[1], cbLock); state++; break; case 29: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, reinstallPoll, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceWCount > 1); state++; break; case 30: Warning("%s: Testing DeviceW 1 1\n", __FUNCTION__); deviceWCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, removePoll, POLL_DEVICE, fds[1], cbLock); state++; break; case 31: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, removePoll, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && deviceWCount == 1); state++; break; case 32: Warning("%s: Testing Device add R, add W, remove R, remove W\n", __FUNCTION__); deviceRCount = 0; deviceWCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, NULL, POLL_DEVICE, fds[1], cbLock); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, NULL, POLL_DEVICE, fds[1], cbLock); state++; break; case 33: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceRCount > 1 && deviceWCount > 1); deviceRCount = 0; deviceWCount = 0; state++; break; case 34: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceRCount == 0 && deviceWCount > 1); state++; break; case 35: Warning("%s: Testing Device add R, add W, remove W, remove R\n", __FUNCTION__); deviceRCount = 0; deviceWCount = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, NULL, POLL_DEVICE, fds[1], cbLock); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, NULL, POLL_DEVICE, fds[1], cbLock); state++; break; case 36: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE | POLL_FLAG_PERIODIC, PollUnitTest_DeviceW, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceRCount > 1 && deviceWCount > 1); deviceRCount = 0; deviceWCount = 0; state++; break; case 37: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceR, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceWCount == 0 && deviceRCount > 1); state++; #ifndef _WIN32 // The next test only makes sense on Windows. state += 3; #endif break; #ifdef _WIN32 case 38: Warning("%s: Testing connecting socket\n", __FUNCTION__); closesocket(fds[0]); closesocket(fds[1]); fds[0] = INVALID_SOCKET; fds[1] = INVALID_SOCKET; deviceWCount = 0; boundSocket = PollSocketPairStartConnecting(testVMCI, TRUE, FALSE, (SOCKET *)&fds[0]); if (boundSocket == INVALID_SOCKET) { Warning("%s: failure -- error creating socket pair\n", __FUNCTION__); state += 3; } else { Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, NULL, POLL_DEVICE, fds[0], cbLock); state++; } break; case 39: fds[1] = accept(boundSocket, NULL, NULL); if (fds[1] == INVALID_SOCKET) { Warning("%s: Error accepting socket %d: %d/%s\n", __FUNCTION__, boundSocket, WSAGetLastError(), Err_ErrString()); } state++; break; case 40: GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_WRITE, PollUnitTest_DeviceW, NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == FALSE && deviceWCount >= 1); state++; break; #endif case 41: maxInetSockets = testVMCI ? queueLen - maxVMCISockets : queueLen; Warning("%s: Testing queue size %d\n", __FUNCTION__, queueLen); deviceRCount = 0; queueTestIter = 0; queueReads = 0; for (i = 0; i < queueLen; i++) { Bool useVMCI = i >= maxInetSockets; #ifdef _WIN32 socketPairs[i].fds[0] = INVALID_SOCKET; socketPairs[i].fds[1] = INVALID_SOCKET; if (Poll_SocketPair(useVMCI, TRUE, socketPairs[i].fds) < 0) { Warning("%s: failure -- error creating socketpair, iteration %d\n", __FUNCTION__, i); break; } send(socketPairs[i].fds[0], (const char *)fds, sizeof fds, 0); #else int addrFamily = useVMCI ? VMCISock_GetAFValue(): AF_UNIX; socketPairs[i].fds[0] = -1; socketPairs[i].fds[1] = -1; if (socketpair(addrFamily, SOCK_STREAM, 0, socketPairs[i].fds) < 0) { Warning("%s: failure -- error creating socketpair, iteration %d\n", __FUNCTION__, i); break; } retval = write(socketPairs[i].fds[0], fds, 1); #endif socketPairs[i].count = 0; Poll_Callback(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceRQ, (void *)(intptr_t)i, POLL_DEVICE, socketPairs[i].fds[1], cbLock); } state++; break; case 42: if (++queueTestIter >= queueLen / 1000) { state++; } break; case 43: Warning("%s: %d reads completed\n", __FUNCTION__, deviceRCount); for (i = 0; i < queueLen; i++) { if (socketPairs[i].count) { queueReads++; } GRAB_LOCK(cbLock); Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_SOCKET | POLL_FLAG_READ, PollUnitTest_DeviceRQ, (void *)(intptr_t)i, POLL_DEVICE); DROP_LOCK(cbLock); #ifdef _WIN32 closesocket(socketPairs[i].fds[0]); closesocket(socketPairs[i].fds[1]); #else close(socketPairs[i].fds[0]); close(socketPairs[i].fds[1]); #endif } Warning("%s: read %d sockets at least once.\n", __FUNCTION__, queueReads); PollUnitTest_TestResult(deviceRCount > queueLen); state++; break; case 44: #if POLL_TESTVMCI /* * The following tests only work inside the guest, * as stream VSockets are unsuported for host<->host communication. */ if (!useLocking && !testVMCI) { testVMCI = TRUE; #ifdef _WIN32 /* Discard sockets used in connect test and re-create them. */ closesocket(fds[0]); closesocket(fds[1]); fds[0] = INVALID_SOCKET; fds[1] = INVALID_SOCKET; if (Poll_SocketPair(TRUE, TRUE, fds) < 0) { Warning("%s: failure -- error creating vmci socketpair\n", __FUNCTION__); state ++; break; } send(fds[0], (const char *)fds, sizeof fds, 0); #else close(fds[0]); close(fds[1]); fds[0] = -1; fds[1] = -1; if (socketpair(VMCISock_GetAFValue(), SOCK_STREAM, 0, fds) < 0) { Warning("%s: failure -- error creating vsock socketpair\n", __FUNCTION__); break; } retval = write(fds[0], fds, 0); #endif state = 0; break; } else { testVMCI = FALSE; state++; // fall through to next test } #else state++; #endif case 45: #if POLL_TESTLOCK if (useLocking == FALSE) { useLocking = TRUE; cbLock = MXUser_CreateRecLock("pollUnitTestLock", RANK_pollUnitTestLock); VERIFY(cbLock); #ifdef _WIN32 /* Discard sockets used in connect test and re-create them. */ closesocket(fds[0]); closesocket(fds[1]); fds[0] = INVALID_SOCKET; fds[1] = INVALID_SOCKET; if (Poll_SocketPair(FALSE, TRUE, fds) < 0) { Warning("%s: failure -- error creating socketpair\n", __FUNCTION__); state += 3; break; } send(fds[0], (const char *)fds, sizeof fds, 0); #endif state = 0; break; } else { state++; // fall through to next test } case 46: /* * This test requires a poll implementation that supports locking * for both the internal poll state and the callbacks. It also uses * VThread. */ Warning("%s: Testing add/remove callback and Poll_Loop race (about %u s)\n", __FUNCTION__, NUM_TEST_ITERS); #ifdef _WIN32 closesocket(fds[0]); closesocket(fds[1]); fds[0] = INVALID_SOCKET; fds[1] = INVALID_SOCKET; if (Poll_SocketPair(FALSE, TRUE, fds) < 0) #else close(fds[0]); close(fds[1]); fds[0] = -1; fds[1] = -1; if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) #endif { Warning("%s: failure -- error creating socketpair\n", __FUNCTION__); state += 3; break; } /* Make fds[1] both readable and writable. */ #ifdef _WIN32 send(fds[0], (const char *)fds, sizeof fds, 0); #else retval = write(fds[0], fds, 1); #endif MXUser_DestroyRecLock(cbLock); cbLock = NULL; realTimeCount = 0; mainLoopCount = 0; deviceRCount = 0; deviceWCount = 0; rtCbRace = 0; mlCbRace = 0; drCbRace = 0; dwCbRace = 0; realTimeCount = 0; mainLoopCount = 0; deviceRCount = 0; deviceWCount = 0; raceTestIter = 0; dummyCount = 0; exitThread = FALSE; cbRaceThread = VThread_CreateThread(PollAddRemoveCBThread, NULL, VTHREAD_INVALID_ID, "PollAddRemoveCBThread"); if (cbRaceThread == VTHREAD_INVALID_ID) { Warning("%s: failure -- error creating thread\n", __FUNCTION__); state += 3; break; } Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_DummyCallback, NULL, POLL_REALTIME, 5000, NULL); state++; break; case 47: if (++raceTestIter == NUM_TEST_ITERS) { state++; } break; case 48: Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_DummyCallback, NULL, POLL_REALTIME); exitThread = TRUE; VThread_WaitThread(cbRaceThread); VThread_DestroyThread(cbRaceThread); PollUnitTest_TestResult(rtCbRace == 0 && mlCbRace == 0 && drCbRace == 0 && dwCbRace == 0); state++; #ifndef _WIN32 // The next test only makes sense on Windows. state += 3; #endif break; #ifdef _WIN32 case 49: Warning("%s: Testing event-based device callbacks with lock contention\n", __FUNCTION__); if (!cbLock) { /* The previous test may have destroyed the lock. */ cbLock = MXUser_CreateRecLock("pollUnitTestLock", RANK_pollUnitTestLock); VERIFY(cbLock); } deviceEv0Count = 0; deviceEv1Count = 0; eventTestIter = 0; exitThread = FALSE; cbRaceThread = VThread_CreateThread(PollLockContentionThread, NULL, VTHREAD_INVALID_ID, "PollLockContention"); if (cbRaceThread == VTHREAD_INVALID_ID) { Warning("%s: failure -- error creating thread\n", __FUNCTION__); state += 3; break; } events[0] = CreateEvent(NULL, FALSE, TRUE, NULL); VERIFY(events[0]); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceEvent NULL, POLL_DEVICE, (PollDevHandle)events[0], cbLock); events[1] = CreateEvent(NULL, FALSE, TRUE, NULL); VERIFY(events[1]); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_READ, PollUnitTest_DeviceEvent reinstallPoll, POLL_DEVICE, (PollDevHandle)events[1], cbLock); state++; break; case 50: if (++eventTestIter == 2) { state++; } break; case 51: exitThread = TRUE; VThread_WaitThread(cbRaceThread); VThread_DestroyThread(cbRaceThread); GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_READ | POLL_FLAG_PERIODIC, PollUnitTest_DeviceEvent NULL, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceEv0Count > 1); GRAB_LOCK(cbLock); ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_READ, PollUnitTest_DeviceEvent reinstallPoll, POLL_DEVICE); DROP_LOCK(cbLock); PollUnitTest_TestResult(ret == TRUE && deviceEv1Count > 1); CloseHandle(events[0]); CloseHandle(events[1]); state++; break; #endif // _WIN32 #endif // POLL_TESTLOCK (#else fall through) case 52: ret = Poll_CallbackRemove(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_StateMachine, NULL, POLL_REALTIME); ASSERT(ret); Warning("%s: Poll unit test: stop, %u successes, %u failures\n", __FUNCTION__, successCount, failureCount); if (cbLock) { MXUser_DestroyRecLock(cbLock); } #ifdef _WIN32 closesocket(fds[0]); closesocket(fds[1]); WSACleanup(); #else close(fds[0]); close(fds[1]); #endif break; } } /* *----------------------------------------------------------------------------- * * PollUnitTest -- * * Start the unit test suite for an implementation of the Poll_* API. It * will stop by itself. * * Results: * None * * Side effects: * Outputs the result of the tests with Warning(). * *----------------------------------------------------------------------------- */ void PollUnitTest(void) { #ifdef _WIN32 WSADATA wsaData; WORD versionRequested = MAKEWORD(2, 0); int ret; #endif int retval; state = 0; successCount = failureCount = 0; useLocking = FALSE; #ifdef _WIN32 ret = WSAStartup(versionRequested, &wsaData); if (ret != 0) { Warning("%s: Error in WSAStartup: %d\n", __FUNCTION__, ret); return; } fds[0] = INVALID_SOCKET; fds[1] = INVALID_SOCKET; if (Poll_SocketPair(FALSE, TRUE, fds) < 0) { #else fds[0] = -1; fds[1] = -1; if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { #endif Warning("%s: socketpair failed\n", __FUNCTION__); return; } // Make fds[1] both readable and writable. #ifdef _WIN32 retval = send(fds[0], (const char *)fds, sizeof fds, 0); #else retval = write(fds[0], fds, 1); #endif Warning("%s: Starting\n", __FUNCTION__); Poll_Callback(POLL_CS_MAIN, POLL_FLAG_PERIODIC, PollUnitTest_StateMachine, NULL, POLL_REALTIME, 1000000 /* 1 s. */, NULL); } #endif // POLL_UNITTEST open-vm-tools-10.0.7-3227872/lib/poll/Makefile.in0000644000000000000000000004020512660700526017436 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/poll DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libPoll_la_LIBADD = am_libPoll_la_OBJECTS = poll.lo libPoll_la_OBJECTS = $(am_libPoll_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libPoll_la_SOURCES) DIST_SOURCES = $(libPoll_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libPoll.la libPoll_la_SOURCES = poll.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/poll/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/poll/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libPoll.la: $(libPoll_la_OBJECTS) $(libPoll_la_DEPENDENCIES) $(LINK) $(libPoll_la_OBJECTS) $(libPoll_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/err/0000755000000000000000000000000012660700525015211 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/err/Makefile.am0000644000000000000000000000175512660700525017255 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libErr.la libErr_la_SOURCES = libErr_la_SOURCES += err.c libErr_la_SOURCES += errPosix.c open-vm-tools-10.0.7-3227872/lib/err/errInt.h0000644000000000000000000000231712660700525016630 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * errInt.h -- * * Internal definitions for the Err module. */ #ifndef _ERRINT_H_ #define _ERRINT_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "err.h" const char *ErrErrno2String(Err_Number errorNumber, char *buf, size_t bufSize); #endif // ifndef _ERRINT_H_ open-vm-tools-10.0.7-3227872/lib/err/errPosix.c0000644000000000000000000000365312660700525017177 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * errPosix.c -- * * Posix error handling library * */ #if defined __linux__ /* Force GNU strerror_r prototype instead of Posix prototype */ # define _GNU_SOURCE #endif #include #include #include #include "vmware.h" #include "errInt.h" #include "util.h" #include "str.h" /* *---------------------------------------------------------------------- * * ErrErrno2String -- * * Convert an error number to a string in English. * The returned string may use the supplied buffer or may be * a static string. * * Results: * The error string. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * ErrErrno2String(Err_Number errorNumber, // IN char *buf, // OUT: return buffer size_t bufSize) // IN: size of buffer { char *p; #if defined(linux) && !defined(N_PLAT_NLM) && !defined(__ANDROID__) p = strerror_r(errorNumber, buf, bufSize); #else p = strerror(errorNumber); #endif ASSERT(p != NULL); return p; } open-vm-tools-10.0.7-3227872/lib/err/Makefile.in0000644000000000000000000004032212660700525017257 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/err DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libErr_la_LIBADD = am_libErr_la_OBJECTS = err.lo errPosix.lo libErr_la_OBJECTS = $(am_libErr_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libErr_la_SOURCES) DIST_SOURCES = $(libErr_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libErr.la libErr_la_SOURCES = err.c errPosix.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/err/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/err/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libErr.la: $(libErr_la_OBJECTS) $(libErr_la_DEPENDENCIES) $(LINK) $(libErr_la_OBJECTS) $(libErr_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/err.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errPosix.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/err/err.c0000644000000000000000000001644712660700525016161 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * err.c -- * * General error handling library * */ #include "vmware.h" #include "errInt.h" #include "str.h" #include "vm_atomic.h" #include "hashTable.h" #include "util.h" #include "codeset.h" /* * Constants */ #define HASHTABLE_SIZE 2048 /* * Types */ typedef struct ErrInfo { Err_Number number; char *string; } ErrInfo; /* * Variables */ /* * We statically link lib/err in several libraries. This means that a * single binary may have several copies of lib/err. These pointers are * not static so that we have one copy across the entire binary. */ Atomic_Ptr errNumTable; Atomic_Ptr errPtrTable; #if defined VMX86_DEBUG && defined __linux__ Atomic_Ptr errStrTable; #endif #define NUMTABLE() HashTable_AllocOnce(&errNumTable, HASHTABLE_SIZE, \ HASH_INT_KEY | HASH_FLAG_ATOMIC, NULL) #define PTRTABLE() HashTable_AllocOnce(&errPtrTable, HASHTABLE_SIZE, \ HASH_INT_KEY | HASH_FLAG_ATOMIC, NULL) #if defined VMX86_DEBUG && defined __linux__ #define STRTABLE() HashTable_AllocOnce(&errStrTable, HASHTABLE_SIZE, \ HASH_STRING_KEY | HASH_FLAG_ATOMIC, \ NULL) #endif /* *---------------------------------------------------------------------- * * Err_ErrString -- * * Returns a string that corresponds to the last error message. * The error number used is that which is native to the platform, * errno on POSIXen and GetLastError on Windows. * * Results: * Error message string. * * Side effects: * None. * Current error number is preserved. * *---------------------------------------------------------------------- */ const char * Err_ErrString(void) { return Err_Errno2String(Err_Errno()); } /* *---------------------------------------------------------------------- * * Err_Errno2String -- * * Return a string that corresponds to the passed error number. * The error number used is that which is native to the platform, * errno on POSIXen and GetLastError on Windows. * * The string is in English in UTF-8, has indefinite lifetime, * and need not be freed. * * Results: * Error message string in UTF-8. * * Side effects: * None. * Current error number is preserved. * *---------------------------------------------------------------------- */ const char * Err_Errno2String(Err_Number errorNumber) // IN { HashTable *numTable; HashTable *ptrTable; ErrInfo *info; ErrInfo *oldInfo; Err_Number oldErrno = Err_Errno(); ASSERT(errorNumber != ERR_INVALID); /* * Look up the error in numTable. * Or insert it if it's not there. */ numTable = NUMTABLE(); if (!HashTable_Lookup(numTable, (void *) (uintptr_t) errorNumber, (void **) &info)) { char buf[2048]; const char *p; size_t n; /* * Convert number to string and build the info structure. */ p = ErrErrno2String(errorNumber, buf, sizeof buf); info = Util_SafeMalloc(sizeof *info); info->number = errorNumber; info->string = Util_SafeStrdup(p); /* * To be safe, make sure the end of the string is at * a UTF-8 boundary, but we can only do this when the * string is in our buffer (it may not be). */ n = strlen(info->string); n = CodeSet_Utf8FindCodePointBoundary(info->string, n); info->string[n] = '\0'; /* * Try to insert new info into numTable. * If that fails, then we must have lost out to someone else. * Use theirs in that case. */ oldInfo = HashTable_LookupOrInsert(numTable, (void *) (uintptr_t) errorNumber, info); if (oldInfo != info) { ASSERT(oldInfo->number == info->number); ASSERT(Str_Strcmp(oldInfo->string, info->string) == 0); free(info->string); free(info); info = oldInfo; } } /* * Try to insert info into ptrTable. * We need to do it even if we didn't create this entry, * because we may get here before the other guy (who created * the entry and inserted it into numTable). */ ptrTable = PTRTABLE(); oldInfo = HashTable_LookupOrInsert(ptrTable, info->string, info); ASSERT(oldInfo == info); #if defined VMX86_DEBUG && defined __linux__ { HashTable *strTable = STRTABLE(); ErrInfo *i = HashTable_LookupOrInsert(strTable, info->string, info); ASSERT(i == info); } #endif Err_SetErrno(oldErrno); return info->string; } /* *---------------------------------------------------------------------- * * Err_String2Errno -- * * Return an error number that corresponds to the passed string. * The error number used is that which is native to the platform, * errno on POSIXen and GetLastError on Windows. * * To be recognized, the string must be one previously returned * by Err_Errno2String. Any other string (even a copy of * a valid error string) returns ERR_INVALID. * * Results: * Error number or ERR_INVALID. * * Side effects: * None. * *---------------------------------------------------------------------- */ Err_Number Err_String2Errno(const char *string) // IN { HashTable *ptrTable = PTRTABLE(); ErrInfo *info; if (!HashTable_Lookup(ptrTable, string, (void **) &info)) { return ERR_INVALID; } ASSERT(info->string == string); ASSERT(info->number != ERR_INVALID); return info->number; } #ifdef VMX86_DEBUG /* *---------------------------------------------------------------------- * * Err_String2ErrnoDebug -- * * Return an error number that corresponds to the passed string. * * This is the debug version that uses the whole string as key, * instead of just the address. * * Results: * Error number or ERR_INVALID. * * Side effects: * None. * *---------------------------------------------------------------------- */ Err_Number Err_String2ErrnoDebug(const char *string) // IN { #ifdef __linux__ HashTable *strTable = STRTABLE(); ErrInfo *info; if (!HashTable_Lookup(strTable, string, (void **) &info)) { return ERR_INVALID; } ASSERT(Str_Strcmp(info->string, string) == 0); ASSERT(info->number != ERR_INVALID); if (info->string != string) { Log("%s: errno %d, string \"%s\" at %p, originally at %p.\n", __FUNCTION__, info->number, string, string, info->string); } return info->number; #else return ERR_INVALID; #endif } #endif open-vm-tools-10.0.7-3227872/lib/vmSignal/0000755000000000000000000000000012660700526016202 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/vmSignal/Makefile.am0000644000000000000000000000174112660700526020241 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libVmSignal.la libVmSignal_la_SOURCES = libVmSignal_la_SOURCES += vmsignal.c open-vm-tools-10.0.7-3227872/lib/vmSignal/vmsignal.c0000644000000000000000000000601512660700526020170 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * vmsignal.c -- * * Posix signal handling utility functions * */ #ifndef VMX86_DEVEL #endif #include #include #include #include "vmsignal.h" /* * Signal_SetGroupHandler -- * * Set a signal handler for a group of signals. * We carefully ensure that if the handler is only used to handle the * signals of the group, the handling of all the signals of the group is * serialized, which means that the handler is not re-entrant. * * Return value: * 1 on success * 0 on failure (detail is displayed) * * Side effects: * None * */ int Signal_SetGroupHandler(int const *signals, // IN struct sigaction *olds, // OUT unsigned int nr, // IN void (*handler)(int signal)) // IN { unsigned int i; struct sigaction new; new.sa_handler = handler; if (sigemptyset(&new.sa_mask)) { fprintf(stderr, "Unable to empty a signal set: %s.\n\n", strerror(errno)); return 0; } for (i = 0; i < nr; i++) { if (sigaddset(&new.sa_mask, signals[i])) { fprintf(stderr, "Unable to add a signal to a signal set: %s.\n\n", strerror(errno)); return 0; } } new.sa_flags = 0; for (i = 0; i < nr; i++) { if (sigaction(signals[i], &new, &olds[i])) { fprintf(stderr, "Unable to modify the handler of the signal %d: %s.\n\n", signals[i], strerror(errno)); return 0; } } return 1; } /* * Signal_ResetGroupHandler -- * * Reset the handler of each signal of a group of signals * * Return value: * 1 on success * 0 on failure (detail is displayed) * * Side effects: * None * */ int Signal_ResetGroupHandler(int const *signals, // IN struct sigaction const *olds, // IN unsigned int nr) // IN { unsigned int i; for (i = 0; i < nr; i++) { if (sigaction(signals[i], &olds[i], NULL)) { fprintf(stderr, "Unable to reset the handler of the signal %d: %s.\n\n", signals[i], strerror(errno)); return 0; } } return 1; } open-vm-tools-10.0.7-3227872/lib/vmSignal/Makefile.in0000644000000000000000000004032112660700526020247 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/vmSignal DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libVmSignal_la_LIBADD = am_libVmSignal_la_OBJECTS = vmsignal.lo libVmSignal_la_OBJECTS = $(am_libVmSignal_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libVmSignal_la_SOURCES) DIST_SOURCES = $(libVmSignal_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libVmSignal.la libVmSignal_la_SOURCES = vmsignal.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/vmSignal/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/vmSignal/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libVmSignal.la: $(libVmSignal_la_OBJECTS) $(libVmSignal_la_DEPENDENCIES) $(LINK) $(libVmSignal_la_OBJECTS) $(libVmSignal_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsignal.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/rpcVmx/0000755000000000000000000000000012660700526015701 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/rpcVmx/Makefile.am0000644000000000000000000000173112660700526017737 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libRpcVmx.la libRpcVmx_la_SOURCES = libRpcVmx_la_SOURCES += rpcvmx.c open-vm-tools-10.0.7-3227872/lib/rpcVmx/rpcvmx.c0000644000000000000000000001720412660700526017370 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include #include #include #include #include "guest_msg_def.h" #include "message.h" #include "rpcout.h" #include "rpcvmx.h" #include "str.h" typedef struct { char logBuf[RPCVMX_MAX_LOG_LEN + sizeof "log"]; unsigned int logOffset; } RpcVMXState; static RpcVMXState RpcVMX = { "log ", sizeof "log" }; /* *---------------------------------------------------------------------------- * * RpcVMX_LogSetPrefix * * Allows callers to set a prefix to prepend to the log output. If the * prefix overflows the (static) prefix space available, it is rejected * and the prefix is reset to nothing. Each call to VMXLog_SetPrefix * replaces the previously set prefix. * * Results: * TRUE if the prefix was accepted, FALSE otherwise. * * Side effects: * All subsequent calls to RpcVMX_Log() will have the prefix string * prepended. * *---------------------------------------------------------------------------- */ void RpcVMX_LogSetPrefix(const char *prefix) { size_t prefixLen = strlen(prefix); if (prefixLen + sizeof "log" >= sizeof RpcVMX.logBuf - 1) { /* * Somebody passed a huge prefix. Don't do that! */ RpcVMX.logOffset = sizeof "log"; return; } Str_Strcpy(RpcVMX.logBuf + sizeof "log", prefix, sizeof RpcVMX.logBuf - sizeof "log"); RpcVMX.logOffset = (unsigned int)(sizeof "log" + prefixLen); } /* *---------------------------------------------------------------------------- * * RpcVMX_LogGetPrefix -- * * Returns a read-only pointer to the currently set prefix string. The * client should make a copy if it wants to e.g. save the previous * prefix and then restore it. * * Results: * Current prefix string, empty string if no prefix is set. * * Side effects: * None. * *---------------------------------------------------------------------------- */ const char * RpcVMX_LogGetPrefix(const char *prefix) { UNUSED_VARIABLE(prefix); RpcVMX.logBuf[RpcVMX.logOffset] = '\0'; return RpcVMX.logBuf + sizeof "log"; } /* *---------------------------------------------------------------------------- * * RpcVMX_Log -- * * Passes through to RpcVMX_LogV but takes arguments inline. * * Results: * None. * * Side effects: * See RpcVMX_LogV. * *---------------------------------------------------------------------------- */ void RpcVMX_Log(const char *fmt, ...) { va_list args; va_start(args, fmt); RpcVMX_LogV(fmt, args); va_end(args); } /* *---------------------------------------------------------------------------- * * RpcVMX_LogV -- * * Construct an output string using the provided format string and * argument list, then send it to the VMX using the RPCI "log" command. * * Results: * None. * * Side effects: * Sends the log command described above. * *---------------------------------------------------------------------------- */ void RpcVMX_LogV(const char *fmt, va_list args) { int payloadLen; char receiveBuffer[16]; payloadLen = Str_Vsnprintf(RpcVMX.logBuf + RpcVMX.logOffset, sizeof RpcVMX.logBuf - RpcVMX.logOffset, fmt, args); if (payloadLen < 1) { /* * Overflow. We need more space in the buffer. Just set the length to * the buffer size and send the (truncated) log message. */ payloadLen = sizeof RpcVMX.logBuf - RpcVMX.logOffset; } /* * Use a pre-allocated receive buffer so that it's possible to * perform the log without needing to call malloc. This makes * RpcVMX_LogV suitable to be used in Windows kernel interrupt * handlers. (It also makes it faster.) The log command only ever * returns two character strings "1 " on success and "0 " on * failure, so we don't need a sizeable buffer. */ RpcOut_SendOneRawPreallocated(RpcVMX.logBuf, RpcVMX.logOffset + payloadLen, receiveBuffer, sizeof receiveBuffer); } /* *---------------------------------------------------------------------------- * * RpcVMX_ConfigGetString -- * * Look up a config variable in the VMX's config file and return its * value as a string. The caller should free the string using free() when * done. * * Results: * The value of the variable if it was set, or a copy of the default * value string if the variable was not set. * * Side effects: * Allocates memory which the caller must free(). * *---------------------------------------------------------------------------- */ char * RpcVMX_ConfigGetString(const char *defval, const char *var) { char *value; if (!RpcOut_sendOne(&value, NULL, "info-get guestinfo.%s", var)) { /* Get rid of the old value first. */ free(value); value = NULL; if (defval) { /* * We have to dup the default, because of our contract: values we * return must always be freed by the caller. */ value = strdup(defval); } } return value; } /* *---------------------------------------------------------------------------- * * RpcVMX_ConfigGetBool -- * * Same as RpcVMX_ConfigGetString, but convert the value to a boolean * and return it. * * Results: * Value of config variable as a Bool, or the default value if the config * variable was not set *or* could not be converted to a Bool. * * Side effects: * Perturbs the heap. * *---------------------------------------------------------------------------- */ Bool RpcVMX_ConfigGetBool(Bool defval, const char *var) { char *value = RpcVMX_ConfigGetString(NULL, var); Bool ret = defval; if (value) { if (!Str_Strcasecmp(value, "TRUE")) { ret = TRUE; } else if (!Str_Strcasecmp(value, "FALSE")) { ret = FALSE; } free(value); } return ret; } /* *---------------------------------------------------------------------------- * * RpcVMX_ConfigGetLong -- * * Same as RpcVMX_ConfigGetString, but convert the value to an integer. * XXX We use atoi, so there's no error checking. If you care, use * RpcVMX_ConfigGetString and do the conversion yourself. * * Results: * The value of the config variable as a 32-bit integer if it was set, * the default value if it was not set, and 0 if there was an error * converting the value to an integer. * * Side effects: * Perturbs the heap. * *---------------------------------------------------------------------------- */ int32 RpcVMX_ConfigGetLong(int32 defval, const char *var) { char *value = RpcVMX_ConfigGetString(NULL, var); int32 ret = defval; if (value) { ret = atoi(value); free(value); } return ret; } open-vm-tools-10.0.7-3227872/lib/rpcVmx/Makefile.in0000644000000000000000000004025312660700526017752 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/rpcVmx DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libRpcVmx_la_LIBADD = am_libRpcVmx_la_OBJECTS = rpcvmx.lo libRpcVmx_la_OBJECTS = $(am_libRpcVmx_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libRpcVmx_la_SOURCES) DIST_SOURCES = $(libRpcVmx_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libRpcVmx.la libRpcVmx_la_SOURCES = rpcvmx.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/rpcVmx/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/rpcVmx/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libRpcVmx.la: $(libRpcVmx_la_OBJECTS) $(libRpcVmx_la_DEPENDENCIES) $(LINK) $(libRpcVmx_la_OBJECTS) $(libRpcVmx_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpcvmx.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/appUtil/0000755000000000000000000000000012660700525016037 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/appUtil/appUtil.c0000644000000000000000000000457712660700525017636 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * appUtil.c -- * * Utility functions for guest applications. */ #include "appUtil.h" #include #include #include "vmware.h" #include "appUtil.h" #include "debug.h" #include "rpcout.h" #include "str.h" /* *---------------------------------------------------------------------------- * * AppUtil_SendGuestCaps -- * * Send a list of guest capabilities to the host. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void AppUtil_SendGuestCaps(const GuestCapabilities *caps, // IN: array of capabilities size_t numCaps, // IN: number of capabilities Bool enabled) // IN: capabilities status { char *capsStr = NULL; char *capsTemp = NULL; size_t capIdx; ASSERT(caps); ASSERT(numCaps > 0); capsStr = strdup(GUEST_CAP_FEATURES); for (capIdx = 0; capIdx < numCaps; capIdx++) { if (!capsStr) { Debug("%s: Not enough memory to create capabilities string\n", __FUNCTION__); return; } capsTemp = Str_Asprintf(NULL, "%s %d=%d", capsStr, caps[capIdx], (int)enabled); free(capsStr); capsStr = capsTemp; } if (!RpcOut_sendOne(NULL, NULL, capsStr)) { Debug("%s: could not set capabilities: older vmx?\n", __FUNCTION__); } free(capsStr); } open-vm-tools-10.0.7-3227872/lib/appUtil/Makefile.am0000644000000000000000000000203712660700525020075 0ustar rootroot################################################################################ ### Copyright (C) 2008-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libAppUtil.la libAppUtil_la_SOURCES = libAppUtil_la_SOURCES += appUtil.c libAppUtil_la_SOURCES += appUtilX11.c AM_CFLAGS = @GTK_CPPFLAGS@ open-vm-tools-10.0.7-3227872/lib/appUtil/appUtilX11.c0000644000000000000000000006014212660700525020116 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * appUtilX11.c -- * * Utility functions to retrieve application icons. */ #define _GNU_SOURCE 1 #include #include #include #include "vmware.h" #include "str.h" #include "posix.h" #include "debug.h" #ifndef GTK2 #error "Gtk 2.0 is required" #endif #include #include #include #include #include #include #include /* *----------------------------------------------------------------------------- * * AppUtilIconThemeReallyHasIcon -- * * Utility function to detect whether an icon is really available. This is necessary * because sometimes gtk_icon_theme_has_icon() lies to us... * * Results: * TRUE if the icon theme really has a usable icon, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool AppUtilIconThemeReallyHasIcon(GtkIconTheme *iconTheme, // IN const char *iconName) // IN { gint *iconSizes; Bool retval; if (!gtk_icon_theme_has_icon(iconTheme, iconName)) { return FALSE; } iconSizes = gtk_icon_theme_get_icon_sizes(iconTheme, iconName); retval = iconSizes && iconSizes[0]; g_free(iconSizes); return retval; } /* *----------------------------------------------------------------------------- * * AppUtilCollectNamedIcons -- * * Tries to find icons with a particular name (which may be a full filesystem path, * a filename with extension, or just an abstract app name). * * Results: * None. * * Side effects: * May add icons into 'pixbufs' * *----------------------------------------------------------------------------- */ static void AppUtilCollectNamedIcons(GPtrArray *pixbufs, // IN/OUT const char *iconName) // IN { char *myIconName = NULL; char *baseIconName; /* * Use the GtkIconTheme to track down any available icons for this app. */ GtkIconTheme *iconTheme = NULL; char *ctmp2; Bool foundItInTheme = FALSE; // Did we find this icon in the GtkIconTheme? Bool foundItInFile = FALSE; // Did we find this icon directly in a file? static const char *extraIconPaths[] = { "/usr/share/icons", "/usr/share/pixmaps", "/usr/local/share/pixmaps", "/usr/local/share/icons", "/opt/kde3/share/icons", "/opt/kde3/share/pixmaps", "/opt/kde4/share/icons", "/opt/kde4/share/pixmaps", "/opt/gnome/share/icons", "/opt/gnome/share/pixmaps" }; int iconNameLen; ASSERT(iconName); Debug("Collecting icons named %s\n", iconName); iconNameLen = strlen(iconName) + 1; baseIconName = g_alloca(iconNameLen); // We need to modify the name sometimes Str_Strcpy(baseIconName, iconName, iconNameLen); ctmp2 = strrchr(baseIconName, '.'); if (*baseIconName != '/' && ctmp2 && strlen(ctmp2) <= 5) { /* * If it's a plain filename that we could possibly feed into GtkIconTheme as an * icon ID, trim the file extension to turn it into an icon ID string and make * GtkIconTheme happy. */ *ctmp2 = '\0'; } iconTheme = gtk_icon_theme_get_default(); g_object_ref(G_OBJECT(iconTheme)); foundItInTheme = AppUtilIconThemeReallyHasIcon(iconTheme, baseIconName); if (!foundItInTheme) { /* * Try looking for it as a non-GtkIconTheme managed file, to deal with older * systems. */ if (iconName[0] != '/') { gchar *iconSearchName; gsize iconSearchNameSize; gboolean triedOtherExts = FALSE; char *ctmp2; int i; static const char *iconExtensions[] = { "", // MUST be first entry. ".png", ".xpm", ".gif", ".svg", }; /* * Make a local copy of iconName in case we need to search for icons with * alternate extensions. */ iconSearchNameSize = strlen(iconName) + 1; iconSearchName = g_alloca(iconSearchNameSize); g_strlcpy(iconSearchName, iconName, iconSearchNameSize); myIconName = NULL; ctmp2 = g_alloca(PATH_MAX); tryingOtherExts: for (i = 0; !myIconName && i < ARRAYSIZE(extraIconPaths); i++) { int j; if (!extraIconPaths[i]) { continue; } /* * Per Desktop Entry Specification and Icon Theme Specification, I don't * believe that the iconName, unless it's an absolute path, should include * the file extension. * * However, empirical evidence shows that -many- applications ignore that * and may specify an icon of, for example, "foo.png". We'll also handle * those special cases here. */ for (j = 0; !myIconName && j < ARRAYSIZE(iconExtensions); j++) { g_snprintf(ctmp2, PATH_MAX, "%s/%s%s", extraIconPaths[i], iconSearchName, iconExtensions[j]); if (!g_file_test(ctmp2, G_FILE_TEST_EXISTS)) { continue; } if (j != 0) { /* * Case 1: We located an icon by appending an image extension to * IconName. Success! */ myIconName = ctmp2; // Will break "i" loop. foundItInFile = TRUE; break; } else { /* * Case 2: We found an icon without appending an extension. Verify * that the filename contains a valid image extension. */ int k; char *ctmpext = strrchr(ctmp2, '.'); for (k = 1; ctmpext && k < ARRAYSIZE(iconExtensions); k++) { if (strcmp(ctmpext, iconExtensions[k]) == 0) { myIconName = ctmp2; // Will break "i" loop. foundItInFile = TRUE; break; } } } } } /* * No dice. But we won't give up hope just yet! In some cases, icon-foo.png * may not exist while icon-foo.xpm does. (Ex: Ubuntu 8.04's hwtest.) We'll * try once more by searching for an icon with an alternate extension. */ if (!foundItInFile && !triedOtherExts) { int extIndex; triedOtherExts = TRUE; /* * Look to see if iconSearchName contains any of the known extensions * listed above. If so, chop it off, then reattempt the search. */ for (extIndex = 1; extIndex < ARRAYSIZE(iconExtensions); extIndex++) { if (g_str_has_suffix(iconSearchName, iconExtensions[extIndex])) { gchar *extension; extension = g_strrstr(iconSearchName, iconExtensions[extIndex]); *extension = '\0'; goto tryingOtherExts; } } } } else { myIconName = g_alloca(iconNameLen + 1); Str_Strcpy(myIconName, iconName, iconNameLen); foundItInFile = TRUE; } } if (!foundItInTheme && !foundItInFile) { /* * Try looking through some auxiliary icon themes. */ int i; static const char *extraThemes[] = { /* * Some other icon themes to try. */ "hicolor", "Bluecurve", "HighContrast-SVG", "HighContrastLargePrint", "crystalsvg", "slick", NULL }; g_object_unref(G_OBJECT(iconTheme)); iconTheme = gtk_icon_theme_new(); for (i = 0; i < ARRAYSIZE(extraIconPaths); i++) { if (extraIconPaths[i]) { if (g_file_test(extraIconPaths[i], G_FILE_TEST_EXISTS)) { gtk_icon_theme_append_search_path(iconTheme, extraIconPaths[i]); } else { extraIconPaths[i] = NULL; } } } for (i = 0; extraThemes[i]; i++) { gtk_icon_theme_set_custom_theme(iconTheme, extraThemes[i]); foundItInTheme = AppUtilIconThemeReallyHasIcon(iconTheme, baseIconName); if (foundItInTheme) { break; } } } if (foundItInTheme) { /* * If we know this icon can be loaded via GtkIconTheme, do so. */ gint *iconSizes; int i; Bool needToUseScalable; iconSizes = gtk_icon_theme_get_icon_sizes(iconTheme, baseIconName); Debug("Loading icon %s from iconTheme\n", baseIconName); ASSERT(iconSizes); needToUseScalable = (iconSizes[0] == -1 && iconSizes[1] == 0); /* * Before we try to actually dump the icons out to the host, count how many we * actually can load. */ for (i = 0; iconSizes[i]; i++) { GdkPixbuf *pixbuf; GtkIconInfo *iconInfo; gint thisSize; thisSize = iconSizes[i]; if (thisSize == -1 && !needToUseScalable) { continue; // Skip scalable icons if we have prerendered versions } if (thisSize == -1) { thisSize = 64; // Render SVG icons to 64x64 } iconInfo = gtk_icon_theme_lookup_icon(iconTheme, baseIconName, thisSize, 0); if (!iconInfo) { Debug("Couldn't find %s icon for size %d\n", baseIconName, thisSize); continue; } pixbuf = gtk_icon_info_load_icon(iconInfo, NULL); if (!pixbuf) { pixbuf = gtk_icon_info_get_builtin_pixbuf(iconInfo); } if (pixbuf) { g_ptr_array_add(pixbufs, pixbuf); } else { Debug("WARNING: Not even a built-in pixbuf for icon %s\n", baseIconName); } gtk_icon_info_free(iconInfo); } g_free(iconSizes); } else if (foundItInFile && myIconName && myIconName[0] == '/') { GdkPixbuf *pixbuf; Debug("Loading icon %s from file\n", myIconName); pixbuf = gdk_pixbuf_new_from_file(myIconName, NULL); if (pixbuf) { g_ptr_array_add(pixbufs, pixbuf); } } if (iconTheme) { g_object_unref(G_OBJECT(iconTheme)); } } /* *----------------------------------------------------------------------------- * * AppUtilComparePixbufSizes -- * * Compares two GdkPixbufs to sort them by image dimensions * * Results: * -1 if A is larger than B, 0 if equal, 1 if A is smaller than B * * Side effects: * None. * *----------------------------------------------------------------------------- */ static gint AppUtilComparePixbufSizes(gconstpointer a, // IN gconstpointer b) // IN { GdkPixbuf *pba; GdkPixbuf *pbb; int asize; int bsize; if (a && !b) { return -1; } else if (!a && b) { return 1; } else if (!a && !b) { return 0; } pba = GDK_PIXBUF(*(gconstpointer *)a); asize = gdk_pixbuf_get_width(pba) * gdk_pixbuf_get_height(pba); pbb = GDK_PIXBUF(*(gconstpointer *)b); bsize = gdk_pixbuf_get_width(pbb) * gdk_pixbuf_get_height(pbb); if (asize > bsize) { return -1; } else if (asize < bsize) { return 1; } return 0; } /* *----------------------------------------------------------------------------- * * AppUtil_CollectIconArray -- * * Given a variety of information about an application (its icon name, X window ID, * etc.), return an array of GdkPixbufs that represent the icons for that * application. * * Results: * GPtrArray of GdkPixbufs, or NULL on failure. The returned array may have zero * elements. The array will be sorted by icon size, largest to smallest. * * Side effects: * Caller becomes owner of the array and pixbufs that are allocated during this * function. * *----------------------------------------------------------------------------- */ GPtrArray * AppUtil_CollectIconArray(const char *iconName, // IN unsigned long windowID) // IN { GPtrArray *pixbufs; pixbufs = g_ptr_array_new(); if (iconName) { AppUtilCollectNamedIcons(pixbufs, iconName); } if (!pixbufs->len && windowID != None) { /* * Try loading the icon from the X Window's _NET_WM_ICON/WM_HINTS property. */ Display *dpy; XWMHints *wmh; Atom actualType = None; int actualFormat; unsigned long nitems = 0; unsigned long bytesLeft; XID *value; XTextProperty wmIconName; dpy = gdk_x11_get_default_xdisplay(); XGetWindowProperty(dpy, windowID, XInternAtom(dpy, "_NET_WM_ICON", FALSE), 0, LONG_MAX, False, XA_CARDINAL, &actualType, &actualFormat, &nitems, &bytesLeft, (unsigned char **)&value); if (nitems) { /* * _NET_WM_ICON: Transform ARGB data into pixbufs... */ int i; for (i = 0; i < nitems; ) { GdkPixbuf *pixbuf; int width; int height; int x; int y; int rowstride; guchar *pixels; ASSERT((nitems - i) >= 2); width = value[i]; height = value[i + 1]; i += 2; pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); if (pixbuf) { pixels = gdk_pixbuf_get_pixels(pixbuf); rowstride = gdk_pixbuf_get_rowstride(pixbuf); for (y = 0; y < height; y++) { for (x = 0; x < width && i < nitems; x++, i++) { guchar *pixel = &pixels[y * rowstride + x * 4]; XID currentValue = value[i]; /* * Input data: BGRA data (high byte is A, low byte is B - * freedesktop calls this ARGB, but that's not correct). * * Output data: RGBA data. */ *pixel = (currentValue >> 16) & 0xFF; *(pixel + 1) = (currentValue >> 8) & 0xFF; *(pixel + 2) = currentValue & 0xFF; *(pixel + 3) = (currentValue >> 24) & 0xFF; } } g_ptr_array_add(pixbufs, pixbuf); } else { Debug("gdk_pixbuf_new failed when decoding _NET_WM_ICON\n"); break; } } XFree(value); } nitems = 0; if (!pixbufs->len && XGetWindowProperty(dpy, windowID, XInternAtom(dpy, "_NET_WM_ICON_NAME", FALSE), 0, LONG_MAX, False, XInternAtom(dpy, "UTF8_STRING", FALSE), &actualType, &actualFormat, &nitems, &bytesLeft, (unsigned char **)&value) == Success && nitems) { /* * _NET_WM_ICON_NAME */ AppUtilCollectNamedIcons(pixbufs, (char *)value); XFree(value); } if (!pixbufs->len && XGetWMIconName(dpy, windowID, &wmIconName)) { /* * WM_ICON_NAME */ AppUtilCollectNamedIcons(pixbufs, wmIconName.value); XFree(wmIconName.value); } if (!pixbufs->len && (wmh = XGetWMHints(dpy, windowID))) { /* * WM_HINTS */ if (wmh->flags & IconPixmapHint) { Window dummyWin; int x; int y; unsigned int width; unsigned int height; unsigned int border; unsigned int depth; GdkPixbuf *pixbuf = NULL; if (XGetGeometry(dpy, wmh->icon_pixmap, &dummyWin, &x, &y, &width, &height, &border, &depth)) { pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, width, height); if (!gdk_pixbuf_xlib_get_from_drawable (pixbuf, wmh->icon_pixmap, DefaultColormap(dpy, 0), DefaultVisual(dpy, 0), 0, 0, 0, 0, width, height)) { g_object_unref(G_OBJECT(pixbuf)); pixbuf = NULL; } if (pixbuf && (wmh->flags & IconMaskHint)) { /* * Apply the X bitmap mask. */ GdkPixbuf *pixbuf_mask; pixbuf_mask = gdk_pixbuf_xlib_get_from_drawable(pixbuf, wmh->icon_mask, DefaultColormap(dpy, 0), DefaultVisual(dpy, 0), 0, 0, 0, 0, width, height); if (pixbuf_mask) { int x; int y; int rowstride; int rowstride_mask; guchar *pixels; guchar *pixels_mask; int depth_mask; int n_channels_mask; pixels = gdk_pixbuf_get_pixels(pixbuf); pixels_mask = gdk_pixbuf_get_pixels(pixbuf_mask); rowstride = gdk_pixbuf_get_rowstride(pixbuf); rowstride_mask = gdk_pixbuf_get_rowstride(pixbuf_mask); depth_mask = gdk_pixbuf_get_bits_per_sample(pixbuf_mask); ASSERT(gdk_pixbuf_get_bits_per_sample(pixbuf) == 8); n_channels_mask = gdk_pixbuf_get_n_channels(pixbuf_mask); for (y = 0; y < height; y++) { guchar *thisrow_mask = pixels_mask + y * rowstride_mask; guchar *thisrow = pixels + y * rowstride; for (x = 0; x < width; x++) { guchar newAlpha = 0xFF; switch(depth_mask) { case 1: newAlpha = thisrow_mask[x * n_channels_mask / 8]; newAlpha >>= (x % 8); newAlpha = newAlpha ? 0xFF : 0; break; case 8: /* * For some reason, gdk-pixbuf-xlib turns a monochrome * bitmap into 0/1 values in the blue channel of an RGBA * pixmap. */ newAlpha = (thisrow_mask[x * n_channels_mask + 2]) ? 0xFF : 0; break; default: NOT_REACHED(); break; } thisrow[x * 4 + 3] = newAlpha; } } } } if (pixbuf) { g_ptr_array_add(pixbufs, pixbuf); } } } XFree(wmh); } if (!pixbufs->len) { /* * Last resort - try using the WM_CLASS as an icon name */ XClassHint hints; if (XGetClassHint(dpy, windowID, &hints)) { if (hints.res_name) { AppUtilCollectNamedIcons(pixbufs, hints.res_name); } XFree(hints.res_name); XFree(hints.res_class); } } } /* * In order to make it easy for AppUtil users to pick the icon they want, we sort them * largest-to-smallest. */ g_ptr_array_sort(pixbufs, AppUtilComparePixbufSizes); if (!pixbufs->len) { Debug("WARNING: No icons found for %s / %#lx\n", iconName, windowID); } return pixbufs; } /* *----------------------------------------------------------------------------- * * AppUtil_FreeIconArray -- * * Frees the result of AppUtil_CollectIconArray * * Results: * None. * * Side effects: * Array and its contents are destroyed * *----------------------------------------------------------------------------- */ void AppUtil_FreeIconArray(GPtrArray *pixbufs) // IN { int i; if (!pixbufs) { return; } for (i = 0; i < pixbufs->len; i++) { g_object_unref(G_OBJECT(g_ptr_array_index(pixbufs, i))); } g_ptr_array_free(pixbufs, TRUE); } /* *----------------------------------------------------------------------------- * * AppUtil_AppIsSkippable -- * * Can an executable be ignored for the purposes of determining the path to run an * app with? Usually true for interpreters and the like, for which the script path * should be used instead. * * Results: * TRUE if the app should be ignored, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool AppUtil_AppIsSkippable(const char *appName) { static const char *skipAppsList[] = { "python", "python2.5", "python2.4", "python2.3", "python2.2", "perl", "sh", "bash", }; char cbuf[PATH_MAX]; int i; char *ctmp; Str_Strcpy(cbuf, appName, sizeof cbuf); ctmp = basename(cbuf); for (i = 0; i < ARRAYSIZE(skipAppsList); i++) { if (!strcmp(ctmp, skipAppsList[i])) { return TRUE; } } return FALSE; } /* *----------------------------------------------------------------------------- * * AppUtil_CanonicalizeAppName -- * * Turns the app name (or path) into a full path for the executable. * * Results: * Path, or NULL if not available * * Side effects: * Allocated memory is returned * *----------------------------------------------------------------------------- */ char * AppUtil_CanonicalizeAppName(const char *appName, // IN const char *cwd) // IN { char *ctmp; ASSERT(appName); if (appName[0] == '/') { ctmp = g_strdup(appName); goto exit; } ctmp = g_find_program_in_path(appName); if (ctmp) { goto exit; } /* * It's probably safe to assume that cwd is an absolute path (at the time of * writing, it is derived from /proc), but let's check to be sure. */ if (cwd && cwd[0] == '/') { /* Don't add any unnecessary path separators. */ char *cbuf = Str_Asprintf(NULL, "%s%s%s", cwd, cwd[strlen(cwd) - 1] == '/' ? "" : "/", appName); if (cbuf) { ctmp = Posix_RealPath(cbuf); free(cbuf); } } exit: return ctmp; } /* *----------------------------------------------------------------------------- * * AppUtil_Init -- * * Initializes the AppUtil library for subsequent use. * * Results: * None. * * Side effects: * Internal state is initialized. Currently this is just gdk-pixbuf-xlib. * *----------------------------------------------------------------------------- */ void AppUtil_Init(void) { gdk_pixbuf_xlib_init(gdk_x11_get_default_xdisplay(), 0); } open-vm-tools-10.0.7-3227872/lib/appUtil/Makefile.in0000644000000000000000000004047712660700525020120 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2008-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/appUtil DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libAppUtil_la_LIBADD = am_libAppUtil_la_OBJECTS = appUtil.lo appUtilX11.lo libAppUtil_la_OBJECTS = $(am_libAppUtil_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libAppUtil_la_SOURCES) DIST_SOURCES = $(libAppUtil_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libAppUtil.la libAppUtil_la_SOURCES = appUtil.c appUtilX11.c AM_CFLAGS = @GTK_CPPFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/appUtil/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/appUtil/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libAppUtil.la: $(libAppUtil_la_OBJECTS) $(libAppUtil_la_DEPENDENCIES) $(LINK) $(libAppUtil_la_OBJECTS) $(libAppUtil_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appUtilX11.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/guestRpc/0000755000000000000000000000000012660700525016215 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/guestRpc/Makefile.am0000644000000000000000000000327512660700525020260 0ustar rootroot################################################################################ ### Copyright (C) 2008-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libGuestRpc.la libGuestRpc_la_SOURCES = libGuestRpc_la_SOURCES += nicinfo_xdr.c # XXX: Autoreconf complains about this and recommends using AM_CFLAGS instead. # Problem is, $(CFLAGS) is appended to the compiler command line after AM_CFLAGS # and after libGuestRpc_la_CFLAGS, so "-Wall -Werror" will override this flag. CFLAGS += -Wno-unused CLEANFILES = CLEANFILES += nicinfo.h CLEANFILES += nicinfo_xdr.c EXTRA_DIST = EXTRA_DIST += nicinfo.x # Rules to invoke rpcgen. rpcgen will generate funny paths in the generated # files if not invoked in the same directory as the source file, so we need # to copy the sources to the build dir before compiling them. nicinfo.h: nicinfo.x @RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@ nicinfo_xdr.c: nicinfo.x nicinfo.h @RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@ open-vm-tools-10.0.7-3227872/lib/guestRpc/Makefile.in0000644000000000000000000004165412660700525020274 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2008-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/guestRpc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libGuestRpc_la_LIBADD = am_libGuestRpc_la_OBJECTS = nicinfo_xdr.lo libGuestRpc_la_OBJECTS = $(am_libGuestRpc_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libGuestRpc_la_SOURCES) DIST_SOURCES = $(libGuestRpc_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ # XXX: Autoreconf complains about this and recommends using AM_CFLAGS instead. # Problem is, $(CFLAGS) is appended to the compiler command line after AM_CFLAGS # and after libGuestRpc_la_CFLAGS, so "-Wall -Werror" will override this flag. CFLAGS = @CFLAGS@ -Wno-unused COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libGuestRpc.la libGuestRpc_la_SOURCES = nicinfo_xdr.c CLEANFILES = nicinfo.h nicinfo_xdr.c EXTRA_DIST = nicinfo.x all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/guestRpc/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/guestRpc/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libGuestRpc.la: $(libGuestRpc_la_OBJECTS) $(libGuestRpc_la_DEPENDENCIES) $(LINK) $(libGuestRpc_la_OBJECTS) $(libGuestRpc_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nicinfo_xdr.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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: -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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # Rules to invoke rpcgen. rpcgen will generate funny paths in the generated # files if not invoked in the same directory as the source file, so we need # to copy the sources to the build dir before compiling them. nicinfo.h: nicinfo.x @RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@ nicinfo_xdr.c: nicinfo.x nicinfo.h @RPCGEN_WRAPPER@ lib/guestRpc/nicinfo.x $@ # 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: open-vm-tools-10.0.7-3227872/lib/guestRpc/nicinfo.x0000644000000000000000000001717412660700525020045 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * nicinfo.x -- * * Definition of the data structures used in the GuestRpc commands to * provide information about the guest NICs. */ /* * Enumerates the different versions of the messages. Starting at 2, since * version one is legacy code we can't change. */ enum NicInfoVersion { NIC_INFO_V1 = 1, /* XXX Not represented here. */ NIC_INFO_V2 = 2, NIC_INFO_V3 = 3 }; /* * These are arbitrary limits to avoid possible DoS attacks. * The IP limit is large enough to hold an IP address (either v4 or v6). */ const NICINFO_MAX_IP_LEN = 64; const NICINFO_MAX_IPS = 2048; const NICINFO_MAX_NICS = 16; /* MAC Addresses are "AA:BB:CC:DD:EE:FF" = 18 bytes. */ const NICINFO_MAC_LEN = 18; /* * Corresponds to public/guestInfo.h::GuestInfoIPAddressFamilyType. */ enum NicInfoAddrType { NICINFO_ADDR_IPV4 = 0, NICINFO_ADDR_IPV6 = 1 }; struct VmIpAddress { NicInfoAddrType addressFamily; Bool dhcpEnabled; char ipAddress[NICINFO_MAX_IP_LEN]; /* * For IPv4, may be either a hexadecimal mask ("0xffffff00") or CIDR-style * prefix length ("24"). For IPv6, will only be a prefix length. */ char subnetMask[NICINFO_MAX_IP_LEN]; }; struct GuestNic { char macAddress[NICINFO_MAC_LEN]; struct VmIpAddress ips; }; /* * This structure is not entirely necessary, but it makes the generated * code nicer to code to. */ struct GuestNicList { struct GuestNic nics; }; /* *----------------------------------------------------------------------------- * * NIC Info version 3. * * V3 adds routing, DNS, and WINS information to the NIC list. * *----------------------------------------------------------------------------- */ /* * IP v4 and v6 addressing. * * These types were redefined primarily to allow much more efficient wire * encoding. */ /* * See RFC 4001, InetAddress. */ const INET_ADDRESS_MAX_LEN = 255; typedef opaque InetAddress; /* * See RFC 4001, InetAddressType. */ enum InetAddressType { IAT_UNKNOWN = 0, IAT_IPV4 = 1, IAT_IPV6 = 2, IAT_IPV4Z = 3, IAT_IPV6Z = 4, IAT_DNS = 16 }; /* * See RFC 4001, InetAddressPrefixLength. */ typedef unsigned int InetAddressPrefixLength; /* * See RFC 4293, IpAddressOriginTC. */ enum IpAddressOrigin { IAO_OTHER = 1, IAO_MANUAL = 2, IAO_DHCP = 4, IAO_LINKLAYER = 5, IAO_RANDOM = 6 }; /* * See RFC 4293, IpAddressStatusTC. * * "The status of an address. Most of the states correspond to states * from the IPv6 Stateless Address Autoconfiguration protocol. * ... * "In the absence of other information, an IPv4 address is always * preferred(1)." */ enum IpAddressStatus { IAS_PREFERRED = 1, IAS_DEPRECATED = 2, IAS_INVALID = 3, IAS_INACCESSIBLE = 4, IAS_UNKNOWN = 5, IAS_TENTATIVE = 6, IAS_DUPLICATE = 7, IAS_OPTIMISTIC = 8 }; /* * Convenient type for lists of addresses. */ struct TypedIpAddress { InetAddressType ipAddressAddrType; InetAddress ipAddressAddr; }; /* * See RFC 4293, IpAddressEntry. * * "An address mapping for a particular interface." * * We deviate from the RFC in a few places: * - The prefix length is listed explicitly here rather than reference * a separate prefix table. * - Interface indices aren't included as this structure is dependent * upon/encapsulated by a GuestNicV3 structure. */ struct IpAddressEntry { TypedIpAddress ipAddressAddr; InetAddressPrefixLength ipAddressPrefixLength; IpAddressOrigin *ipAddressOrigin; IpAddressStatus *ipAddressStatus; }; /* * Runtime DNS resolver state. */ /* * Quoth RFC 2181 §11 (Name Syntax): * "The length of any one label is limited to between 1 and 63 octets. A * full domain name is limited to 255 octets (including the separators)." */ const DNSINFO_MAX_ADDRLEN = 255; typedef string DnsHostname; /* * Arbitrary limits. */ const DNSINFO_MAX_SUFFIXES = 10; const DNSINFO_MAX_SERVERS = 16; struct DnsConfigInfo { DnsHostname *hostName; DnsHostname *domainName; TypedIpAddress serverList; DnsHostname searchSuffixes; }; /* * Runtime WINS resolver state. Addresses are assumed to be IPv4 only. */ struct WinsConfigInfo { TypedIpAddress primary; TypedIpAddress secondary; }; /* * Runtime routing tables. */ /* * Arbitrary limit. */ const NICINFO_MAX_ROUTES = 100; /* * See RFC 4292 for details. */ enum InetCidrRouteType { ICRT_OTHER = 1, ICRT_REJECT = 2, ICRT_LOCAL = 3, ICRT_REMOTE = 4 }; struct InetCidrRouteEntry { TypedIpAddress inetCidrRouteDest; InetAddressPrefixLength inetCidrRoutePfxLen; /* * Next hop isn't mandatory. */ TypedIpAddress *inetCidrRouteNextHop; /* * inetCidrRouteProto is omitted as we're concerned only with static/ * netmgmt routes. */ /* This is an array index into GuestNicListV3::nics. */ uint32 inetCidrRouteIfIndex; /* XXX Do we really need this? */ InetCidrRouteType inetCidrRouteType; /* -1 == unused. */ uint32 inetCidrRouteMetric; }; /* * Fun with DHCP */ const DHCP_MAX_CONFIG_SIZE = 16384; struct DhcpConfigInfo { bool enabled; string dhcpSettings; }; /* * Top-level containers. */ /* * Describes a single NIC. */ struct GuestNicV3 { string macAddress; IpAddressEntry ips; DnsConfigInfo *dnsConfigInfo; WinsConfigInfo *winsConfigInfo; DhcpConfigInfo *dhcpConfigInfov4; DhcpConfigInfo *dhcpConfigInfov6; }; /* * Attempts to model general network state. */ struct NicInfoV3 { GuestNicV3 nics; InetCidrRouteEntry routes; DnsConfigInfo *dnsConfigInfo; WinsConfigInfo *winsConfigInfo; DhcpConfigInfo *dhcpConfigInfov4; DhcpConfigInfo *dhcpConfigInfov6; }; /* * This defines the protocol for a "nic info" message. The union allows * us to create new versions of the protocol later by creating new values * in the NicInfoVersion enumeration, without having to change much of * the code calling the (de)serialization functions. * * Since the union doesn't have a default case, de-serialization will fail * if an unknown version is provided on the wire. */ union GuestNicProto switch (NicInfoVersion ver) { case NIC_INFO_V2: struct GuestNicList *nicsV2; case NIC_INFO_V3: struct NicInfoV3 *nicInfoV3; }; open-vm-tools-10.0.7-3227872/lib/syncDriver/0000755000000000000000000000000012660700526016552 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/syncDriver/nullDriver.c0000644000000000000000000000472112660700526021050 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file nullDriver.c * * A "null" sync driver that just calls sync(2). This is used when both the * Linux kernel ioctls nor the vmsync driver are available in the system, * since at that point it's too late to tell the vmbackup code that there * is no sync driver. */ #include "debug.h" #include "syncDriverInt.h" #include "util.h" /* ******************************************************************************* * NullDriverClose -- */ /** * * Frees the handle. * * @param[in] handle Handle to free. * ******************************************************************************* */ static void NullDriverClose(SyncDriverHandle handle) { free(handle); } /* ******************************************************************************* * NullDriver_Freeze -- */ /** * * Calls sync(). * * @param[in] paths Unused. * @param[out] handle Where to store the operation handle. * * @return A SyncDriverErr. * ******************************************************************************* */ SyncDriverErr NullDriver_Freeze(const char *paths, SyncDriverHandle *handle) { /* * This is more of a "let's at least do something" than something that * will actually ensure data integrity... we also need to return a dummy * handle. */ SyncHandle *h = calloc(1, sizeof *h); if (h == NULL) { return SD_ERROR; } h->close = NullDriverClose; *handle = h; Debug(LGPFX "Using null driver...\n"); sync(); return SD_SUCCESS; } open-vm-tools-10.0.7-3227872/lib/syncDriver/Makefile.am0000644000000000000000000000221212660700526020603 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libSyncDriver.la libSyncDriver_la_SOURCES = libSyncDriver_la_SOURCES += syncDriverPosix.c if LINUX libSyncDriver_la_SOURCES += nullDriver.c libSyncDriver_la_SOURCES += syncDriverLinux.c libSyncDriver_la_SOURCES += vmSyncDriver.c endif open-vm-tools-10.0.7-3227872/lib/syncDriver/vmSyncDriver.c0000644000000000000000000000732012660700526021353 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file vmSyncDriver.c * * A sync driver backend that uses VMware's "vmsync" driver. */ #include #include #include "debug.h" #include "syncDriverInt.h" #include "syncDriverIoc.h" #include "util.h" #define SYNC_PROC_PATH "/proc/driver/vmware-sync" typedef struct VmSyncDriver { SyncHandle driver; int fd; } VmSyncDriver; /* ******************************************************************************* * VmSyncThaw -- */ /** * * Thaws filesystems previously frozen. * * @param[in] handle Handle returned by the freeze operation. * * @return A SyncDriverErr. * ******************************************************************************* */ static SyncDriverErr VmSyncThaw(const SyncDriverHandle handle) { const VmSyncDriver *sync = (VmSyncDriver *) handle; ASSERT(handle != SYNCDRIVER_INVALID_HANDLE); return ioctl(sync->fd, SYNC_IOC_THAW) != -1 ? SD_SUCCESS : SD_ERROR; } /* ******************************************************************************* * VmSyncClose -- */ /** * * Closes the descriptor used to talk to the vmsync driver and frees memory * associated with it. * * @param[in] handle Handle to close. * ******************************************************************************* */ static void VmSyncClose(SyncDriverHandle handle) { VmSyncDriver *sync = (VmSyncDriver *) handle; close(sync->fd); free(sync); } /* ******************************************************************************* * VmSync_Freeze -- */ /** * * Tries to freeze the requested filesystems with the vmsync driver. * * Opens a description to the driver's proc node, and if successful, send an * ioctl to freeze the requested filesystems. * * @param[in] paths Paths to freeze (colon-delimited). * @param[out] handle Where to store the handle to use for thawing. * * @return A SyncDriverErr. * ******************************************************************************* */ SyncDriverErr VmSync_Freeze(const char *paths, SyncDriverHandle *handle) { int file; VmSyncDriver *sync = NULL; Debug(LGPFX "Freezing %s using vmsync driver...\n", paths); file = open(SYNC_PROC_PATH, O_RDONLY); if (file == -1) { return SD_UNAVAILABLE; } sync = calloc(1, sizeof *sync); if (sync == NULL) { goto exit; } sync->driver.thaw = VmSyncThaw; sync->driver.close = VmSyncClose; sync->fd = file; if (ioctl(file, SYNC_IOC_FREEZE, paths) == -1) { free(sync); sync = NULL; } exit: if (sync == NULL) { if (file != -1) { close(file); } } else { *handle = &sync->driver; } return sync != NULL ? SD_SUCCESS : SD_ERROR; } open-vm-tools-10.0.7-3227872/lib/syncDriver/syncDriverInt.h0000644000000000000000000000342012660700526021525 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _SYNCDRIVERINT_H_ #define _SYNCDRIVERINT_H_ /** * @file syncDriverInt.h * * Internal definitions for the sync driver library. */ #include "syncDriver.h" #define LGPFX "SyncDriver: " #if !defined(Win32) typedef enum { SD_SUCCESS, SD_ERROR, SD_UNAVAILABLE, } SyncDriverErr; typedef SyncDriverErr (*SyncFreezeFn)(const char *paths, SyncDriverHandle *handle); typedef struct SyncHandle { SyncDriverErr (*thaw)(const SyncDriverHandle handle); void (*close)(SyncDriverHandle handle); } SyncHandle; #if defined(linux) SyncDriverErr LinuxDriver_Freeze(const char *userPaths, SyncDriverHandle *handle); SyncDriverErr VmSync_Freeze(const char *userPaths, SyncDriverHandle *handle); SyncDriverErr NullDriver_Freeze(const char *userPaths, SyncDriverHandle *handle); #endif #endif #endif /* _SYNCDRIVERINT_H_ */ open-vm-tools-10.0.7-3227872/lib/syncDriver/Makefile.in0000644000000000000000000004146312660700526020627 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ @LINUX_TRUE@am__append_1 = nullDriver.c syncDriverLinux.c \ @LINUX_TRUE@ vmSyncDriver.c subdir = lib/syncDriver DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libSyncDriver_la_LIBADD = am__libSyncDriver_la_SOURCES_DIST = syncDriverPosix.c nullDriver.c \ syncDriverLinux.c vmSyncDriver.c @LINUX_TRUE@am__objects_1 = nullDriver.lo syncDriverLinux.lo \ @LINUX_TRUE@ vmSyncDriver.lo am_libSyncDriver_la_OBJECTS = syncDriverPosix.lo $(am__objects_1) libSyncDriver_la_OBJECTS = $(am_libSyncDriver_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libSyncDriver_la_SOURCES) DIST_SOURCES = $(am__libSyncDriver_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libSyncDriver.la libSyncDriver_la_SOURCES = syncDriverPosix.c $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/syncDriver/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/syncDriver/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libSyncDriver.la: $(libSyncDriver_la_OBJECTS) $(libSyncDriver_la_DEPENDENCIES) $(LINK) $(libSyncDriver_la_OBJECTS) $(libSyncDriver_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nullDriver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syncDriverLinux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syncDriverPosix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmSyncDriver.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/syncDriver/syncDriverPosix.c0000644000000000000000000002121312660700526022070 0ustar rootroot/********************************************************* * Copyright (C) 2005-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * syncDriverPosix.c -- * * Interface to the Sync Driver for non-Windows guests. */ #include #include #include #include "vmware.h" #include "debug.h" #include "dynbuf.h" #include "str.h" #include "syncDriverInt.h" #include "util.h" #include "mntinfo.h" static SyncFreezeFn gBackends[] = { #if defined(__linux__) && !defined(USERWORLD) LinuxDriver_Freeze, VmSync_Freeze, NullDriver_Freeze, #endif }; static const char *gRemoteFSTypes[] = { "autofs", "cifs", "nfs", "nfs4", "smbfs", "vmhgfs" }; /* *----------------------------------------------------------------------------- * * SyncDriverIsRemoteFSType -- * * Checks whether a filesystem is remote or not * * Results: * Returns TRUE for remote filesystem types, otherwise FALSE. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool SyncDriverIsRemoteFSType(const char *fsType) { size_t i; for (i = 0; i < ARRAYSIZE(gRemoteFSTypes); i++) { if (Str_Strcmp(gRemoteFSTypes[i], fsType) == 0) { return TRUE; } } return FALSE; } /* *----------------------------------------------------------------------------- * * SyncDriverListMounts -- * * Returns a newly allocated string containing a list of colon-separated * mount paths in the system. No filtering is done, so all paths are added. * This assumes that the driver allows "unfreezable" paths to be provided * to the freeze command. * * XXX: mntinfo.h mentions Solaris and Linux, but not FreeBSD. If we ever * have a FreeBSD sync driver, we should make sure this function also * works there. * * Results: * The list of devices to freeze, or NULL on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * SyncDriverListMounts(void) { char *paths = NULL; DynBuf buf; MNTHANDLE mounts; DECLARE_MNTINFO(mntinfo); if ((mounts = OPEN_MNTFILE("r")) == NULL) { return NULL; } DynBuf_Init(&buf); while (GETNEXT_MNTINFO(mounts, mntinfo)) { /* * Skip remote mounts because they are not freezable and opening them * could lead to hangs. See PR 1196785. */ if (SyncDriverIsRemoteFSType(MNTINFO_FSTYPE(mntinfo))) { Debug(LGPFX "Skipping remote filesystem, name=%s, mntpt=%s.\n", MNTINFO_NAME(mntinfo), MNTINFO_MNTPT(mntinfo)); continue; } /* * Add a separator if it's not the first path, and add the path to the * tail of the list. */ if ((DynBuf_GetSize(&buf) != 0 && !DynBuf_Append(&buf, ":", 1)) || !DynBuf_Append(&buf, MNTINFO_MNTPT(mntinfo), strlen(MNTINFO_MNTPT(mntinfo)))) { goto exit; } } if (!DynBuf_Append(&buf, "\0", 1)) { goto exit; } paths = DynBuf_AllocGet(&buf); if (paths == NULL) { Debug(LGPFX "Failed to allocate path list.\n"); } exit: DynBuf_Destroy(&buf); (void) CLOSE_MNTFILE(mounts); return paths; } /* *----------------------------------------------------------------------------- * * SyncDriver_Init -- * * Checks whether a sync backend is available. * * Results: * TRUE if there are sync backends available. * FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool SyncDriver_Init(void) { return ARRAYSIZE(gBackends) > 0; } /* *----------------------------------------------------------------------------- * * SyncDriver_Freeze -- * * Freeze I/O on the indicated drives. "all" means all drives. * Handle is set to SYNCDRIVER_INVALID_HANDLE on failure. * Freeze operations are currently synchronous in POSIX systems, but * clients should still call SyncDriver_QueryStatus to maintain future * compatibility in case that changes. * * This function will try different available sync implementations. It will * follow the order in the "gBackends" array, and keep on trying different * backends while SD_UNAVAILABLE is returned. If all backends are * unavailable (unlikely given the "null" backend), the the function returns * error. NullDriver will be tried only if enableNullDriver is TRUE. * * Results: * TRUE on success * FALSE on failure * * Side effects: * See description. * *----------------------------------------------------------------------------- */ Bool SyncDriver_Freeze(const char *userPaths, // IN Bool enableNullDriver, // IN SyncDriverHandle *handle) // OUT { char *paths = NULL; SyncDriverErr err = SD_UNAVAILABLE; size_t i = 0; /* * First, convert the given path list to something the backends will * understand: a colon-separated list of paths. * * NOTE: Ignore disk UUIDs. We ignore the userPaths if it does * not start with '/' because all paths are absolute and it is * possible only when we get diskUUID as userPaths. So, all * mount points are considered instead of the userPaths provided. */ if (userPaths == NULL || Str_Strncmp(userPaths, "all", sizeof "all") == 0 || *userPaths != '/') { paths = SyncDriverListMounts(); if (paths == NULL) { Debug(LGPFX "Failed to list mount points.\n"); return SD_ERROR; } } else { /* * The sync driver API specifies spaces as separators, but the driver * uses colons as the path separator on Unix. */ char *c; paths = Util_SafeStrdup(userPaths); for (c = paths; *c != '\0'; c++) { if (*c == ' ') { *c = ':'; } } } while (err == SD_UNAVAILABLE && i < ARRAYSIZE(gBackends)) { SyncFreezeFn freezeFn = gBackends[i]; Debug(LGPFX "Calling backend %d.\n", (int) i); i++; #if defined(__linux__) && !defined(USERWORLD) if (!enableNullDriver && (freezeFn == NullDriver_Freeze)) { Debug(LGPFX "Skipping nullDriver backend.\n"); continue; } #endif err = freezeFn(paths, handle); } free(paths); return err == SD_SUCCESS; } /* *----------------------------------------------------------------------------- * * SyncDriver_Thaw -- * * Thaw I/O on previously frozen volumes. * * Results: * TRUE on success * FALSE on failure * * Side effects: * See description. * *----------------------------------------------------------------------------- */ Bool SyncDriver_Thaw(const SyncDriverHandle handle) // IN { if (handle->thaw != NULL) { return handle->thaw(handle) == SD_SUCCESS; } return TRUE; } /* *----------------------------------------------------------------------------- * * SyncDriver_QueryStatus -- * * Polls the handle and returns the current status of the driver. * * Results: * SYNCDRIVER_IDLE, since all operations are currently synchronous. * * Side effects: * None * *----------------------------------------------------------------------------- */ SyncDriverStatus SyncDriver_QueryStatus(const SyncDriverHandle handle, // IN int32 timeout) // IN { return SYNCDRIVER_IDLE; } /* *----------------------------------------------------------------------------- * * SyncDriver_CloseHandle -- * * Closes the handle the sets it to SYNCDRIVER_INVALID_HANDLE. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void SyncDriver_CloseHandle(SyncDriverHandle *handle) // IN/OUT { if (*handle != NULL) { if ((*handle)->close != NULL) { (*handle)->close(*handle); } *handle = NULL; } } open-vm-tools-10.0.7-3227872/lib/syncDriver/syncDriverLinux.c0000644000000000000000000001656212660700526022100 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file syncDriverLinux.c * * A sync driver backend that uses the Linux "FIFREEZE" and "FITHAW" ioctls * to freeze and thaw file systems. */ #include #include #include #include #include #include #include #include "debug.h" #include "dynbuf.h" #include "strutil.h" #include "syncDriverInt.h" /* Out toolchain headers are somewhat outdated and don't define these. */ #if !defined(FIFREEZE) # define FIFREEZE _IOWR('X', 119, int) /* Freeze */ # define FITHAW _IOWR('X', 120, int) /* Thaw */ #endif typedef struct LinuxDriver { SyncHandle driver; size_t fdCnt; int *fds; } LinuxDriver; /* ******************************************************************************* * LinuxFiThaw -- */ /** * * Thaws the file systems monitored by the given handle. Tries to thaw all the * file systems even if an error occurs in one of them. * * @param[in] handle Handle returned by the freeze call. * * @return A SyncDriverErr. * ******************************************************************************* */ static SyncDriverErr LinuxFiThaw(const SyncDriverHandle handle) { size_t i; LinuxDriver *sync = (LinuxDriver *) handle; SyncDriverErr err = SD_SUCCESS; for (i = 0; i < sync->fdCnt; i++) { if (ioctl(sync->fds[i], FITHAW) == -1) { err = SD_ERROR; } } return err; } /* ******************************************************************************* * LinuxFiClose -- */ /** * * Closes the file descriptors used for freezing, and frees memory associated * with the handle. * * @param[in] handle Handle to close. * ******************************************************************************* */ static void LinuxFiClose(SyncDriverHandle handle) { LinuxDriver *sync = (LinuxDriver *) handle; size_t i; for (i = 0; i < sync->fdCnt; i++) { close(sync->fds[i]); } free(sync->fds); free(sync); } /* ******************************************************************************* * LinuxDriver_Freeze -- */ /** * * Tries to freeze the filesystems using the Linux kernel's FIFREEZE ioctl. * * If the first attempt at using the ioctl fails, assume that it doesn't exist * and return SD_UNAVAILABLE, so that other means of freezing are tried. * * NOTE: This function performs two system calls open() and ioctl(). We have * seen open() being slow with NFS mount points at times and ioctl() being * slow when guest is performing significant IO. Therefore, caller should * consider running this function in a separate thread. * * @param[in] paths Paths to freeze (colon-separated). * @param[out] handle Handle to use for thawing. * * @return A SyncDriverErr. * ******************************************************************************* */ SyncDriverErr LinuxDriver_Freeze(const char *paths, SyncDriverHandle *handle) { char *path; int fd; size_t count = 0; unsigned int index = 0; Bool first = TRUE; DynBuf fds; LinuxDriver *sync = NULL; SyncDriverErr err = SD_SUCCESS; DynBuf_Init(&fds); Debug(LGPFX "Freezing %s using Linux ioctls...\n", paths); sync = calloc(1, sizeof *sync); if (sync == NULL) { return SD_ERROR; } sync->driver.thaw = LinuxFiThaw; sync->driver.close = LinuxFiClose; /* * Iterate through the requested paths. If we get an error for the first * path, and it's not EPERM, assume that the ioctls are not available in * the current kernel. */ while ((path = StrUtil_GetNextToken(&index, paths, ":")) != NULL) { Debug(LGPFX "opening path '%s'.\n", path); fd = open(path, O_RDONLY); if (fd == -1) { switch (errno) { case EACCES: /* * We sometimes get access errors to virtual filesystems mounted * as users with permission 700, so just ignore these. */ Debug(LGPFX "cannot access mounted directory '%s'.\n", path); free(path); continue; case EIO: /* * A mounted HGFS filesystem with the backend disabled will give * us these; probably could use a better way to detect HFGS, but * this should be enough. Just skip. */ Debug(LGPFX "I/O error reading directory '%s'.\n", path); free(path); continue; default: Debug(LGPFX "failed to open '%s': %d (%s)\n", path, errno, strerror(errno)); err = SD_ERROR; free(path); goto exit; } } Debug(LGPFX "freezing path '%s'.\n", path); if (ioctl(fd, FIFREEZE) == -1) { int ioctlerr = errno; /* * If the ioctl does not exist, Linux will return ENOTTY. If it's not * supported on the device, we get EOPNOTSUPP. Ignore the latter, * since freezing does not make sense for all fs types, and some * Linux fs drivers may not have been hooked up in the running kernel. * * Also ignore EBUSY since we may try to freeze the same superblock * more than once depending on the OS configuration (e.g., usage of * bind mounts). */ close(fd); Debug(LGPFX "freeze on '%s' returned: %d (%s)\n", path, ioctlerr, strerror(ioctlerr)); if (ioctlerr != EBUSY && ioctlerr != EOPNOTSUPP) { Debug(LGPFX "failed to freeze '%s': %d (%s)\n", path, ioctlerr, strerror(ioctlerr)); err = first && ioctlerr == ENOTTY ? SD_UNAVAILABLE : SD_ERROR; free(path); break; } } else { Debug(LGPFX "successfully froze '%s'.\n", path); if (!DynBuf_Append(&fds, &fd, sizeof fd)) { if (ioctl(fd, FITHAW) == -1) { Warning(LGPFX "failed to thaw '%s': %d (%s)\n", path, errno, strerror(errno)); } free(path); close(fd); err = SD_ERROR; break; } count++; } free(path); first = FALSE; } exit: sync->fds = DynBuf_Detach(&fds); sync->fdCnt = count; if (err != SD_SUCCESS) { LinuxFiThaw(&sync->driver); LinuxFiClose(&sync->driver); } else { *handle = &sync->driver; } return err; } open-vm-tools-10.0.7-3227872/lib/sslDirect/0000755000000000000000000000000012660700526016356 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/sslDirect/Makefile.am0000644000000000000000000000223612660700526020415 0ustar rootroot################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libSslDirect.la libSslDirect_la_CPPFLAGS = if ENABLE_GRABBITMQPROXY libSslDirect_la_CPPFLAGS += @SSL_CPPFLAGS@ endif libSslDirect_la_SOURCES = if ENABLE_GRABBITMQPROXY libSslDirect_la_SOURCES += sslDirect.c else libSslDirect_la_SOURCES += sslStubs.c endif open-vm-tools-10.0.7-3227872/lib/sslDirect/sslDirect.c0000644000000000000000000004504612660700526020467 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * sslDirect.c -- * * Mostly direct call stubs for AsyncSocket SSL functions. */ #include #include #include #include #include "str.h" #ifdef _WIN32 #include #else #include #include #include #endif #include "log.h" #include "debug.h" #include "err.h" #include "msg.h" #include "sslDirect.h" #include "vm_assert.h" #define LOGLEVEL_MODULE SSLDirect #include "loglevel_user.h" #include #include #include #include #define SSL_LOG(x) Debug x struct SSLSockStruct { SSL *sslCnx; int fd; Bool encrypted; Bool closeFdOnShutdown; Bool connectionFailed; #ifdef __APPLE__ Bool loggedKernelReadBug; #endif int sslIOError; }; static Bool SSLModuleInitialized = FALSE; #ifndef SOCKET_ERROR #define SOCKET_ERROR (-1) #endif enum { SSL_SOCK_WANT_RETRY, SSL_SOCK_LOST_CONNECTION, }; /* *---------------------------------------------------------------------- * * SSLPrintErrors * * Print out all the errors in the SSL error queue. * * Results: * None * * Side effects: * Clears out the SSL error stack * *---------------------------------------------------------------------- */ static void SSLPrintErrors(uint32 logLevel) // IN: { /* * Code inspection of the unsafe ERR_error_string function * implementation in crypto/err.c shows a static buffer of 256 * characters. Presumably most messages will fit in that buffer. */ enum { SSL_ERR_MAX_STRING = 256 }; int errNum; char errString[SSL_ERR_MAX_STRING]; while ((errNum = ERR_get_error())) { errString[0] = '\0'; ERR_error_string_n(errNum, errString, ARRAYSIZE(errString)); /* TODO: use LogV */ if (logLevel == VMW_LOG_WARNING) { Warning("SSL Error: %s\n", errString); } else { Log("SSL Error: %s\n", errString); } } } /* *---------------------------------------------------------------------- * * SSLSetSystemError * * Maps the ssl error state into an appropriate errno / WSA error. * * Results: * None * * Side effects: * None *---------------------------------------------------------------------- */ static void SSLSetSystemError(int err) { switch (err) { case SSL_SOCK_WANT_RETRY: #ifdef _WIN32 WSASetLastError(WSAEWOULDBLOCK); #else errno = EAGAIN; #endif break; case SSL_SOCK_LOST_CONNECTION: /* * no good way to know what the real error was (could have been * a failure to load certificates in an accept), so return * something generic. */ #ifdef _WIN32 WSASetLastError(WSAEACCES); #else errno = EPERM; #endif break; default: NOT_REACHED(); } } /* *---------------------------------------------------------------------- * * SSLSetErrorState * * Each ssl read / write could result in several reads and writes on * the underlying socket. In this case the actual value for errno * will not be correct. Manually setup the error value so that * clients will do the right thing. * * XXX: Mapping the SSL_ERROR_WANT_ errors to a single error code * is not good. Applications using non-blocking IO would not know whether * they should put the FD in a read wait or a write wait. Note that SSL_read * can return SSL_ERROR_WANT_WRITE and SSL_write may return * SSL_ERROR_WANT_READ. * * Results: * None * * Side effects: * errno / windows error might be set. * *---------------------------------------------------------------------- */ static int SSLSetErrorState(SSL *ssl, int result) { int sslError = SSL_get_error(ssl, result); switch (sslError) { case SSL_ERROR_NONE: SSL_LOG(("SSL: action success, %d bytes\n", result)); break; case SSL_ERROR_ZERO_RETURN: SSL_LOG(("SSL: Zero return\n")); break; case SSL_ERROR_WANT_READ: SSL_LOG(("SSL: Want read\n")); SSLSetSystemError(SSL_SOCK_WANT_RETRY); break; case SSL_ERROR_WANT_WRITE: SSL_LOG(("SSL: Want write\n")); SSLSetSystemError(SSL_SOCK_WANT_RETRY); break; case SSL_ERROR_WANT_X509_LOOKUP: SSL_LOG(("SSL: want x509 lookup\n")); break; case SSL_ERROR_SYSCALL: SSL_LOG(("SSL: syscall error\n")); SSLPrintErrors(VMW_LOG_INFO); if (result == 0) { Log("SSL: EOF in violation of protocol\n"); } else { Log("SSL: syscall error %d: %s\n", Err_Errno(), Err_ErrString()); } break; case SSL_ERROR_SSL: Warning("SSL: Unknown SSL Error\n"); SSLPrintErrors(VMW_LOG_INFO); break; } return sslError; } /* *---------------------------------------------------------------------- * * SSL_Init -- * * Initializes the SSL library and prepares the session context. * * Results: * None. * * Side effects: * Lots. *---------------------------------------------------------------------- */ void SSL_Init(SSLLibFn *getLibFn, // Ignored const char *defaultLib, // Ignored const char *name) // Ignored { /* * Silently ignore any attempts to initialize module more than once. */ if (SSLModuleInitialized) { return; } SSL_library_init(); SSL_load_error_strings(); OpenSSL_add_all_algorithms(); /* * Force the PRNG to be initialized early, as opposed to at the * time when the SSL connection is made. A call to RAND_status * forces this initialization to happen. Initializing the PRNG * as early as possible in the process makes it take much less * time (e.g. 1sec. vs. sometimes 20sec.) compared to * initializing it later in the process, as may be the case on * the first SSL_accept() or SSL_connect(). That's because the * PRNG initialization walks the process heap and the total heap * is smaller at startup. * * If SSL_InitEx could not be called early enough in the * process, then the caller could just call RAND_status() by * itself. Only the first call to RAND_status will have the side * effect of initializing the PRNG, so calling it subsequently * would be a NOOP. */ RAND_status(); ENGINE_register_all_ciphers(); ENGINE_register_all_digests(); SSLModuleInitialized = TRUE; } /* *---------------------------------------------------------------------- * * SSL_New() * * Results: * Returns a freshly allocated SSLSock structure. * * Side effects: * None * *---------------------------------------------------------------------- */ SSLSock SSL_New(int fd, // IN Bool closeFdOnShutdown) // IN { SSLSock sslConnection; sslConnection = (SSLSock)calloc(1, sizeof(struct SSLSockStruct)); VERIFY(sslConnection); sslConnection->fd = fd; sslConnection->closeFdOnShutdown = closeFdOnShutdown; return sslConnection; } /* *---------------------------------------------------------------------- * * SSL_SetupAcceptWithContext() * * Setting up the ssl connection and states to do a SSL accept operation * * Results: * Returns TRUE on success, FALSE on failure. * * Side effects: * The server's certificate & private key may be loaded from disk. * *---------------------------------------------------------------------- */ Bool SSL_SetupAcceptWithContext(SSLSock sSock, // IN: SSL socket void *ctx) // IN: OpenSSL context (SSL_CTX *) { Bool ret = TRUE; ASSERT(SSLModuleInitialized); ASSERT(sSock); ASSERT(ctx); sSock->sslCnx = SSL_new(ctx); if (!sSock->sslCnx) { SSLPrintErrors(VMW_LOG_WARNING); Warning("Error Creating SSL connection structure\n"); sSock->connectionFailed = TRUE; ret = FALSE; goto end; } SSL_set_accept_state(sSock->sslCnx); SSL_LOG(("SSL: ssl created\n")); if (!SSL_set_fd(sSock->sslCnx, sSock->fd)) { SSLPrintErrors(VMW_LOG_WARNING); Warning("Error setting fd for SSL connection\n"); sSock->connectionFailed = TRUE; ret = FALSE; goto end; } SSL_LOG(("SSL: fd set done\n")); sSock->encrypted = TRUE; end: return ret; } /* *---------------------------------------------------------------------- * * SSL_Read -- * * Functional equivalent of the read() syscall. * * Results: * Returns the number of bytes read, or -1 on error. The * data read will be placed in buf. * * Side effects: * * *---------------------------------------------------------------------- */ ssize_t SSL_Read(SSLSock ssl, // IN char *buf, // OUT size_t num) // IN { int ret; ASSERT(ssl); if (ssl->connectionFailed) { SSLSetSystemError(SSL_SOCK_LOST_CONNECTION); ret = SOCKET_ERROR; goto end; } if (ssl->encrypted) { int result = SSL_read(ssl->sslCnx, buf, (int)num); ssl->sslIOError = SSLSetErrorState(ssl->sslCnx, result); if (ssl->sslIOError != SSL_ERROR_NONE) { SSL_LOG(("SSL: Read(%d, %p, %"FMTSZ"u): %d\n", ssl->fd, buf, num, result)); result = SOCKET_ERROR; } ret = result; } else { ret = SSLGeneric_read(ssl->fd, buf, (int)num); #ifdef __APPLE__ /* * Detect bug 161237 (Apple bug 5202831), which should no longer be * happening due to a workaround in our code. * * There is a bug on Mac OS 10.4 and 10.5 where passing an fd * over a socket can result in that fd being in an inconsistent state. * We can detect when this happens when read(2) returns zero * even if the other end of the socket is not disconnected. * We verify this by calling write(ssl->fd, "", 0) and * see if it is okay. (If the socket was really closed, it would * return -1 with errno==EPIPE.) */ if (ret == 0) { ssize_t writeRet; #ifdef VMX86_DEBUG struct stat statBuffer; /* * Make sure we're using a socket. */ ASSERT((fstat(ssl->fd, &statBuffer) == 0) && ((statBuffer.st_mode & S_IFSOCK) == S_IFSOCK)); #endif writeRet = write(ssl->fd, "", 0); if (writeRet == 0) { /* * The socket is still good. read(2) should not have returned zero. */ if (! ssl->loggedKernelReadBug) { Log("Error: Encountered Apple bug #5202831. Disconnecting.\n"); ssl->loggedKernelReadBug = TRUE; } } } #endif } end: return ret; } /* *---------------------------------------------------------------------- * * SSL_RecvDataAndFd -- * * recvmsg wrapper which can receive only file descriptors, not other * control data. * * Results: * Returns the number of bytes received, or -1 on error. The * data read will be placed in buf. *fd is either -1 if no fd was * received, or descriptor... * * Side effects: * * *---------------------------------------------------------------------- */ ssize_t SSL_RecvDataAndFd(SSLSock ssl, // IN/OUT: socket char *buf, // OUT: buffer size_t num, // IN: length of buffer int *fd) // OUT: descriptor received { int ret; ASSERT(ssl); ASSERT(fd); *fd = -1; if (ssl->connectionFailed) { SSLSetSystemError(SSL_SOCK_LOST_CONNECTION); ret = SOCKET_ERROR; goto end; } /* * No fd passing over SSL or Windows. Windows needs different code. */ #ifdef _WIN32 return SSL_Read(ssl, buf, num); #else if (ssl->encrypted) { int result = SSL_read(ssl->sslCnx, buf, (int)num); ssl->sslIOError = SSLSetErrorState(ssl->sslCnx, result); if (ssl->sslIOError != SSL_ERROR_NONE) { SSL_LOG(("SSL: Read(%d, %p, %"FMTSZ"u): %d\n", ssl->fd, buf, num, result)); result = SOCKET_ERROR; } ret = result; } else { struct iovec iov; struct msghdr msg = { 0 }; uint8 cmsgBuf[CMSG_SPACE(sizeof(int))]; iov.iov_base = buf; iov.iov_len = num; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = cmsgBuf; msg.msg_controllen = sizeof cmsgBuf; ret = SSLGeneric_recvmsg(ssl->fd, &msg, 0); if (ret >= 0 && msg.msg_controllen != 0) { struct cmsghdr *cmsg; for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { int receivedFd = *(int *)CMSG_DATA(cmsg); ASSERT(*fd == -1); *fd = receivedFd; } } } } #endif end: return ret; } /* *---------------------------------------------------------------------- * * SSL_Write() * * Functional equivalent of the write() syscall. * * Results: * Returns the number of bytes written, or -1 on error. * * Side effects: * *---------------------------------------------------------------------- */ ssize_t SSL_Write(SSLSock ssl, // IN const char *buf, // IN size_t num) // IN { int ret; ASSERT(ssl); if (ssl->connectionFailed) { SSLSetSystemError(SSL_SOCK_LOST_CONNECTION); ret = SOCKET_ERROR; goto end; } if (ssl->encrypted) { int result = SSL_write(ssl->sslCnx, buf, (int)num); ssl->sslIOError = SSLSetErrorState(ssl->sslCnx, result); if (ssl->sslIOError != SSL_ERROR_NONE) { SSL_LOG(("SSL: Write(%d)\n", ssl->fd)); result = SOCKET_ERROR; } ret = result; } else { ret = SSLGeneric_write(ssl->fd, buf, (int)num); } end: return ret; } /* *---------------------------------------------------------------------- * * SSL_Pending() * * Functional equivalent of select when SSL is enabled * * Results: * Obtain number of readable bytes buffered in an SSL object if SSL * is enabled, otherwise, return 0 * * Side effects: * *---------------------------------------------------------------------- */ int SSL_Pending(SSLSock ssl) // IN { int ret; ASSERT(ssl); if (ssl->encrypted) { ret = SSL_pending(ssl->sslCnx); } else { ret = 0; } return ret; } /* *---------------------------------------------------------------------- * * SSL_SetCloseOnShutdownFlag() * * Sets closeFdOnShutdown flag. * * Results: * None. Always succeeds. Do not call close/closesocket on * the fd after this, call SSL_Shutdown() instead. * * Side effects: * *---------------------------------------------------------------------- */ void SSL_SetCloseOnShutdownFlag(SSLSock ssl) // IN { ASSERT(ssl); ssl->closeFdOnShutdown = TRUE; } /* *---------------------------------------------------------------------- * * SSL_Shutdown() * * Functional equivalent of the close() syscall. Does * not close the actual fd used for the connection. * * * Results: * 0 on success, -1 on failure. * * Side effects: * closes the connection, freeing up the memory associated * with the passed in socket object * *---------------------------------------------------------------------- */ int SSL_Shutdown(SSLSock ssl) // IN { int retVal = 0; ASSERT(ssl); SSL_LOG(("SSL: Starting shutdown for %d\n", ssl->fd)); if (ssl->encrypted) { /* since quiet_shutdown is set, SSL_shutdown always succeeds */ SSL_shutdown(ssl->sslCnx); } if (ssl->sslCnx) { SSL_free(ssl->sslCnx); } if (ssl->closeFdOnShutdown) { SSL_LOG(("SSL: Trying to close %d\n", ssl->fd)); /* * Apparently in the past coverity has complained about the lack * of shutdown() before close() here. However we only want to * shut down the SSL layer, not the socket layer since authd may * handoff the fd to another process. */ retVal = SSLGeneric_close(ssl->fd); } free(ssl); SSL_LOG(("SSL: shutdown done\n")); return retVal; } /* *---------------------------------------------------------------------- * * SSL_GetFd() * * Returns an SSL socket's file descriptor or handle. * * Side effects: * None. * *---------------------------------------------------------------------- */ int SSL_GetFd(SSLSock ssl) // IN { ASSERT(ssl); return ssl->fd; } /* *---------------------------------------------------------------------- * * SSL_WantRead() * * Wrapper around SSL_want_read. * * Results: * That of SSL_want_read. * * Side effects: * None. * *---------------------------------------------------------------------- */ int SSL_WantRead(const SSLSock ssl) { ASSERT(ssl); ASSERT(ssl->sslCnx); return SSL_want_read(ssl->sslCnx); } /* *---------------------------------------------------------------------- * * SSL_TryCompleteAccept() * * Call SSL_Accept() to start or redrive the SSL accept operation. * Nonblocking. * * Results: * > 0 if the SSL_accept completed successfully * = 0 if the SSL_accept need a redrive * < 0 if an error occurred * * Side effects: * None. * *---------------------------------------------------------------------- */ int SSL_TryCompleteAccept(SSLSock ssl) // IN { int sslRet; ASSERT(ssl); ASSERT(ssl->sslCnx); ERR_clear_error(); sslRet = SSL_accept(ssl->sslCnx); ssl->sslIOError = SSL_get_error(ssl->sslCnx, sslRet); switch (ssl->sslIOError) { case SSL_ERROR_NONE: return 1; case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: return 0; default: ssl->connectionFailed = TRUE; SSLPrintErrors(VMW_LOG_INFO); return -1; } } open-vm-tools-10.0.7-3227872/lib/sslDirect/sslStubs.c0000644000000000000000000002233412660700526020350 0ustar rootroot/********************************************************* * Copyright (C) 2013-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * sslStubs.c -- * * Stubs for AsyncSokcet SSL functions without actually using SSL. */ #include #include #include #include #include "str.h" #ifdef _WIN32 #include #else #include #include #include #endif #include "log.h" #include "err.h" #include "msg.h" #include "sslDirect.h" #include "vm_assert.h" #define LOGLEVEL_MODULE SSLStubs #include "loglevel_user.h" struct SSLSockStruct { int fd; Bool closeFdOnShutdown; #ifdef __APPLE__ Bool loggedKernelReadBug; #endif }; /* *---------------------------------------------------------------------- * * SSL_Write() * * Functional equivalent of the write() syscall. * * Results: * Returns the number of bytes written, or -1 on error. * * Side effects: * *---------------------------------------------------------------------- */ ssize_t SSL_Write(SSLSock sslSock, // IN const char *buf, // IN size_t num) // IN { return send(sslSock->fd, buf, num, 0); } /* *---------------------------------------------------------------------- * * SSL_Read -- * * Functional equivalent of the read() syscall. * * Results: * Returns the number of bytes read, or -1 on error. The * data read will be placed in buf. * * Side effects: * * *---------------------------------------------------------------------- */ ssize_t SSL_Read(SSLSock sslSock, // IN char *buf, // OUT size_t num) // IN { int ret; ASSERT(sslSock); #ifdef _WIN32 ret = recv(sslSock->fd, buf, num, 0); #else ret = read(sslSock->fd, buf, num); #endif #ifdef __APPLE__ /* * Detect bug 161237 (Apple bug 5202831), which should no longer be * happening due to a workaround in our code. * * There is a bug on Mac OS 10.4 and 10.5 where passing an fd * over a socket can result in that fd being in an inconsistent state. * We can detect when this happens when read(2) returns zero * even if the other end of the socket is not disconnected. * We verify this by calling write(sslSock->fd, "", 0) and * see if it is okay. (If the socket was really closed, it would * return -1 with errno==EPIPE.) */ if (ret == 0) { ssize_t writeRet; #ifdef VMX86_DEBUG struct stat statBuffer; /* * Make sure we're using a socket. */ ASSERT((fstat(sslSock->fd, &statBuffer) == 0) && ((statBuffer.st_mode & S_IFSOCK) == S_IFSOCK)); #endif writeRet = write(sslSock->fd, "", 0); if (writeRet == 0) { /* * The socket is still good. read(2) should not have returned zero. */ if (! sslSock->loggedKernelReadBug) { Log("Error: Encountered Apple bug #5202831. Disconnecting.\n"); sslSock->loggedKernelReadBug = TRUE; } } } #endif return ret; } /* *---------------------------------------------------------------------- * * SSL_GetFd() * * Returns an socket's file descriptor or handle. * * Side effects: * None. * *---------------------------------------------------------------------- */ int SSL_GetFd(SSLSock sslSock) // IN { ASSERT(sslSock); return sslSock->fd; } /* *---------------------------------------------------------------------- * * SSL_Pending() * * Always returns 0 for non-SSL socket. * * Results: * 0 * * Side effects: * None. * *---------------------------------------------------------------------- */ int SSL_Pending(SSLSock sslSock) // IN { return 0; } /* *---------------------------------------------------------------------- * * SSL_New() * * Results: * Returns a freshly allocated SSLSock structure. * * Side effects: * None * *---------------------------------------------------------------------- */ SSLSock SSL_New(int fd, // IN Bool closeFdOnShutdown) // IN { SSLSock sslSock; sslSock = calloc(1, sizeof *sslSock); ASSERT_MEM_ALLOC(sslSock); sslSock->fd = fd; sslSock->closeFdOnShutdown = closeFdOnShutdown; return sslSock; } /* *---------------------------------------------------------------------- * * SSL_Shutdown() * * Functional equivalent of the close() syscall. Does * not close the actual fd used for the connection. * * * Results: * 0 on success, -1 on failure. * * Side effects: * closes the connection, freeing up the memory associated * with the passed in socket object * *---------------------------------------------------------------------- */ int SSL_Shutdown(SSLSock sslSock) // IN { int ret = 0; ASSERT(sslSock); LOG(10, ("Starting shutdown for %d\n", sslSock->fd)); if (sslSock->closeFdOnShutdown) { LOG(10, ("Trying to close %d\n", sslSock->fd)); #ifdef _WIN32 ret = closesocket(sslSock->fd); #else ret = close(sslSock->fd); #endif } free(sslSock); LOG(10, ("shutdown done\n")); return ret; } /* *---------------------------------------------------------------------- * * SSL_SetCloseOnShutdownFlag() * * Sets closeFdOnShutdown flag. * * Results: * None. Always succeeds. Do not call close/closesocket on * the fd after this, call SSL_Shutdown() instead. * * Side effects: * *---------------------------------------------------------------------- */ void SSL_SetCloseOnShutdownFlag(SSLSock sslSock) // IN { ASSERT(sslSock); sslSock->closeFdOnShutdown = TRUE; } /* *---------------------------------------------------------------------- * * SSL_RecvDataAndFd -- * * recvmsg wrapper which can receive only file descriptors, not other * control data. * * Results: * Returns the number of bytes received, or -1 on error. The * data read will be placed in buf. *fd is either -1 if no fd was * received, or descriptor... * * Side effects: * * *---------------------------------------------------------------------- */ ssize_t SSL_RecvDataAndFd(SSLSock sslSock, // IN/OUT char *buf, // OUT size_t num, // IN int *fd) // OUT { int ret; ASSERT(sslSock); ASSERT(fd); *fd = -1; /* * No fd passing over socket or Windows. Windows needs different code. */ #ifdef _WIN32 return SSL_Read(sslSock, buf, num); #else { struct iovec iov; struct msghdr msg = { 0 }; uint8 cmsgBuf[CMSG_SPACE(sizeof(int))]; iov.iov_base = buf; iov.iov_len = num; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_control = cmsgBuf; msg.msg_controllen = sizeof cmsgBuf; ret = recvmsg(sslSock->fd, &msg, 0); if (ret >= 0 && msg.msg_controllen != 0) { struct cmsghdr *cmsg; for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) { int receivedFd = *(int *)CMSG_DATA(cmsg); ASSERT(*fd == -1); *fd = receivedFd; } } } } #endif return ret; } /* *----------------------------------------------------------------------------- * * SSL_TryCompleteAccept -- * * Stub only, should not be called when SSL is not used. * Results: * 0 * * Side effects: * None. * *----------------------------------------------------------------------------- */ int SSL_TryCompleteAccept(SSLSock ssl) // IN { ASSERT(0); return 0; } /* *----------------------------------------------------------------------------- * * SSL_WantRead -- * * Stub only, should not be called when SSL is not used. * Results: * 0 * * Side effects: * None. * *----------------------------------------------------------------------------- */ int SSL_WantRead(const SSLSock ssl) { ASSERT(0); return 0; } /* *----------------------------------------------------------------------------- * * SSL_SetupAcceptWithContext -- * * Stub only, should not be called when SSL is not used. * Results: * FALSE * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool SSL_SetupAcceptWithContext(SSLSock sSock, // IN: SSL socket void *ctx) // IN: OpenSSL context (SSL_CTX *) { ASSERT(0); return FALSE; } open-vm-tools-10.0.7-3227872/lib/sslDirect/Makefile.in0000644000000000000000000004554112660700526020434 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ @ENABLE_GRABBITMQPROXY_TRUE@am__append_1 = @SSL_CPPFLAGS@ @ENABLE_GRABBITMQPROXY_TRUE@am__append_2 = sslDirect.c @ENABLE_GRABBITMQPROXY_FALSE@am__append_3 = sslStubs.c subdir = lib/sslDirect DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libSslDirect_la_LIBADD = am__libSslDirect_la_SOURCES_DIST = sslDirect.c sslStubs.c @ENABLE_GRABBITMQPROXY_TRUE@am__objects_1 = \ @ENABLE_GRABBITMQPROXY_TRUE@ libSslDirect_la-sslDirect.lo @ENABLE_GRABBITMQPROXY_FALSE@am__objects_2 = \ @ENABLE_GRABBITMQPROXY_FALSE@ libSslDirect_la-sslStubs.lo am_libSslDirect_la_OBJECTS = $(am__objects_1) $(am__objects_2) libSslDirect_la_OBJECTS = $(am_libSslDirect_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libSslDirect_la_SOURCES) DIST_SOURCES = $(am__libSslDirect_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libSslDirect.la libSslDirect_la_CPPFLAGS = $(am__append_1) libSslDirect_la_SOURCES = $(am__append_2) $(am__append_3) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/sslDirect/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/sslDirect/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libSslDirect.la: $(libSslDirect_la_OBJECTS) $(libSslDirect_la_DEPENDENCIES) $(LINK) $(libSslDirect_la_OBJECTS) $(libSslDirect_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSslDirect_la-sslDirect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libSslDirect_la-sslStubs.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 $@ $< libSslDirect_la-sslDirect.lo: sslDirect.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libSslDirect_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libSslDirect_la-sslDirect.lo -MD -MP -MF $(DEPDIR)/libSslDirect_la-sslDirect.Tpo -c -o libSslDirect_la-sslDirect.lo `test -f 'sslDirect.c' || echo '$(srcdir)/'`sslDirect.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libSslDirect_la-sslDirect.Tpo $(DEPDIR)/libSslDirect_la-sslDirect.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sslDirect.c' object='libSslDirect_la-sslDirect.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libSslDirect_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libSslDirect_la-sslDirect.lo `test -f 'sslDirect.c' || echo '$(srcdir)/'`sslDirect.c libSslDirect_la-sslStubs.lo: sslStubs.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libSslDirect_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libSslDirect_la-sslStubs.lo -MD -MP -MF $(DEPDIR)/libSslDirect_la-sslStubs.Tpo -c -o libSslDirect_la-sslStubs.lo `test -f 'sslStubs.c' || echo '$(srcdir)/'`sslStubs.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libSslDirect_la-sslStubs.Tpo $(DEPDIR)/libSslDirect_la-sslStubs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sslStubs.c' object='libSslDirect_la-sslStubs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libSslDirect_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libSslDirect_la-sslStubs.lo `test -f 'sslStubs.c' || echo '$(srcdir)/'`sslStubs.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/hgfsHelper/0000755000000000000000000000000012660700525016510 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/hgfsHelper/Makefile.am0000644000000000000000000000175712660700525020556 0ustar rootroot################################################################################ ### Copyright (C) 2009-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libHgfsHelper.la libHgfsHelper_la_SOURCES = libHgfsHelper_la_SOURCES += hgfsHelperPosix.c open-vm-tools-10.0.7-3227872/lib/hgfsHelper/Makefile.in0000644000000000000000000004040612660700525020561 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2009-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/hgfsHelper DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libHgfsHelper_la_LIBADD = am_libHgfsHelper_la_OBJECTS = hgfsHelperPosix.lo libHgfsHelper_la_OBJECTS = $(am_libHgfsHelper_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libHgfsHelper_la_SOURCES) DIST_SOURCES = $(libHgfsHelper_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libHgfsHelper.la libHgfsHelper_la_SOURCES = hgfsHelperPosix.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/hgfsHelper/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/hgfsHelper/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libHgfsHelper.la: $(libHgfsHelper_la_OBJECTS) $(libHgfsHelper_la_DEPENDENCIES) $(LINK) $(libHgfsHelper_la_OBJECTS) $(libHgfsHelper_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsHelperPosix.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/hgfsHelper/hgfsHelperPosix.c0000644000000000000000000000535712660700525022000 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsHelperPosix.c -- * * Provides a posix helper library for guest applications to access * the HGFS file system. * */ #if !defined __linux__ && !defined __FreeBSD__ && !defined sun && !defined __APPLE__ # error This file should not be compiled #endif #include "vmware.h" #include "debug.h" #include "hgfsHelper.h" #if defined __linux__ #define HGFSHLPR_DEFAULT_MOUNT_PATH "/mnt/hgfs" #elif defined sun #define HGFSHLPR_DEFAULT_MOUNT_PATH "/hgfs" #elif defined __APPLE__ #define HGFSHLPR_DEFAULT_MOUNT_PATH "/Volumes/VMware Shared Folders" #endif /* *----------------------------------------------------------------------------- * * HgfsHlpr_QuerySharesDefaultRootPath -- * * Queries the driver for its share's root paths. * Currently only one is expected to be supported * and returned, although later versions may not. * E.g. "/mnt/hgfs" is the root path to * the HGFS shares. * * Results: * TRUE always. * * Side Effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHlpr_QuerySharesDefaultRootPath(char **hgfsRootPath) { #if defined __FreeBSD__ return FALSE; #else ASSERT(hgfsRootPath != NULL); *hgfsRootPath = Unicode_AllocWithUTF8(HGFSHLPR_DEFAULT_MOUNT_PATH); Debug("%s: HGFS shares root path name \"%s\"\n", __FUNCTION__, *hgfsRootPath); return TRUE; #endif } /* *----------------------------------------------------------------------------- * * HgfsHlpr_FreeSharesRootPath -- * * Frees the share's root paths previously returned * to the caller from the HgfsHlpr_QuerySharesRootPath. * * Results: * None. * * Side Effects: * None. * *----------------------------------------------------------------------------- */ void HgfsHlpr_FreeSharesRootPath(char *hgfsRootPath) { free(hgfsRootPath); } open-vm-tools-10.0.7-3227872/lib/hgfsServer/0000755000000000000000000000000012660700525016537 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServer.c0000644000000000000000000104031512660700525021025 0ustar rootroot/********************************************************* * Copyright (C) 1998,2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #if defined(__APPLE__) /* * DirectoryEntry type that is used in common code is * defined as dirent for Mac OS. * _DARWIN_USE_64_BIT_INODE definition is needed to make dirent * structure definitions in this file and in HgfsServerLinux.c * consistent. */ #define _DARWIN_USE_64_BIT_INODE #endif #include #include #include "vmware.h" #include "str.h" #include "cpName.h" #include "cpNameLite.h" #include "hgfsServerInt.h" #include "hgfsServerPolicy.h" #include "hgfsUtil.h" #include "hgfsVirtualDir.h" #include "codeset.h" #include "dbllnklst.h" #include "file.h" #include "util.h" #include "wiper.h" #include "hgfsServer.h" #include "hgfsServerParameters.h" #include "hgfsServerOplock.h" #include "hgfsDirNotify.h" #include "userlock.h" #include "poll.h" #include "mutexRankLib.h" #include "vm_basic_asm.h" #include "unicodeOperations.h" #if defined(_WIN32) #include #define HGFS_PARENT_DIR "..\\" #else #include #define stricmp strcasecmp #define HGFS_PARENT_DIR "../" #endif // _WIN32 #define HGFS_PARENT_DIR_LEN 3 #define LOGLEVEL_MODULE hgfs #include "loglevel_user.h" /* * Define this to enable an ASSERT on HGFS_STATUS_PROTOCOL_ERROR. * This is useful if client is to be guaranteed to work with the server * without falling back to older protocol versions and to ensure that * clients don't send op value greater than HGFS_OP_MAX. * * NOTE: This flag is only meant to be used while testing. This should * _always_ be undefined when checking code in. */ #if 0 #define HGFS_ASSERT_CLIENT(op) \ do { \ LOG(4, ("%s: op: %u.\n", __FUNCTION__, op)); \ ASSERT(status != HGFS_STATUS_PROTOCOL_ERROR); \ } while(0) #else #define HGFS_ASSERT_CLIENT(op) #endif #define HGFS_ASSERT_INPUT(input) \ ASSERT(input && input->packet && input->request && \ ((!input->sessionEnabled && input->session) || \ (input->sessionEnabled && \ (input->op == HGFS_OP_CREATE_SESSION_V4 || input->session))) && \ (!input->payloadSize || input->payload)) /* * Define this to enable an ASSERT if server gets an op lower than * this value. This is useful if client is to be guaranteed to work with * the server without falling back to older protocol versions. * * NOTE: This flag is only meant to be used while testing. This should * _always_ be undefined when checking code in. */ #if 0 #define HGFS_ASSERT_MINIMUM_OP(op) \ do { \ LOG(4, ("%s: op received - %u.\n", __FUNCTION__, op)); \ ASSERT(op >= HGFS_OP_OPEN_V3); \ } while(0) #else #define HGFS_ASSERT_MINIMUM_OP(op) #endif /* * This ensures that the hgfs name conversion code never fails on long * filenames by using a buffer that is too small. If anything, we will * fail first elsewhere because the name is too big to fit in one hgfs * packet. [bac] */ #define HGFS_PATH_MAX HGFS_PACKET_MAX /* * Array of FileNodes for opening files. */ #define NUM_FILE_NODES 100 #define NUM_SEARCHES 100 /* Default maximun number of open nodes that have server locks. */ #define MAX_LOCKED_FILENODES 10 struct HgfsTransportSessionInfo { /* Default session id. */ uint64 defaultSessionId; /* Lock to manipulate the list of sessions */ MXUserExclLock *sessionArrayLock; /* List of sessions */ DblLnkLst_Links sessionArray; /* Max packet size that is supported by both client and server. */ uint32 maxPacketSize; /* Total number of sessions present this transport session*/ uint32 numSessions; /* Transport session context. */ void *transportData; /* Current state of the session. */ HgfsSessionInfoState state; /* Session is dynamic or internal. */ HgfsSessionInfoType type; /* Function callbacks into Hgfs Channels. */ HgfsServerChannelCallbacks *channelCbTable; Atomic_uint32 refCount; /* Reference count for session. */ HgfsServerChannelData channelCapabilities; }; /* The input request paramaters object. */ typedef struct HgfsInputParam { const void *request; /* Hgfs header followed by operation request */ size_t requestSize; /* Size of Hgfs header and operation request */ HgfsSessionInfo *session; /* Hgfs session data */ HgfsTransportSessionInfo *transportSession; HgfsPacket *packet; /* Public (server/transport) Hgfs packet */ const void *payload; /* Hgfs operation request */ uint32 payloadOffset; /* Offset to start of Hgfs operation request */ size_t payloadSize; /* Hgfs operation request size */ HgfsOp op; /* Hgfs operation command code */ uint32 id; /* Request ID to be matched with the reply */ Bool sessionEnabled; /* Requests have session enabled headers */ } HgfsInputParam; /* * The HGFS server configurable settings. * (Note: the guest sets these to all defaults only modifiable from the VMX.) */ static HgfsServerConfig gHgfsCfgSettings = { (HGFS_CONFIG_NOTIFY_ENABLED | HGFS_CONFIG_VOL_INFO_MIN), HGFS_MAX_CACHED_FILENODES }; /* * Monotonically increasing handle counter used to dish out HgfsHandles. * This value is checkpointed. */ static Atomic_uint32 hgfsHandleCounter = {0}; /* * Number of outstanding asynchronous operations. */ static Atomic_uint32 gHgfsAsyncCounter = {0}; static MXUserExclLock *gHgfsAsyncLock; static MXUserCondVar *gHgfsAsyncVar; static HgfsServerMgrCallbacks *gHgfsMgrData = NULL; /* * Session usage and locking. * * The channel will serialize callbacks to connect, disconnect, close * and invalidate objects for sessions. * The receives will also be serialized with the above when received through * the backdoor channel. * However, when requests are received from a socket, they will be from a * worker thread. It is the responsibility of the socket channel to keep * the session alive when processing the receive request which it does by * an additional reference for the session. This means even if a disconnect * occurs and the socket is closed, the channel will not call the session * close until the hgfs server returns from the receive processing. Thus * the hgfs server session data will remain valid. * When the hgfs server processes requests asynchronously, or returns from * receive request prior to sending the reply to be done at a later time, * a reference on the session is taken out while processing the message, * and not removed until the reply is processed. This reference will ensure * the session is not torndown until the final reference is removed, even * if the close session is called from the channel. */ /* Session related callbacks. */ static void HgfsServerSessionReceive(HgfsPacket *packet, void *clientData); static Bool HgfsServerSessionConnect(void *transportData, HgfsServerChannelCallbacks *channelCbTable, HgfsServerChannelData *channelCapabililies, void **clientData); static void HgfsServerSessionDisconnect(void *clientData); static void HgfsServerSessionClose(void *clientData); static void HgfsServerSessionInvalidateObjects(void *clientData, DblLnkLst_Links *shares); static uint32 HgfsServerSessionInvalidateInactiveSessions(void *clientData); static void HgfsServerSessionSendComplete(HgfsPacket *packet, void *clientData); static HgfsSharedFolderHandle HgfsServerRegisterShare(const char *shareName, const char *sharePath, Bool addFolder); /* * Callback table passed to transport and any channels. */ HgfsServerCallbacks gHgfsServerCBTable = { { HgfsServerSessionConnect, HgfsServerSessionDisconnect, HgfsServerSessionClose, HgfsServerSessionReceive, HgfsServerSessionInvalidateObjects, HgfsServerSessionInvalidateInactiveSessions, HgfsServerSessionSendComplete, }, HgfsServerRegisterShare, }; /* Lock that protects shared folders list. */ static MXUserExclLock *gHgfsSharedFoldersLock = NULL; /* List of shared folders nodes. */ static DblLnkLst_Links gHgfsSharedFoldersList; static Bool gHgfsInitialized = FALSE; /* * Number of active sessions that support change directory notification. HGFS server * needs to maintain up-to-date shared folders list when there is * at least one such session. */ static Bool gHgfsDirNotifyActive = FALSE; typedef struct HgfsSharedFolderProperties { DblLnkLst_Links links; char *name; /* Name of the share. */ HgfsSharedFolderHandle notificationHandle; /* Directory notification handle. */ Bool markedForDeletion; } HgfsSharedFolderProperties; /* Allocate/Add sessions helper functions. */ static Bool HgfsServerAllocateSession(HgfsTransportSessionInfo *transportSession, HgfsSessionInfo **sessionData); static HgfsInternalStatus HgfsServerTransportAddSessionToList(HgfsTransportSessionInfo *transportSession, HgfsSessionInfo *sessionInfo); static void HgfsServerTransportRemoveSessionFromList(HgfsTransportSessionInfo *transportSession, HgfsSessionInfo *sessionInfo); static HgfsSessionInfo * HgfsServerTransportGetSessionInfo(HgfsTransportSessionInfo *transportSession, uint64 sessionId); /* Local functions. */ static void HgfsInvalidateSessionObjects(DblLnkLst_Links *shares, HgfsSessionInfo *session); static Bool HgfsAddToCacheInternal(HgfsHandle handle, HgfsSessionInfo *session); static Bool HgfsIsCachedInternal(HgfsHandle handle, HgfsSessionInfo *session); static Bool HgfsRemoveLruNode(HgfsSessionInfo *session); static Bool HgfsRemoveFromCacheInternal(HgfsHandle handle, HgfsSessionInfo *session); static void HgfsRemoveSearchInternal(HgfsSearch *search, HgfsSessionInfo *session); static HgfsSearch *HgfsSearchHandle2Search(HgfsHandle handle, HgfsSessionInfo *session); static HgfsHandle HgfsSearch2SearchHandle(HgfsSearch const *search); static HgfsSearch *HgfsAddNewSearch(char const *utf8Dir, DirectorySearchType type, char const *utf8ShareName, char const *rootDir, HgfsSessionInfo *session); static void HgfsDumpAllSearches(HgfsSessionInfo *session); static void HgfsDumpAllNodes(HgfsSessionInfo *session); static void HgfsFreeFileNode(HgfsHandle handle, HgfsSessionInfo *session); static void HgfsFreeFileNodeInternal(HgfsHandle handle, HgfsSessionInfo *session); static HgfsFileNode *HgfsAddNewFileNode(HgfsFileOpenInfo *openInfo, HgfsLocalId const *localId, fileDesc fileDesc, Bool append, size_t shareNameLen, char const *shareName, Bool sharedFolderOpen, HgfsSessionInfo *session); static void HgfsRemoveFileNode(HgfsFileNode *node, HgfsSessionInfo *session); static HgfsFileNode *HgfsGetNewNode(HgfsSessionInfo *session); static HgfsHandle HgfsFileNode2Handle(HgfsFileNode const *fileNode); static HgfsFileNode *HgfsHandle2FileNode(HgfsHandle handle, HgfsSessionInfo *session); static void HgfsServerExitSessionInternal(HgfsSessionInfo *session); static Bool HgfsIsShareRoot(char const *cpName, size_t cpNameSize); static void HgfsServerCompleteRequest(HgfsInternalStatus status, size_t replyPayloadSize, HgfsInputParam *input); static Bool HgfsHandle2NotifyInfo(HgfsHandle handle, HgfsSessionInfo *session, char **fileName, size_t *fileNameSize, HgfsSharedFolderHandle *folderHandle); static void HgfsServerDirWatchEvent(HgfsSharedFolderHandle sharedFolder, HgfsSubscriberHandle subscriber, char* fileName, uint32 mask, struct HgfsSessionInfo *session); static void HgfsFreeSearchDirents(HgfsSearch *search); static HgfsInternalStatus HgfsServerTransportGetDefaultSession(HgfsTransportSessionInfo *transportSession, HgfsSessionInfo **session); static Bool HgfsPacketSend(HgfsPacket *packet, HgfsTransportSessionInfo *transportSession, HgfsSendFlags flags); /* * Opcode handlers */ static void HgfsServerOpen(HgfsInputParam *input); static void HgfsServerRead(HgfsInputParam *input); static void HgfsServerWrite(HgfsInputParam *input); static void HgfsServerSearchOpen(HgfsInputParam *input); static void HgfsServerSearchRead(HgfsInputParam *input); static void HgfsServerGetattr(HgfsInputParam *input); static void HgfsServerSetattr(HgfsInputParam *input); static void HgfsServerCreateDir(HgfsInputParam *input); static void HgfsServerDeleteFile(HgfsInputParam *input); static void HgfsServerDeleteDir(HgfsInputParam *input); static void HgfsServerRename(HgfsInputParam *input); static void HgfsServerQueryVolume(HgfsInputParam *input); static void HgfsServerSymlinkCreate(HgfsInputParam *input); static void HgfsServerServerLockChange(HgfsInputParam *input); static void HgfsServerWriteWin32Stream(HgfsInputParam *input); static void HgfsServerCreateSession(HgfsInputParam *input); static void HgfsServerDestroySession(HgfsInputParam *input); static void HgfsServerClose(HgfsInputParam *input); static void HgfsServerSearchClose(HgfsInputParam *input); static void HgfsServerSetDirNotifyWatch(HgfsInputParam *input); static void HgfsServerRemoveDirNotifyWatch(HgfsInputParam *input); /* *---------------------------------------------------------------------------- * * HgfsServerSessionGet -- * * Increment session reference count. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void HgfsServerSessionGet(HgfsSessionInfo *session) // IN: session context { ASSERT(session); Atomic_Inc(&session->refCount); } /* *---------------------------------------------------------------------------- * * HgfsServerSessionPut -- * * Decrement session reference count. * * Free session info data if no reference. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void HgfsServerSessionPut(HgfsSessionInfo *session) // IN: session context { ASSERT(session); if (Atomic_ReadDec32(&session->refCount) == 1) { HgfsServerExitSessionInternal(session); } } /* *---------------------------------------------------------------------------- * * HgfsServerTransportSessionGet -- * * Increment transport session reference count. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void HgfsServerTransportSessionGet(HgfsTransportSessionInfo *transportSession) // IN: session context { ASSERT(transportSession); Atomic_Inc(&transportSession->refCount); } /* *---------------------------------------------------------------------------- * * HgfsServerTransportSessionPut -- * * Decrement transport session reference count. * * Free session info data if no reference. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void HgfsServerTransportSessionPut(HgfsTransportSessionInfo *transportSession) // IN: transport session context { ASSERT(transportSession); if (Atomic_ReadDec32(&transportSession->refCount) == 1) { DblLnkLst_Links *curr, *next; MXUser_AcquireExclLock(transportSession->sessionArrayLock); DblLnkLst_ForEachSafe(curr, next, &transportSession->sessionArray) { HgfsSessionInfo *session = DblLnkLst_Container(curr, HgfsSessionInfo, links); HgfsServerTransportRemoveSessionFromList(transportSession, session); HgfsServerSessionPut(session); } MXUser_ReleaseExclLock(transportSession->sessionArrayLock); } } /* *----------------------------------------------------------------------------- * * HgfsServerInitHandleCounter -- * * Initialize the file handle counter to the new value passed. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerInitHandleCounter(uint32 newHandleCounter) { Atomic_Write(&hgfsHandleCounter, newHandleCounter); } /* *----------------------------------------------------------------------------- * * HgfsServerGetHandleCounter -- * * Return file handle counter. This is used by the checkpointing code to * checkpoint this value so we avoid the risk of handle collision. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static uint32 HgfsServerGetHandleCounter(void) { return Atomic_Read(&hgfsHandleCounter); } /* *----------------------------------------------------------------------------- * * HgfsServerGetNextHandleCounter -- * * Return file handle counter. This is used by the checkpointing code to * checkpoint this value so we avoid the risk of handle collision. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static uint32 HgfsServerGetNextHandleCounter(void) { return Atomic_ReadInc32(&hgfsHandleCounter); } /* *----------------------------------------------------------------------------- * * HgfsHandle2FileNode -- * * Retrieve the file node a handle refers to. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * The file node if the handle is valid (i.e. it refers to an existing file * node that is currently in use). * NULL if the handle is invalid. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static HgfsFileNode * HgfsHandle2FileNode(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session) // IN: Session info { unsigned int i; HgfsFileNode *fileNode = NULL; ASSERT(session); ASSERT(session->nodeArray); /* XXX: This O(n) lookup can and should be optimized. */ for (i = 0; i < session->numNodes; i++) { if (session->nodeArray[i].state != FILENODE_STATE_UNUSED && session->nodeArray[i].handle == handle) { fileNode = &session->nodeArray[i]; break; } } return fileNode; } /* *----------------------------------------------------------------------------- * * HgfsFileNode2Handle -- * * Retrieve the handle that represents a file node outside of the server. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * The handle * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsHandle HgfsFileNode2Handle(HgfsFileNode const *fileNode) // IN { ASSERT(fileNode); return fileNode->handle; } /* *----------------------------------------------------------------------------- * * HgfsDumpAllNodes -- * * Debugging routine; print all nodes in the nodeArray. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsDumpAllNodes(HgfsSessionInfo *session) // IN: session info { unsigned int i; ASSERT(session); ASSERT(session->nodeArray); Log("Dumping all nodes\n"); for (i = 0; i < session->numNodes; i++) { Log("handle %u, name \"%s\", localdev %"FMT64"u, localInum %"FMT64"u %u\n", session->nodeArray[i].handle, session->nodeArray[i].utf8Name ? session->nodeArray[i].utf8Name : "NULL", session->nodeArray[i].localId.volumeId, session->nodeArray[i].localId.fileId, session->nodeArray[i].fileDesc); } Log("Done\n"); } /* *----------------------------------------------------------------------------- * * HgfsHandle2FileDesc -- * * Retrieve the file descriptor (host OS file handle) based on the hgfs * handle. * * Results: * TRUE if the handle is valid and the file desc was retrieved successfully. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2FileDesc(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info fileDesc *fd, // OUT: OS handle (file descriptor) void **fileCtx) // OUT: OS file context { Bool found = FALSE; HgfsFileNode *fileNode = NULL; MXUser_AcquireExclLock(session->nodeArrayLock); fileNode = HgfsHandle2FileNode(handle, session); if (fileNode == NULL) { goto exit; } *fd = fileNode->fileDesc; if (fileCtx) { *fileCtx = fileNode->fileCtx; } found = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsHandle2AppendFlag -- * * Retrieve the append flag for the file node that corresponds to * the specified hgfs handle. * * Results: * TRUE if the handle is valid and append flag was retrieved successfully. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2AppendFlag(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info Bool *appendFlag) // OUT: append flag { Bool found = FALSE; HgfsFileNode *fileNode = NULL; MXUser_AcquireExclLock(session->nodeArrayLock); fileNode = HgfsHandle2FileNode(handle, session); if (fileNode == NULL) { goto exit; } *appendFlag = fileNode->flags & HGFS_FILE_NODE_APPEND_FL; found = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsHandle2LocalId -- * * Retrieve the local id for the file node that corresponds to * the specified hgfs handle. * * Results: * TRUE if the hgfs handle is valid and local id was retrieved successfully. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2LocalId(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info HgfsLocalId *localId) // OUT: local id info { Bool found = FALSE; HgfsFileNode *fileNode = NULL; ASSERT(localId); MXUser_AcquireExclLock(session->nodeArrayLock); fileNode = HgfsHandle2FileNode(handle, session); if (fileNode == NULL) { goto exit; } localId->volumeId = fileNode->localId.volumeId; localId->fileId = fileNode->localId.fileId; found = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsFileDesc2Handle -- * * Given an OS handle/fd, return file's hgfs handle. * * Results: * TRUE if the node was found. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsFileDesc2Handle(fileDesc fd, // IN: OS handle (file descriptor) HgfsSessionInfo *session, // IN: Session info HgfsHandle *handle) // OUT: Hgfs file handle { unsigned int i; Bool found = FALSE; HgfsFileNode *existingFileNode = NULL; ASSERT(session); ASSERT(session->nodeArray); MXUser_AcquireExclLock(session->nodeArrayLock); for (i = 0; i < session->numNodes; i++) { existingFileNode = &session->nodeArray[i]; if ((existingFileNode->state == FILENODE_STATE_IN_USE_CACHED) && (existingFileNode->fileDesc == fd)) { *handle = HgfsFileNode2Handle(existingFileNode); found = TRUE; break; } } MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsHandle2ShareMode -- * * Given an OS handle/fd, return the share access mode. * * Results: * TRUE if the node was found. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2ShareMode(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info HgfsOpenMode *shareMode) // OUT:share access mode { Bool found = FALSE; HgfsFileNode *existingFileNode = NULL; HgfsNameStatus nameStatus; if (shareMode == NULL) { return found; } MXUser_AcquireExclLock(session->nodeArrayLock); existingFileNode = HgfsHandle2FileNode(handle, session); if (existingFileNode == NULL) { goto exit_unlock; } nameStatus = HgfsServerPolicy_GetShareMode(existingFileNode->shareName, existingFileNode->shareNameLen, shareMode); found = (nameStatus == HGFS_NAME_STATUS_COMPLETE); exit_unlock: MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsHandle2FileName -- * * Given an OS handle/fd, return file's hgfs name. * * Results: * TRUE if the node was found. * FALSE otherwise. * * Side effects: * Allocates memory and makes a copy of the file name. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2FileName(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session,// IN: Session info char **fileName, // OUT: UTF8 file name size_t *fileNameSize) // OUT: UTF8 file name size { Bool unused1, unused2; return HgfsHandle2FileNameMode(handle, session, &unused1, &unused2, fileName, fileNameSize); } /* *----------------------------------------------------------------------------- * * HgfsHandle2FileNameMode -- * * Given an OS handle/fd, return file's hgfs name and permissions * associated with the corresponding shared folder. * * Results: * TRUE if the node was found. * FALSE otherwise. * * Side effects: * Allocates memory and makes a copy of the file name. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2FileNameMode(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session,// IN: Session info Bool *readPermissions, // OUT: shared folder permissions Bool *writePermissions, // OUT: shared folder permissions char **fileName, // OUT: UTF8 file name size_t *fileNameSize) // OUT: UTF8 file name size { Bool found = FALSE; HgfsFileNode *existingFileNode = NULL; char *name = NULL; size_t nameSize = 0; if ((fileName == NULL) || (fileNameSize == NULL)) { return found; } MXUser_AcquireExclLock(session->nodeArrayLock); existingFileNode = HgfsHandle2FileNode(handle, session); if (existingFileNode == NULL) { goto exit_unlock; } name = malloc(existingFileNode->utf8NameLen + 1); if (name == NULL) { goto exit_unlock; } *readPermissions = existingFileNode->shareInfo.readPermissions; *writePermissions = existingFileNode->shareInfo.writePermissions; nameSize = existingFileNode->utf8NameLen; memcpy(name, existingFileNode->utf8Name, nameSize); name[nameSize] = '\0'; found = TRUE; exit_unlock: MXUser_ReleaseExclLock(session->nodeArrayLock); *fileName = name; *fileNameSize = nameSize; return found; } /* *----------------------------------------------------------------------------- * * HgfsHandle2FileNameMode -- * * Given an OS handle/fd, return information needed for directory * notification package: relative to the root share file name and * shared folder notification handle. * * Results: * TRUE if the node was found. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2NotifyInfo(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info char **fileName, // OUT: UTF8 file name size_t *fileNameSize, // OUT: UTF8 file name size HgfsSharedFolderHandle *folderHandle) // OUT: shared folder handle { Bool found = FALSE; HgfsFileNode *existingFileNode; char *name; size_t nameSize; ASSERT(fileName != NULL && fileNameSize != NULL); MXUser_AcquireExclLock(session->nodeArrayLock); existingFileNode = HgfsHandle2FileNode(handle, session); if (NULL != existingFileNode) { nameSize = existingFileNode->utf8NameLen - existingFileNode->shareInfo.rootDirLen; name = Util_SafeMalloc(nameSize + 1); *folderHandle = existingFileNode->shareInfo.handle; memcpy(name, existingFileNode->utf8Name, nameSize); name[nameSize] = '\0'; *fileName = name; *fileNameSize = nameSize; found = TRUE; } MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsGetNodeCopy -- * * Make a copy of the node. The node should not be kept around for long, as * the data might become stale. This is mostly a convenience function to get * node fields more efficiently. * * Results: * TRUE if the hgfs handle is valid and the copy was successful. * FALSE otherwise. * * Side effects: * Allocates memory for node.utf8Name if copyName was set to TRUE. * *----------------------------------------------------------------------------- */ Bool HgfsGetNodeCopy(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info Bool copyName, // IN: Should we copy the name? HgfsFileNode *copy) // IN/OUT: Copy of the node { HgfsFileNode *original = NULL; Bool found = FALSE; ASSERT(copy); MXUser_AcquireExclLock(session->nodeArrayLock); original = HgfsHandle2FileNode(handle, session); if (original == NULL) { goto exit; } if (copyName) { copy->utf8Name = malloc(original->utf8NameLen + 1); if (copy->utf8Name == NULL) { goto exit; } copy->utf8NameLen = original->utf8NameLen; memcpy(copy->utf8Name, original->utf8Name, copy->utf8NameLen); copy->utf8Name[copy->utf8NameLen] = '\0'; } else { copy->utf8Name = NULL; copy->utf8NameLen = 0; } copy->localId = original->localId; copy->fileDesc = original->fileDesc; copy->mode = original->mode; copy->shareAccess = original->shareAccess; copy->flags = original->flags; copy->state = original->state; copy->handle = original->handle; copy->fileCtx = original->fileCtx; found = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return found; } /* *---------------------------------------------------------------------------- * * HgfsHandleIsSequentialOpen -- * * Get the Hgfs open mode this handle was originally opened with. * * Results: * TRUE on success, FALSE on failure. sequentialOpen is filled in on * success. * * Side effects: * None. * *---------------------------------------------------------------------------- */ Bool HgfsHandleIsSequentialOpen(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info Bool *sequentialOpen) // OUT: If open was sequential { HgfsFileNode *node; Bool success = FALSE; ASSERT(sequentialOpen); MXUser_AcquireExclLock(session->nodeArrayLock); node = HgfsHandle2FileNode(handle, session); if (node == NULL) { goto exit; } *sequentialOpen = node->flags & HGFS_FILE_NODE_SEQUENTIAL_FL; success = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return success; } /* *---------------------------------------------------------------------------- * * HgfsHandleIsSharedFolderOpen -- * * Find if this is a shared folder open. * * Results: * TRUE on success, FALSE on failure. sharedFolderOpen is filled in on * success. * * Side effects: * None. * *---------------------------------------------------------------------------- */ Bool HgfsHandleIsSharedFolderOpen(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info Bool *sharedFolderOpen) // OUT: If shared folder { HgfsFileNode *node; Bool success = FALSE; ASSERT(sharedFolderOpen); MXUser_AcquireExclLock(session->nodeArrayLock); node = HgfsHandle2FileNode(handle, session); if (node == NULL) { goto exit; } *sharedFolderOpen = node->flags & HGFS_FILE_NODE_SHARED_FOLDER_OPEN_FL; success = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return success; } /* *----------------------------------------------------------------------------- * * HgfsUpdateNodeFileDesc -- * * Given a hgfs file handle, update the node with the new file desc (OS * handle) information. * * Results: * TRUE if the update is successful. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsUpdateNodeFileDesc(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info fileDesc fd, // IN: OS handle (file desc) void *fileCtx) // IN: OS file context { HgfsFileNode *node; Bool updated = FALSE; MXUser_AcquireExclLock(session->nodeArrayLock); node = HgfsHandle2FileNode(handle, session); if (node == NULL) { goto exit; } node->fileDesc = fd; node->fileCtx = fileCtx; updated = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return updated; } /* *----------------------------------------------------------------------------- * * HgfsUpdateNodeServerLock -- * * Given a file desc (OS handle), update the node with the new oplock * information. * * Results: * TRUE if the update is successful. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsUpdateNodeServerLock(fileDesc fd, // IN: OS handle HgfsSessionInfo *session, // IN: Session info HgfsLockType serverLock) // IN: new oplock { unsigned int i; HgfsFileNode *existingFileNode = NULL; Bool updated = FALSE; ASSERT(session); ASSERT(session->nodeArray); MXUser_AcquireExclLock(session->nodeArrayLock); for (i = 0; i < session->numNodes; i++) { existingFileNode = &session->nodeArray[i]; if (existingFileNode->state != FILENODE_STATE_UNUSED) { if (existingFileNode->fileDesc == fd) { existingFileNode->serverLock = serverLock; updated = TRUE; break; } } } MXUser_ReleaseExclLock(session->nodeArrayLock); return updated; } /* *----------------------------------------------------------------------------- * * HgfsUpdateNodeAppendFlag -- * * Given a hgfs file handle, update the node with the append flag info. * * Results: * TRUE if the update is successful. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsUpdateNodeAppendFlag(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info Bool appendFlag) // OUT: Append flag { HgfsFileNode *node; Bool updated = FALSE; MXUser_AcquireExclLock(session->nodeArrayLock); node = HgfsHandle2FileNode(handle, session); if (node == NULL) { goto exit; } if (appendFlag) { node->flags |= HGFS_FILE_NODE_APPEND_FL; } updated = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return updated; } /* *----------------------------------------------------------------------------- * * HgfsServerCheckOpenFlagsForShare -- * * Given an open mode check this is compatible with the mode for * the share upon which the open file resides. * * If the share is read only and mode is HGFS_OPEN_CREATE we remap * it to HGFS_OPEN which is allowed if the file exists. * * Results: * TRUE if the mode is compatible. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsServerCheckOpenFlagsForShare(HgfsFileOpenInfo *openInfo,// IN: Hgfs file handle HgfsOpenFlags *flags) // IN/OUT: open mode { Bool status = TRUE; HgfsNameStatus nameStatus; HgfsOpenMode shareMode; char const *inEnd; char const *next; int len; ASSERT(openInfo); ASSERT(flags); inEnd = openInfo->cpName + openInfo->cpNameSize; /* The share name is the first component of the cross-platform name. */ len = CPName_GetComponent(openInfo->cpName, inEnd, &next); if (len < 0) { LOG(4, ("%s: get first component failed\n", __FUNCTION__)); status = FALSE; goto exit; } nameStatus = HgfsServerPolicy_GetShareMode(openInfo->cpName, len, &shareMode); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { status = FALSE; goto exit; } if (shareMode == HGFS_OPEN_MODE_READ_ONLY) { /* Read only share we may have work to do. */ if (*flags != HGFS_OPEN && *flags != HGFS_OPEN_CREATE) { status = FALSE; goto exit; } if (*flags == HGFS_OPEN_CREATE) { /* * Map open or create, to just open, which will fail if * if the file does not exist, which it is okay, as creating * a new file is not allowed and should be failed. */ *flags = HGFS_OPEN; } } exit: return status; } /* *----------------------------------------------------------------------------- * * HgfsDumpAllSearches -- * * Debugging routine; print all searches in the searchArray. * * Caller should hold the session's searchArrayLock. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsDumpAllSearches(HgfsSessionInfo *session) // IN: session info { unsigned int i; ASSERT(session); ASSERT(session->searchArray); Log("Dumping all searches\n"); for (i = 0; i < session->numSearches; i++) { Log("handle %u, baseDir \"%s\"\n", session->searchArray[i].handle, session->searchArray[i].utf8Dir ? session->searchArray[i].utf8Dir : "(NULL)"); } Log("Done\n"); } /* *----------------------------------------------------------------------------- * * HgfsGetNewNode -- * * Remove a node from the free list and return it. Nodes on * the free list should already be initialized. * * If the free list is empty, reallocates more memory, * initializes it appropriately, adds the new entries to the * free list, and then returns one off the free list. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * An unused file node on success * NULL on failure * * Side effects: * Memory allocation (potentially). * *----------------------------------------------------------------------------- */ static HgfsFileNode * HgfsGetNewNode(HgfsSessionInfo *session) // IN: session info { HgfsFileNode *node; HgfsFileNode *newMem; unsigned int newNumNodes; unsigned int i; ASSERT(session); ASSERT(session->nodeArray); LOG(4, ("%s: entered\n", __FUNCTION__)); if (!DblLnkLst_IsLinked(&session->nodeFreeList)) { /* * This has to be unsigned and with maximum bit length. This is * required to take care of "negative" differences as well. */ uintptr_t ptrDiff; if (DOLOG(4)) { Log("Dumping nodes before realloc\n"); HgfsDumpAllNodes(session); } /* Try to get twice as much memory as we had */ newNumNodes = 2 * session->numNodes; newMem = (HgfsFileNode *)realloc(session->nodeArray, newNumNodes * sizeof *(session->nodeArray)); if (!newMem) { LOG(4, ("%s: can't realloc more nodes\n", __FUNCTION__)); return NULL; } ptrDiff = (char *)newMem - (char *)session->nodeArray; if (ptrDiff) { size_t const oldSize = session->numNodes * sizeof *(session->nodeArray); /* * The portion of memory that contains all our file nodes moved. * All pointers that pointed inside the previous portion of memory * must be updated to point to the new portion of memory. * * We'll need to lock this if we multithread. */ LOG(4, ("Rebasing pointers, diff is %"FMTSZ"u, sizeof node is " "%"FMTSZ"u\n", ptrDiff, sizeof(HgfsFileNode))); LOG(4, ("old: %p new: %p\n", session->nodeArray, newMem)); ASSERT(newMem == (HgfsFileNode *)((char*)session->nodeArray + ptrDiff)); #define HgfsServerRebase(_ptr, _type) \ if ((size_t)((char *)_ptr - (char *)session->nodeArray) < oldSize) { \ _ptr = (_type *)((char *)_ptr + ptrDiff); \ } /* * Rebase the links of all file nodes */ for (i = 0; i < session->numNodes; i++) { HgfsServerRebase(newMem[i].links.prev, DblLnkLst_Links) HgfsServerRebase(newMem[i].links.next, DblLnkLst_Links) } /* * There is no need to rebase the anchor of the file node free list * because if we are here, it is empty. */ /* Rebase the anchor of the cached file nodes list. */ HgfsServerRebase(session->nodeCachedList.prev, DblLnkLst_Links) HgfsServerRebase(session->nodeCachedList.next, DblLnkLst_Links) #undef HgfsServerRebase } /* Initialize the new nodes */ LOG(4, ("numNodes was %u, now is %u\n", session->numNodes, newNumNodes)); for (i = session->numNodes; i < newNumNodes; i++) { DblLnkLst_Init(&newMem[i].links); newMem[i].state = FILENODE_STATE_UNUSED; newMem[i].utf8Name = NULL; newMem[i].utf8NameLen = 0; newMem[i].fileCtx = NULL; /* Append at the end of the list */ DblLnkLst_LinkLast(&session->nodeFreeList, &newMem[i].links); } session->nodeArray = newMem; session->numNodes = newNumNodes; if (DOLOG(4)) { Log("Dumping nodes after pointer changes\n"); HgfsDumpAllNodes(session); } } /* Remove the first item from the list */ node = DblLnkLst_Container(session->nodeFreeList.next, HgfsFileNode, links); DblLnkLst_Unlink1(&node->links); return node; } /* *----------------------------------------------------------------------------- * * HgfsRemoveFileNode -- * * Free its localname, clear its fields, return it to the free list. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * None * * Side effects: * node->utf8Name is freed. * node->state is set to FILENODE_STATE_UNUSED. * *----------------------------------------------------------------------------- */ static void HgfsRemoveFileNode(HgfsFileNode *node, // IN: file node HgfsSessionInfo *session) // IN: session info { ASSERT(node); LOG(4, ("%s: handle %u, name %s, fileId %"FMT64"u\n", __FUNCTION__, HgfsFileNode2Handle(node), node->utf8Name, node->localId.fileId)); if (node->shareName) { free(node->shareName); node->shareName = NULL; } if (node->utf8Name) { free(node->utf8Name); node->utf8Name = NULL; } node->state = FILENODE_STATE_UNUSED; ASSERT(node->fileCtx == NULL); node->fileCtx = NULL; if (node->shareInfo.rootDir) { free((void*)node->shareInfo.rootDir); node->shareInfo.rootDir = NULL; } /* Prepend at the beginning of the list */ DblLnkLst_LinkFirst(&session->nodeFreeList, &node->links); } /* *----------------------------------------------------------------------------- * * HgfsFreeFileNodeInternal -- * * Free its localname, clear its fields, return it to the free list. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * None * * Side effects: * node->utf8Name is freed. * node->state is set to FILENODE_STATE_UNUSED. * *----------------------------------------------------------------------------- */ static void HgfsFreeFileNodeInternal(HgfsHandle handle, // IN: Handle to free HgfsSessionInfo *session) // IN: Session info { HgfsFileNode *node = HgfsHandle2FileNode(handle, session); ASSERT(node); HgfsRemoveFileNode(node, session); } /* *----------------------------------------------------------------------------- * * HgfsFreeFileNode -- * * Free its localname, clear its fields, return it to the free list. * * Results: * None * * Side effects: * node->utf8Name is freed. * node->state is set to FILENODE_STATE_UNUSED. * *----------------------------------------------------------------------------- */ static void HgfsFreeFileNode(HgfsHandle handle, // IN: Handle to free HgfsSessionInfo *session) // IN: Session info { MXUser_AcquireExclLock(session->nodeArrayLock); HgfsFreeFileNodeInternal(handle, session); MXUser_ReleaseExclLock(session->nodeArrayLock); } /* *----------------------------------------------------------------------------- * * HgfsAddNewFileNode -- * * Gets a free node off the free list, sets its name, localId info, * file descriptor and permissions. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * A pointer to the newly added node on success * NULL on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsFileNode * HgfsAddNewFileNode(HgfsFileOpenInfo *openInfo, // IN: open info struct HgfsLocalId const *localId, // IN: Local unique file ID fileDesc fileDesc, // IN: File Handle Bool append, // IN: open with append flag size_t shareNameLen, // IN: share name byte length char const *shareName, // IN: share name Bool sharedFolderOpen, // IN: shared folder only open HgfsSessionInfo *session) // IN: session info { HgfsFileNode *newNode; char* rootDir; ASSERT(openInfo); ASSERT(localId); ASSERT(session); /* This was already verified in HgfsUnpackOpenRequest... */ ASSERT(openInfo->mask & HGFS_OPEN_VALID_FILE_NAME); /* Get an unused node */ newNode = HgfsGetNewNode(session); if (!newNode) { LOG(4, ("%s: out of memory\n", __FUNCTION__)); return NULL; } /* Set new node's fields */ if (!HgfsServerGetOpenMode(openInfo, &newNode->mode)) { HgfsRemoveFileNode(newNode, session); return NULL; } /* * Save a copy of the share name so we can look up its * access mode at various times over the node's lifecycle. */ newNode->shareName = malloc(shareNameLen + 1); if (newNode->shareName == NULL) { LOG(4, ("%s: out of memory\n", __FUNCTION__)); HgfsRemoveFileNode(newNode, session); return NULL; } memcpy(newNode->shareName, shareName, shareNameLen); newNode->shareName[shareNameLen] = '\0'; newNode->shareNameLen = shareNameLen; newNode->utf8NameLen = strlen(openInfo->utf8Name); newNode->utf8Name = malloc(newNode->utf8NameLen + 1); if (newNode->utf8Name == NULL) { LOG(4, ("%s: out of memory\n", __FUNCTION__)); HgfsRemoveFileNode(newNode, session); return NULL; } memcpy(newNode->utf8Name, openInfo->utf8Name, newNode->utf8NameLen); newNode->utf8Name[newNode->utf8NameLen] = '\0'; newNode->shareInfo.rootDirLen = strlen(openInfo->shareInfo.rootDir); rootDir = malloc(newNode->shareInfo.rootDirLen + 1); if (rootDir == NULL) { LOG(4, ("HgfsAddNewFileNode: out of memory\n")); HgfsRemoveFileNode(newNode, session); return NULL; } memcpy(rootDir, openInfo->shareInfo.rootDir, newNode->shareInfo.rootDirLen); rootDir[newNode->shareInfo.rootDirLen] = '\0'; newNode->shareInfo.rootDir = rootDir; newNode->handle = HgfsServerGetNextHandleCounter(); newNode->localId = *localId; newNode->fileDesc = fileDesc; newNode->shareAccess = (openInfo->mask & HGFS_OPEN_VALID_SHARE_ACCESS) ? openInfo->shareAccess : HGFS_DEFAULT_SHARE_ACCESS; newNode->flags = 0; if (append) { newNode->flags |= HGFS_FILE_NODE_APPEND_FL; } if (sharedFolderOpen) { newNode->flags |= HGFS_FILE_NODE_SHARED_FOLDER_OPEN_FL; } if (HGFS_OPEN_MODE_FLAGS(openInfo->mode) & HGFS_OPEN_SEQUENTIAL) { newNode->flags |= HGFS_FILE_NODE_SEQUENTIAL_FL; } newNode->serverLock = openInfo->acquiredLock; newNode->state = FILENODE_STATE_IN_USE_NOT_CACHED; newNode->shareInfo.readPermissions = openInfo->shareInfo.readPermissions; newNode->shareInfo.writePermissions = openInfo->shareInfo.writePermissions; newNode->shareInfo.handle = openInfo->shareInfo.handle; LOG(4, ("%s: got new node, handle %u\n", __FUNCTION__, HgfsFileNode2Handle(newNode))); return newNode; } /* *----------------------------------------------------------------------------- * * HgfsAddToCacheInternal -- * * Adds the node to cache. If the number of nodes in the cache exceed * the maximum number of entries then the first node is removed. The * first node should be the least recently used. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsAddToCacheInternal(HgfsHandle handle, // IN: HGFS file handle HgfsSessionInfo *session) // IN: Session info { HgfsFileNode *node; /* Check if the node is already cached. */ if (HgfsIsCachedInternal(handle, session)) { ASSERT((node = HgfsHandle2FileNode(handle, session)) && node->state == FILENODE_STATE_IN_USE_CACHED); return TRUE; } /* Remove the LRU node if the list is full. */ if (session->numCachedOpenNodes == gHgfsCfgSettings.maxCachedOpenNodes) { if (!HgfsRemoveLruNode(session)) { LOG(4, ("%s: Unable to remove LRU node from cache.\n", __FUNCTION__)); return FALSE; } } ASSERT(session->numCachedOpenNodes < gHgfsCfgSettings.maxCachedOpenNodes); node = HgfsHandle2FileNode(handle, session); ASSERT(node); /* Append at the end of the list. */ DblLnkLst_LinkLast(&session->nodeCachedList, &node->links); node->state = FILENODE_STATE_IN_USE_CACHED; session->numCachedOpenNodes++; /* * Keep track of how many open nodes we have with * server locks on them. The locked file should * always be present in the node cache. So we keep * the number of the files that have locks on them * limited, and smaller than the number of maximum * nodes in the cache. */ if (node->serverLock != HGFS_LOCK_NONE) { session->numCachedLockedNodes++; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsRemoveFromCacheInternal -- * * Remove the specified node from the cache and close the associated * file descriptor. If the node was not already in the cache then nothing * is done. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsRemoveFromCacheInternal(HgfsHandle handle, // IN: Hgfs handle to the node HgfsSessionInfo *session) // IN: Session info { HgfsFileNode *node; ASSERT(session); node = HgfsHandle2FileNode(handle, session); if (node == NULL) { LOG(4, ("%s: invalid handle.\n", __FUNCTION__)); return FALSE; } if (node->state == FILENODE_STATE_IN_USE_CACHED) { /* Unlink the node from the list of cached fileNodes. */ DblLnkLst_Unlink1(&node->links); node->state = FILENODE_STATE_IN_USE_NOT_CACHED; session->numCachedOpenNodes--; LOG(4, ("%s: cache entries %u remove node %s id %"FMT64"u fd %u .\n", __FUNCTION__, session->numCachedOpenNodes, node->utf8Name, node->localId.fileId, node->fileDesc)); /* * XXX: From this point and up in the call chain (i.e. this function and * all callers), Bool is returned instead of the HgfsInternalStatus. * HgfsPlatformCloseFile returns HgfsInternalStatus, which is far more granular, * but modifying this stack to use HgfsInternalStatus instead of Bool is * not worth it, as we'd have to #define per-platform error codes for * things like "ran out of memory", "bad file handle", etc. * * Instead, we'll just await the lobotomization of the node cache to * really fix this. */ if (HgfsPlatformCloseFile(node->fileDesc, node->fileCtx)) { LOG(4, ("%s: Could not close fd %u\n", __FUNCTION__, node->fileDesc)); return FALSE; } node->fileCtx = NULL; /* * If we have just removed the node then the number of used nodes better * be less than the max. If we didn't remove a node, it means the * node we tried to remove was not in the cache to begin with, and * we have a problem (see bug 36244). */ ASSERT(session->numCachedOpenNodes < gHgfsCfgSettings.maxCachedOpenNodes); } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsIsCachedInternal -- * * Check if the node exists in the cache. If the node is found in * the cache then move it to the end of the list. Most recently * used nodes move towards the end of the list. * * The session nodeArrayLock should be acquired prior to calling this * function. * * Results: * TRUE if the node is found in the cache. * FALSE if the node is not in the cache. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsIsCachedInternal(HgfsHandle handle, // IN: Structure representing file node HgfsSessionInfo *session) // IN: Session info { HgfsFileNode *node; ASSERT(session); node = HgfsHandle2FileNode(handle, session); if (node == NULL) { LOG(4, ("%s: invalid handle.\n", __FUNCTION__)); return FALSE; } if (node->state == FILENODE_STATE_IN_USE_CACHED) { /* * Move this node to the end of the list. */ DblLnkLst_Unlink1(&node->links); DblLnkLst_LinkLast(&session->nodeCachedList, &node->links); return TRUE; } return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsIsServerLockAllowed -- * * Check if there's room for another file node with the server lock. * If there's no room in the cache for the file with the server lock, * then the file will be opened without the lock even if the client * asked for the lock. * * * Results: * TRUE if the node is found in the cache. * FALSE if the node is not in the cache. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsIsServerLockAllowed(HgfsSessionInfo *session) // IN: session info { Bool allowed; MXUser_AcquireExclLock(session->nodeArrayLock); allowed = session->numCachedLockedNodes < MAX_LOCKED_FILENODES; MXUser_ReleaseExclLock(session->nodeArrayLock); return allowed; } /* *----------------------------------------------------------------------------- * * HgfsGetNewSearch -- * * Remove a search from the free list and return it. Searches on * the free list should already be initialized. * * If the free list is empty, reallocates more memory, * initializes it appropriately, adds the new entries to the * free list, and then returns one off the free list. * * Caller should hold the session's searchArrayLock. * * Results: * An unused search on success * NULL on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsSearch * HgfsGetNewSearch(HgfsSessionInfo *session) // IN: session info { HgfsSearch *search; HgfsSearch *newMem; unsigned int newNumSearches; unsigned int i; ASSERT(session); ASSERT(session->searchArray); LOG(4, ("%s: entered\n", __FUNCTION__)); if (!DblLnkLst_IsLinked(&session->searchFreeList)) { /* * This has to be unsigned and with maximum bit length. This is * required to take care of "negative" differences as well. */ uintptr_t ptrDiff; if (DOLOG(4)) { Log("Dumping searches before realloc\n"); HgfsDumpAllSearches(session); } /* Try to get twice as much memory as we had */ newNumSearches = 2 * session->numSearches; newMem = (HgfsSearch *)realloc(session->searchArray, newNumSearches * sizeof *(session->searchArray)); if (!newMem) { LOG(4, ("%s: can't realloc more searches\n", __FUNCTION__)); return NULL; } ptrDiff = (char *)newMem - (char *)session->searchArray; if (ptrDiff) { size_t const oldSize = session->numSearches * sizeof *(session->searchArray); /* * The portion of memory that contains all our searches moved. * All pointers that pointed inside the previous portion of memory * must be updated to point to the new portion of memory. */ LOG(4, ("Rebasing pointers, diff is %"FMTSZ"u, sizeof search is " "%"FMTSZ"u\n", ptrDiff, sizeof(HgfsSearch))); LOG(4, ("old: %p new: %p\n", session->searchArray, newMem)); ASSERT(newMem == (HgfsSearch*)((char*)session->searchArray + ptrDiff)); #define HgfsServerRebase(_ptr, _type) \ if ((size_t)((char *)_ptr - (char *)session->searchArray) < oldSize) { \ _ptr = (_type *)((char *)_ptr + ptrDiff); \ } /* * Rebase the links of all searches */ for (i = 0; i < session->numSearches; i++) { HgfsServerRebase(newMem[i].links.prev, DblLnkLst_Links) HgfsServerRebase(newMem[i].links.next, DblLnkLst_Links) } /* * There is no need to rebase the links of the search free list * because if we are here, it is empty */ #undef HgfsServerRebase } /* Initialize the new searches */ LOG(4, ("numSearches was %u, now is %u\n", session->numSearches, newNumSearches)); for (i = session->numSearches; i < newNumSearches; i++) { DblLnkLst_Init(&newMem[i].links); newMem[i].utf8Dir = NULL; newMem[i].utf8DirLen = 0; newMem[i].utf8ShareName = NULL; newMem[i].utf8ShareNameLen = 0; newMem[i].shareInfo.rootDir = NULL; newMem[i].shareInfo.rootDirLen = 0; newMem[i].dents = NULL; newMem[i].numDents = 0; /* Append at the end of the list */ DblLnkLst_LinkLast(&session->searchFreeList, &newMem[i].links); } session->searchArray = newMem; session->numSearches = newNumSearches; if (DOLOG(4)) { Log("Dumping searches after pointer changes\n"); HgfsDumpAllSearches(session); } } /* Remove the first item from the list */ search = DblLnkLst_Container(session->searchFreeList.next, HgfsSearch, links); DblLnkLst_Unlink1(&search->links); return search; } /* *----------------------------------------------------------------------------- * * HgfsSearch2SearchHandle -- * * Retrieve the handle that represents a search outside of the server. * * Caller should hold the session's searchArrayLock. * * Results: * The handle * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsHandle HgfsSearch2SearchHandle(HgfsSearch const *search) // IN { ASSERT(search); return search->handle; } /* *----------------------------------------------------------------------------- * * HgfsSearchIsBaseNameSpace -- * * Check if the search is the base of our name space, i.e. the dirents are * the shares themselves. * * Results: * TRUE if the search is the base of the name space, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsSearchIsBaseNameSpace(HgfsSearch const *search) // IN { ASSERT(search); return search->type == DIRECTORY_SEARCH_TYPE_BASE; } /* *----------------------------------------------------------------------------- * * HgfsGetSearchCopy -- * * Make a copy of the search. It should not be kept around for long, as the * data might become stale. This is mostly a convenience function to get * search fields more efficiently. * * Note that unlike HgfsGetNodeCopy, we always copy the name, and we never * copy the dents. * * Results: * TRUE if the hgfs handle is valid and the copy was successful. * FALSE otherwise. * * Side effects: * Allocates memory for search.utf8Dir * *----------------------------------------------------------------------------- */ Bool HgfsGetSearchCopy(HgfsHandle handle, // IN: Hgfs search handle HgfsSessionInfo *session, // IN: Session info HgfsSearch *copy) // IN/OUT: Copy of the search { HgfsSearch *original = NULL; Bool found = FALSE; ASSERT(copy); MXUser_AcquireExclLock(session->searchArrayLock); original = HgfsSearchHandle2Search(handle, session); if (original == NULL) { goto exit; } copy->utf8Dir = malloc(original->utf8DirLen + 1); if (copy->utf8Dir == NULL) { goto exit; } copy->utf8DirLen = original->utf8DirLen; memcpy(copy->utf8Dir, original->utf8Dir, copy->utf8DirLen); copy->utf8Dir[copy->utf8DirLen] = '\0'; copy->utf8ShareName = malloc(original->utf8ShareNameLen + 1); if (copy->utf8ShareName == NULL) { goto exit; } copy->utf8ShareNameLen = original->utf8ShareNameLen; memcpy(copy->utf8ShareName, original->utf8ShareName, copy->utf8ShareNameLen); copy->utf8ShareName[copy->utf8ShareNameLen] = '\0'; /* No dents for the copy, they consume too much memory and aren't needed. */ copy->dents = NULL; copy->numDents = 0; copy->handle = original->handle; copy->type = original->type; found = TRUE; exit: MXUser_ReleaseExclLock(session->searchArrayLock); return found; } /* *----------------------------------------------------------------------------- * * HgfsAddNewSearch -- * * Gets a free search off the free list, sets its base directory, dents, * and type. * * Caller should hold the session's searchArrayLock. * * Results: * A pointer to the newly added search on success * NULL on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsSearch * HgfsAddNewSearch(char const *utf8Dir, // IN: UTF8 name of dir to search in DirectorySearchType type, // IN: What kind of search is this? char const *utf8ShareName, // IN: Share name containing the directory char const *rootDir, // IN: Root directory for the share HgfsSessionInfo *session) // IN: Session info { HgfsSearch *newSearch; ASSERT(utf8Dir); /* Get an unused search */ newSearch = HgfsGetNewSearch(session); if (!newSearch) { LOG(4, ("%s: out of memory\n", __FUNCTION__)); return NULL; } newSearch->dents = NULL; newSearch->numDents = 0; newSearch->flags = 0; newSearch->type = type; newSearch->handle = HgfsServerGetNextHandleCounter(); newSearch->utf8DirLen = strlen(utf8Dir); newSearch->utf8Dir = Util_SafeStrdup(utf8Dir); newSearch->utf8ShareNameLen = strlen(utf8ShareName); newSearch->utf8ShareName = Util_SafeStrdup(utf8ShareName); newSearch->shareInfo.rootDirLen = strlen(rootDir); newSearch->shareInfo.rootDir = Util_SafeStrdup(rootDir); LOG(4, ("%s: got new search, handle %u\n", __FUNCTION__, HgfsSearch2SearchHandle(newSearch))); return newSearch; } /* *----------------------------------------------------------------------------- * * HgfsFreeSearchDirents -- * * Frees all dirents and dirents pointer array. * * Caller should hold the session's searchArrayLock. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsFreeSearchDirents(HgfsSearch *search) // IN/OUT: search { unsigned int i; if (NULL != search->dents) { for (i = 0; i < search->numDents; i++) { free(search->dents[i]); search->dents[i] = NULL; } free(search->dents); search->dents = NULL; } } /* *----------------------------------------------------------------------------- * * HgfsRemoveSearchInternal -- * * Destroy a search object and recycle it to the free list * * Caller should hold the session's searchArrayLock. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsRemoveSearchInternal(HgfsSearch *search, // IN: search HgfsSessionInfo *session) // IN: session info { ASSERT(search); ASSERT(session); LOG(4, ("%s: handle %u, dir %s\n", __FUNCTION__, HgfsSearch2SearchHandle(search), search->utf8Dir)); HgfsFreeSearchDirents(search); free(search->utf8Dir); free(search->utf8ShareName); free((char*)search->shareInfo.rootDir); search->utf8DirLen = 0; search->utf8Dir = NULL; search->utf8ShareNameLen = 0; search->utf8ShareName = NULL; search->shareInfo.rootDirLen = 0; search->shareInfo.rootDir = NULL; /* Prepend at the beginning of the list */ DblLnkLst_LinkFirst(&session->searchFreeList, &search->links); } /* *----------------------------------------------------------------------------- * * HgfsRemoveSearch -- * * Wrapper around HgfsRemoveSearchInternal that first takes the lock and * converts the handle to the search itself. * * Results: * TRUE if the search was freed successfully. * FALSE if the search could not be found. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsRemoveSearch(HgfsHandle handle, // IN: search HgfsSessionInfo *session) // IN: session info { HgfsSearch *search; Bool success = FALSE; MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsSearchHandle2Search(handle, session); if (search != NULL) { HgfsRemoveSearchInternal(search, session); success = TRUE; } MXUser_ReleaseExclLock(session->searchArrayLock); return success; } /* *---------------------------------------------------------------------------- * * HgfsSearchHasReadAllEntries -- * * Return whether the client has read all the search entries or not. * * Results: * TRUE on success, FALSE on failure. readAllEntries is filled in on * success. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool HgfsSearchHasReadAllEntries(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info Bool *readAllEntries) // OUT: If open was sequential { HgfsSearch *search; Bool success = FALSE; ASSERT(NULL != readAllEntries); MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsSearchHandle2Search(handle, session); if (NULL == search) { goto exit; } *readAllEntries = search->flags & HGFS_SEARCH_FLAG_READ_ALL_ENTRIES; success = TRUE; exit: MXUser_ReleaseExclLock(session->searchArrayLock); return success; } /* *---------------------------------------------------------------------------- * * HgfsSearchSetReadAllEntries -- * * Set the flag to indicate the client has read all the search entries. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void HgfsSearchSetReadAllEntries(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session) // IN: Session info { HgfsSearch *search; MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsSearchHandle2Search(handle, session); if (NULL == search) { goto exit; } search->flags |= HGFS_SEARCH_FLAG_READ_ALL_ENTRIES; exit: MXUser_ReleaseExclLock(session->searchArrayLock); } /* *----------------------------------------------------------------------------- * * HgfsServerGetDirEntry -- * * Returns a copy of the directory entry at the given index. If remove is set * to TRUE, the existing result is also pruned and the remaining results * are shifted up in the result array. * * Results: * NULL if there was an error or no search results were left. * Non-NULL if result was found. Caller must free it. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsServerGetDirEntry(HgfsHandle handle, // IN: Handle to search HgfsSessionInfo *session, // IN: Session info uint32 index, // IN: index to retrieve at Bool remove, // IN: If true, removes the result struct DirectoryEntry **dirEntry) // OUT: directory entry { HgfsSearch *search; struct DirectoryEntry *dent = NULL; HgfsInternalStatus status = HGFS_ERROR_SUCCESS; MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsSearchHandle2Search(handle, session); if (search == NULL) { status = HGFS_ERROR_INVALID_HANDLE; goto out; } /* No more entries or none. */ if (search->dents == NULL) { goto out; } if (HGFS_SEARCH_LAST_ENTRY_INDEX == index) { /* Set the index to the final entry. */ index = search->numDents - 1; } status = HgfsPlatformGetDirEntry(search, session, index, remove, &dent); out: MXUser_ReleaseExclLock(session->searchArrayLock); *dirEntry = dent; return status; } /* *----------------------------------------------------------------------------- * * HgfsSearchHandle2Search -- * * Retrieve the search a handle refers to. * * Results: * The search if the handle is valid (i.e. it refers to an existing search * that is currently in use) * NULL if the handle is invalid * * Caller should hold the session's searchArrayLock. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsSearch * HgfsSearchHandle2Search(HgfsHandle handle, // IN: handle HgfsSessionInfo *session) // IN: session info { unsigned int i; HgfsSearch *search = NULL; ASSERT(session); ASSERT(session->searchArray); /* XXX: This O(n) lookup can and should be optimized. */ for (i = 0; i < session->numSearches; i++) { if (!DblLnkLst_IsLinked(&session->searchArray[i].links) && session->searchArray[i].handle == handle) { search = &session->searchArray[i]; break; } } return search; } /* *----------------------------------------------------------------------------- * * HgfsUpdateNodeNames -- * * Walk the node array and update all nodes that have the old file name to * store the new file name. * * Results: * None * * Side effects: * If there isnt enough memory to accomodate the new names, those file nodes * that couldnt be updated are deleted. * *----------------------------------------------------------------------------- */ void HgfsUpdateNodeNames(const char *oldLocalName, // IN: Name of file to look for const char *newLocalName, // IN: Name to replace with HgfsSessionInfo *session) // IN: Session info { HgfsFileNode *fileNode; unsigned int i; char *newBuffer; size_t newBufferLen; ASSERT(oldLocalName); ASSERT(newLocalName); ASSERT(session); ASSERT(session->nodeArray); newBufferLen = strlen(newLocalName); MXUser_AcquireExclLock(session->nodeArrayLock); for (i = 0; i < session->numNodes; i++) { fileNode = &session->nodeArray[i]; /* If the node is on the free list, skip it. */ if (fileNode->state == FILENODE_STATE_UNUSED) { continue; } if (strcmp(fileNode->utf8Name, oldLocalName) == 0) { newBuffer = malloc(newBufferLen + 1); if (!newBuffer) { LOG(4, ("%s: Failed to update a node name.\n", __FUNCTION__)); continue; } memcpy(newBuffer, newLocalName, newBufferLen); newBuffer[newBufferLen] = '\0'; /* Update this name to the new name. */ free(fileNode->utf8Name); fileNode->utf8Name = newBuffer; fileNode->utf8NameLen = newBufferLen; } } MXUser_ReleaseExclLock(session->nodeArrayLock); } /* *----------------------------------------------------------------------------- * * HgfsServerClose -- * * Handle a Close request. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerClose(HgfsInputParam *input) // IN: Input params { HgfsHandle file; HgfsInternalStatus status = HGFS_ERROR_SUCCESS; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackCloseRequest(input->payload, input->payloadSize, input->op, &file)) { LOG(4, ("%s: close fh %u\n", __FUNCTION__, file)); if (!HgfsRemoveFromCache(file, input->session)) { LOG(4, ("%s: Could not remove the node from cache.\n", __FUNCTION__)); status = HGFS_ERROR_INVALID_HANDLE; } else { HgfsFreeFileNode(file, input->session); if (!HgfsPackCloseReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_INTERNAL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerSearchClose -- * * Handle a "Search Close" request. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSearchClose(HgfsInputParam *input) // IN: Input params { HgfsHandle search; HgfsInternalStatus status; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackSearchCloseRequest(input->payload, input->payloadSize, input->op, &search)) { LOG(4, ("%s: close search #%u\n", __FUNCTION__, search)); if (HgfsRemoveSearch(search, input->session)) { if (HgfsPackSearchCloseReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_SUCCESS; } else { status = HGFS_ERROR_INTERNAL; } } else { /* Invalid handle */ LOG(4, ("%s: invalid handle %u\n", __FUNCTION__, search)); status = HGFS_ERROR_INVALID_HANDLE; } } else { status = HGFS_ERROR_INTERNAL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } #define HGFS_SIZEOF_OP(type) (sizeof (type) + sizeof (HgfsRequest)) /* Opcode handlers, indexed by opcode */ static struct { void (*handler)(HgfsInputParam *input); /* Minimal size of the request packet */ unsigned int minReqSize; /* How do you process the request {sync, async} ? */ RequestHint reqType; } const handlers[] = { { HgfsServerOpen, sizeof (HgfsRequestOpen), REQ_SYNC }, { HgfsServerRead, sizeof (HgfsRequestRead), REQ_SYNC }, { HgfsServerWrite, sizeof (HgfsRequestWrite), REQ_SYNC }, { HgfsServerClose, sizeof (HgfsRequestClose), REQ_SYNC }, { HgfsServerSearchOpen, sizeof (HgfsRequestSearchOpen), REQ_SYNC }, { HgfsServerSearchRead, sizeof (HgfsRequestSearchRead), REQ_SYNC }, { HgfsServerSearchClose, sizeof (HgfsRequestSearchClose), REQ_SYNC }, { HgfsServerGetattr, sizeof (HgfsRequestGetattr), REQ_SYNC }, { HgfsServerSetattr, sizeof (HgfsRequestSetattr), REQ_SYNC }, { HgfsServerCreateDir, sizeof (HgfsRequestCreateDir), REQ_SYNC }, { HgfsServerDeleteFile, sizeof (HgfsRequestDelete), REQ_SYNC }, { HgfsServerDeleteDir, sizeof (HgfsRequestDelete), REQ_SYNC }, { HgfsServerRename, sizeof (HgfsRequestRename), REQ_SYNC }, { HgfsServerQueryVolume, sizeof (HgfsRequestQueryVolume), REQ_SYNC }, { HgfsServerOpen, sizeof (HgfsRequestOpenV2), REQ_SYNC }, { HgfsServerGetattr, sizeof (HgfsRequestGetattrV2), REQ_SYNC }, { HgfsServerSetattr, sizeof (HgfsRequestSetattrV2), REQ_SYNC }, { HgfsServerSearchRead, sizeof (HgfsRequestSearchReadV2), REQ_SYNC }, { HgfsServerSymlinkCreate, sizeof (HgfsRequestSymlinkCreate), REQ_SYNC }, { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange), REQ_SYNC }, { HgfsServerCreateDir, sizeof (HgfsRequestCreateDirV2), REQ_SYNC }, { HgfsServerDeleteFile, sizeof (HgfsRequestDeleteV2), REQ_SYNC }, { HgfsServerDeleteDir, sizeof (HgfsRequestDeleteV2), REQ_SYNC }, { HgfsServerRename, sizeof (HgfsRequestRenameV2), REQ_SYNC }, { HgfsServerOpen, HGFS_SIZEOF_OP(HgfsRequestOpenV3), REQ_SYNC }, { HgfsServerRead, HGFS_SIZEOF_OP(HgfsRequestReadV3), REQ_SYNC }, { HgfsServerWrite, HGFS_SIZEOF_OP(HgfsRequestWriteV3), REQ_SYNC }, { HgfsServerClose, HGFS_SIZEOF_OP(HgfsRequestCloseV3), REQ_SYNC }, { HgfsServerSearchOpen, HGFS_SIZEOF_OP(HgfsRequestSearchOpenV3), REQ_SYNC }, { HgfsServerSearchRead, HGFS_SIZEOF_OP(HgfsRequestSearchReadV3), REQ_SYNC }, { HgfsServerSearchClose, HGFS_SIZEOF_OP(HgfsRequestSearchCloseV3), REQ_SYNC }, { HgfsServerGetattr, HGFS_SIZEOF_OP(HgfsRequestGetattrV3), REQ_SYNC }, { HgfsServerSetattr, HGFS_SIZEOF_OP(HgfsRequestSetattrV3), REQ_SYNC }, { HgfsServerCreateDir, HGFS_SIZEOF_OP(HgfsRequestCreateDirV3), REQ_SYNC }, { HgfsServerDeleteFile, HGFS_SIZEOF_OP(HgfsRequestDeleteV3), REQ_SYNC }, { HgfsServerDeleteDir, HGFS_SIZEOF_OP(HgfsRequestDeleteV3), REQ_SYNC }, { HgfsServerRename, HGFS_SIZEOF_OP(HgfsRequestRenameV3), REQ_SYNC }, { HgfsServerQueryVolume, HGFS_SIZEOF_OP(HgfsRequestQueryVolumeV3), REQ_SYNC }, { HgfsServerSymlinkCreate, HGFS_SIZEOF_OP(HgfsRequestSymlinkCreateV3), REQ_SYNC }, { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange), REQ_SYNC }, { HgfsServerWriteWin32Stream, HGFS_SIZEOF_OP(HgfsRequestWriteWin32StreamV3), REQ_SYNC }, /* * Starting from HGFS_OP_CREATE_SESSION_V4 (all V4 commands and above) the * second field is the minimum size for actual HGFS operational request * and not the minimum size of operational request with a header. */ { HgfsServerCreateSession, sizeof (HgfsRequestCreateSessionV4), REQ_SYNC}, { HgfsServerDestroySession, sizeof (HgfsRequestDestroySessionV4), REQ_SYNC}, { HgfsServerRead, sizeof (HgfsRequestReadV3), REQ_SYNC}, { HgfsServerWrite, sizeof (HgfsRequestWriteV3), REQ_SYNC}, { HgfsServerSetDirNotifyWatch, sizeof (HgfsRequestSetWatchV4), REQ_SYNC}, { HgfsServerRemoveDirNotifyWatch, sizeof (HgfsRequestRemoveWatchV4), REQ_SYNC}, { NULL, 0, REQ_SYNC}, // No Op notify { HgfsServerSearchRead, sizeof (HgfsRequestSearchReadV4), REQ_SYNC}, }; /* *----------------------------------------------------------------------------- * * HgfsServerInputAllocInit -- * * Allocates and initializes the input params object with the operation parameters. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerInputAllocInit(HgfsPacket *packet, // IN: packet HgfsTransportSessionInfo *transportSession,// IN: session HgfsSessionInfo *session, // IN: session Id const void *request, // IN: HGFS packet size_t requestSize, // IN: request packet size Bool sessionEnabled, // IN: session enabled request uint32 requestId, // IN: unique request id HgfsOp requestOp, // IN: op size_t requestOpArgsSize, // IN: op args size const void *requestOpArgs, // IN: op args HgfsInputParam **params) // OUT: parameters { HgfsInputParam *localParams; localParams = Util_SafeCalloc(1, sizeof *localParams); localParams->packet = packet; localParams->request = request; localParams->requestSize = requestSize; localParams->transportSession = transportSession; localParams->session = session; localParams->id = requestId; localParams->sessionEnabled = sessionEnabled; localParams->op = requestOp; localParams->payload = requestOpArgs; localParams->payloadSize = requestOpArgsSize; if (NULL != localParams->payload) { localParams->payloadOffset = (char *)localParams->payload - (char *)localParams->request; } *params = localParams; } /* *----------------------------------------------------------------------------- * * HgfsServerInputExit -- * * Tearsdown and frees the input params object with the operation parameters. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerInputExit(HgfsInputParam *params) // IN: packet { if (NULL != params->session) { HgfsServerSessionPut(params->session); } HgfsServerTransportSessionPut(params->transportSession); free(params); } /* *----------------------------------------------------------------------------- * * HgfsServerGetRequest -- * * Takes the Hgfs packet and extracts the operation parameters. * This validates the incoming packet as part of the processing. * * Results: * HGFS_ERROR_SUCCESS if all the request parameters are successfully extracted. * HGFS_ERROR_INTERNAL if an error occurs without sufficient request data to be * able to send a reply to the client. * Any other appropriate error if the incoming packet has errors and there is * sufficient information to send a response. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerGetRequest(HgfsPacket *packet, // IN: packet HgfsTransportSessionInfo *transportSession,// IN: session HgfsInputParam **input) // OUT: parameters { HgfsSessionInfo *session = NULL; uint64 sessionId = HGFS_INVALID_SESSION_ID; Bool sessionEnabled = FALSE; uint32 requestId; HgfsOp opcode; const void *request; size_t requestSize; const void *requestOpArgs; size_t requestOpArgsSize; HgfsInternalStatus parseStatus = HGFS_ERROR_SUCCESS; request = HSPU_GetMetaPacket(packet, &requestSize, transportSession->channelCbTable); if (NULL == request) { /* * How can I return error back to the client, clearly the client is either broken or * malicious? We cannot continue from here. */ parseStatus = HGFS_ERROR_INTERNAL; goto exit; } parseStatus = HgfsUnpackPacketParams(request, requestSize, &sessionEnabled, &sessionId, &requestId, &opcode, &requestOpArgsSize, &requestOpArgs); if (HGFS_ERROR_INTERNAL == parseStatus) { /* The packet was malformed and we cannot reply. */ goto exit; } /* * Every request must be processed within an HGFS session, except create session. * If we don't already have an HGFS session for processing this request, * then use or create the default session. */ if (sessionEnabled) { if (opcode != HGFS_OP_CREATE_SESSION_V4) { session = HgfsServerTransportGetSessionInfo(transportSession, sessionId); if (NULL == session || session->state != HGFS_SESSION_STATE_OPEN) { LOG(4, ("%s: HGFS packet with invalid session id!\n", __FUNCTION__)); parseStatus = HGFS_ERROR_STALE_SESSION; } } } else { parseStatus = HgfsServerTransportGetDefaultSession(transportSession, &session); } if (NULL != session) { session->isInactive = FALSE; } HgfsServerInputAllocInit(packet, transportSession, session, request, requestSize, sessionEnabled, requestId, opcode, requestOpArgsSize, requestOpArgs, input); exit: return parseStatus; } /* *----------------------------------------------------------------------------- * * HgfsServerGetRequestHeaderSize -- * * Takes the Hgfs request input and finds the size of the header component. * * Results: * Size of the HGFS protocol header used by this request and reply. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerGetRequestHeaderSize(HgfsInputParam *input) // IN: parameters { size_t headerSize; /* * If the HGFS request is session enabled we must have the new header. * Otherwise, starting from HGFS V3 the header is not included in the * request itself, so we must return the size of the separate HgfsReply * structure. Prior to V3 (so V1 and V2) there was no separate header * from the request result structure so a zero size is returned for these * operations. */ if (input->sessionEnabled) { headerSize = sizeof (HgfsHeader); } else if (input->op >= HGFS_OP_OPEN_V3) { headerSize = sizeof (HgfsReply); } else { headerSize = 0; } return headerSize; } /* *----------------------------------------------------------------------------- * * HgfsServerCompleteRequest -- * * Performs all necessary action which needed for completing HGFS request: * 1. Sends reply to the guest. * 2. Release allocated objects, mapped guest memory. * 3. Dereference objects that were referenced. * * Results: * None. * * Side effects: * Reference to Session is dropped. * *----------------------------------------------------------------------------- */ static void HgfsServerCompleteRequest(HgfsInternalStatus status, // IN: Status of the request size_t replyPayloadSize, // IN: sizeof the reply payload HgfsInputParam *input) // INOUT: request context { void *reply; size_t replySize; size_t replyTotalSize; size_t replyHeaderSize; uint64 replySessionId; if (HGFS_ERROR_SUCCESS == status) { HGFS_ASSERT_INPUT(input); } else { ASSERT(input); } replySessionId = (NULL != input->session) ? input->session->sessionId : HGFS_INVALID_SESSION_ID; replyHeaderSize = HgfsServerGetRequestHeaderSize(input); if (replyHeaderSize != 0) { replySize = replyHeaderSize + replyPayloadSize; } else { /* * For pre-V3 header is included in the payload size. * If we want to send just an error result then HgfsReply * only size is required. * * XXX - all callers should be verified that the reply payload * size for V1 and V2 should be correct (mininum HgfsReply size). */ replySize = MAX(replyPayloadSize, sizeof (HgfsReply)); } reply = HSPU_GetReplyPacket(input->packet, input->transportSession->channelCbTable, replySize, &replyTotalSize); ASSERT(reply && (replySize <= replyTotalSize)); if (!HgfsPackReplyHeader(status, replyPayloadSize, input->sessionEnabled, replySessionId, input->id, input->op, HGFS_PACKET_FLAG_REPLY, replyTotalSize, reply)) { Log("%s: Error packing header!\n", __FUNCTION__); goto exit; } if (!HgfsPacketSend(input->packet, input->transportSession, 0)) { /* Send failed. Drop the reply. */ Log("%s: Error sending reply\n", __FUNCTION__); } exit: HgfsServerInputExit(input); } /* *----------------------------------------------------------------------------- * * HgfsServerProcessRequest -- * * Dispatch an incoming packet (in packetIn) to a handler function. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerProcessRequest(void *context) { HgfsInputParam *input = (HgfsInputParam *)context; if (!input->request) { input->request = HSPU_GetMetaPacket(input->packet, &input->requestSize, input->transportSession->channelCbTable); } input->payload = (char *)input->request + input->payloadOffset; (*handlers[input->op].handler)(input); } /* *----------------------------------------------------------------------------- * * HgfsServerSessionReceive -- * * Dispatch an incoming packet (in packetIn) to a handler function. * * This function cannot fail; if something goes wrong, it returns * a packet containing only a reply header with error code. * * The handler function can send the reply packet either using * HgfsPacketSend helper functions. This function would return error * as a reply if the op handler do not return HGFS_ERROR_SUCCESS. * * NOTE: If any op handler needs to keep packetIn around for sending replies * at a later point (possibly in a different thread context), it should * make a copy of it. The validity of packetIn for the HGFS server is only * within the scope of this function. * * Definitions of Meta Packet, Data packet can be looked up in * hgfsChannelVmci.c * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSessionReceive(HgfsPacket *packet, // IN: Hgfs Packet void *clientData) // IN: session info { HgfsTransportSessionInfo *transportSession = clientData; HgfsInternalStatus status; HgfsInputParam *input = NULL; ASSERT(transportSession); if (transportSession->state == HGFS_SESSION_STATE_CLOSED) { LOG(4, ("%s: %d: Received packet after disconnected.\n", __FUNCTION__, __LINE__)); return; } HgfsServerTransportSessionGet(transportSession); status = HgfsServerGetRequest(packet, transportSession, &input); if (HGFS_ERROR_INTERNAL == status) { LOG(4, ("%s: %d: Error: packet invalid and cannot reply %d.\n ", __FUNCTION__, __LINE__, status)); HgfsServerTransportSessionPut(transportSession); return; } HGFS_ASSERT_MINIMUM_OP(input->op); if (HGFS_ERROR_SUCCESS == status) { HGFS_ASSERT_INPUT(input); if ((input->op < ARRAYSIZE(handlers)) && (handlers[input->op].handler != NULL) && (input->requestSize >= handlers[input->op].minReqSize)) { /* Initial validation passed, process the client request now. */ if ((handlers[input->op].reqType == REQ_ASYNC) && (transportSession->channelCapabilities.flags & HGFS_CHANNEL_ASYNC)) { packet->state |= HGFS_STATE_ASYNC_REQUEST; } if (0 != (packet->state & HGFS_STATE_ASYNC_REQUEST)) { LOG(4, ("%s: %d: @@Async\n", __FUNCTION__, __LINE__)); #ifndef VMX86_TOOLS /* * Asynchronous processing is supported by the transport. * We can release mappings here and reacquire when needed. */ HSPU_PutMetaPacket(packet, transportSession->channelCbTable); input->request = NULL; Atomic_Inc(&gHgfsAsyncCounter); /* Remove pending requests during poweroff. */ Poll_Callback(POLL_CS_MAIN, POLL_FLAG_REMOVE_AT_POWEROFF, HgfsServerProcessRequest, input, POLL_REALTIME, 1000, NULL); #else /* Tools code should never process request async. */ ASSERT(0); #endif } else { LOG(4, ("%s: %d: ##Sync\n", __FUNCTION__, __LINE__)); HgfsServerProcessRequest(input); } } else { /* * The input packet is smaller than the minimal size needed for the * operation. */ status = HGFS_ERROR_PROTOCOL; LOG(4, ("%s: %d: Possible BUG! Malformed packet.\n", __FUNCTION__, __LINE__)); } } HGFS_ASSERT_CLIENT(input->op); /* Send error if we fail to process the op. */ if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("Error %d occured parsing the packet\n", (uint32)status)); HgfsServerCompleteRequest(status, 0, input); } } /* *----------------------------------------------------------------------------- * * HgfsServerTransportGetSessionInfo -- * * Scans the list of sessions and return the session with the specified * session id. * * Results: * A valid pointer to HgfsSessionInfo if there is a session with the * specified session id. NULL, otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsSessionInfo * HgfsServerTransportGetSessionInfo(HgfsTransportSessionInfo *transportSession, // IN: transport session info uint64 sessionId) // IN: session id { DblLnkLst_Links *curr; HgfsSessionInfo *session = NULL; ASSERT(transportSession); if (HGFS_INVALID_SESSION_ID == sessionId) { return NULL; } MXUser_AcquireExclLock(transportSession->sessionArrayLock); DblLnkLst_ForEach(curr, &transportSession->sessionArray) { session = DblLnkLst_Container(curr, HgfsSessionInfo, links); if (session->sessionId == sessionId) { HgfsServerSessionGet(session); break; } session = NULL; } MXUser_ReleaseExclLock(transportSession->sessionArrayLock); return session; } /* *----------------------------------------------------------------------------- * * HgfsServerTransportGetDefaultSession -- * * Returns default session if there is one, otherwise creates it. * XXX - this function should be moved to the HgfsServer file. * * Results: * HGFS_ERROR_SUCCESS and the session if found or created successfully * or an appropriate error if no memory or cannot add to the list of sessions. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerTransportGetDefaultSession(HgfsTransportSessionInfo *transportSession, // IN: transport HgfsSessionInfo **session) // OUT: session { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; HgfsSessionInfo *defaultSession; defaultSession = HgfsServerTransportGetSessionInfo(transportSession, transportSession->defaultSessionId); if (NULL != defaultSession) { /* The default session already exists, we are done. */ goto exit; } /* * Create a new session if the default session doesn't exist. */ if (!HgfsServerAllocateSession(transportSession, &defaultSession)) { status = HGFS_ERROR_NOT_ENOUGH_MEMORY; goto exit; } status = HgfsServerTransportAddSessionToList(transportSession, defaultSession); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: Could not add session to the list.\n", __FUNCTION__)); HgfsServerSessionPut(defaultSession); defaultSession = NULL; goto exit; } transportSession->defaultSessionId = defaultSession->sessionId; HgfsServerSessionGet(defaultSession); exit: *session = defaultSession; return status; } /* *----------------------------------------------------------------------------- * * HgfsServerTransportRemoveSessionFromList -- * * Unlinks the specified session info from the list. * * Note: The caller must acquire the sessionArrayLock in transportSession * before calling this function. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsServerTransportRemoveSessionFromList(HgfsTransportSessionInfo *transportSession, // IN: transport session info HgfsSessionInfo *session) // IN: session info { ASSERT(transportSession); ASSERT(session); DblLnkLst_Unlink1(&session->links); transportSession->numSessions--; HgfsServerSessionPut(session); } /* *----------------------------------------------------------------------------- * * HgfsServerTransportAddSessionToList -- * * Links the specified session info to the list. * * Results: * HGFS_ERROR_SUCCESS if the session is successfully added to the list, * HGFS_ERROR_TOO_MANY_SESSIONS if maximum number of sessions were already * added to the list. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerTransportAddSessionToList(HgfsTransportSessionInfo *transportSession, // IN: transport session info HgfsSessionInfo *session) // IN: session info { HgfsInternalStatus status = HGFS_ERROR_TOO_MANY_SESSIONS; ASSERT(transportSession); ASSERT(session); MXUser_AcquireExclLock(transportSession->sessionArrayLock); if (transportSession->numSessions == MAX_SESSION_COUNT) { goto abort; } DblLnkLst_LinkLast(&transportSession->sessionArray, &session->links); transportSession->numSessions++; HgfsServerSessionGet(session); status = HGFS_ERROR_SUCCESS; abort: MXUser_ReleaseExclLock(transportSession->sessionArrayLock); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerCleanupDeletedFolders -- * * This function iterates through all shared folders and removes all * deleted shared folders, removes them from notification package and * from the folders list. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerCleanupDeletedFolders(void) { DblLnkLst_Links *link, *nextElem; MXUser_AcquireExclLock(gHgfsSharedFoldersLock); DblLnkLst_ForEachSafe(link, nextElem, &gHgfsSharedFoldersList) { HgfsSharedFolderProperties *folder = DblLnkLst_Container(link, HgfsSharedFolderProperties, links); if (folder->markedForDeletion) { LOG(8, ("%s: removing shared folder handle %#x\n", __FUNCTION__, folder->notificationHandle)); if (!HgfsNotify_RemoveSharedFolder(folder->notificationHandle)) { LOG(4, ("Problem removing %d shared folder handle\n", folder->notificationHandle)); } DblLnkLst_Unlink1(link); free(folder); } } MXUser_ReleaseExclLock(gHgfsSharedFoldersLock); } /* *----------------------------------------------------------------------------- * * HgfsServerRegisterShare -- * * This is a callback function which is invoked by hgfsServerManagement * for every shared folder when something changed in shared folders * configuration. The function iterates through the list of existing * shared folders trying to locate an entry with the shareName. If the * entry is found the function returns corresponding handle. Otherwise * it creates a new entry and assigns a new handle to it. * * Currently there is no notification that a shared folder has been * deleted. The only way to find out that a shred folder is deleted * is to notice that it is not enumerated any more. Thus an explicit * "end of list" notification is needed. "sharedFolder == NULL" notifies * that enumeration is completed which allows to delete all shared * folders that were not mentioned during current enumeration. * * Results: * HgfsSharedFolderHandle for the entry. * * Side effects: * May add an entry to known shared folders list. * *----------------------------------------------------------------------------- */ static HgfsSharedFolderHandle HgfsServerRegisterShare(const char *shareName, // IN: shared folder name const char *sharePath, // IN: shared folder path Bool addFolder) // IN: add or remove folder { DblLnkLst_Links *link, *nextElem; HgfsSharedFolderHandle result = HGFS_INVALID_FOLDER_HANDLE; LOG(8, ("%s: %s, %s, %s\n", __FUNCTION__, (shareName ? shareName : "NULL"), (sharePath ? sharePath : "NULL"), (addFolder ? "add" : "remove"))); if (!gHgfsDirNotifyActive) { LOG(8, ("%s: notification disabled\n", __FUNCTION__)); goto exit; } LOG(8, ("%s: %s, %s, %s - active notification\n", __FUNCTION__, (shareName ? shareName : "NULL"), (sharePath ? sharePath : "NULL"), (addFolder ? "add" : "remove"))); if (NULL == shareName) { /* * The function is invoked with shareName NULL when all shares has been * enumerated. * Need to delete all shared folders that were marked for deletion. */ HgfsServerCleanupDeletedFolders(); goto exit; } MXUser_AcquireExclLock(gHgfsSharedFoldersLock); DblLnkLst_ForEachSafe(link, nextElem, &gHgfsSharedFoldersList) { HgfsSharedFolderProperties *folder = DblLnkLst_Container(link, HgfsSharedFolderProperties, links); if (strcmp(folder->name, shareName) == 0) { result = folder->notificationHandle; folder->markedForDeletion = !addFolder; break; } } if (addFolder && HGFS_INVALID_FOLDER_HANDLE == result) { result = HgfsNotify_AddSharedFolder(sharePath, shareName); if (HGFS_INVALID_FOLDER_HANDLE != result) { HgfsSharedFolderProperties *folder = (HgfsSharedFolderProperties *)Util_SafeMalloc(sizeof *folder); folder->notificationHandle = result; folder->name = Util_SafeStrdup(shareName); folder->markedForDeletion = FALSE; DblLnkLst_Init(&folder->links); DblLnkLst_LinkLast(&gHgfsSharedFoldersList, &folder->links); } } MXUser_ReleaseExclLock(gHgfsSharedFoldersLock); exit: LOG(8, ("%s: %s, %s, %s exit %#x\n",__FUNCTION__, (shareName ? shareName : "NULL"), (sharePath ? sharePath : "NULL"), (addFolder ? "add" : "remove"), result)); return result; } /* *----------------------------------------------------------------------------- * * HgfsServerGetShareHandle -- * * The function returns shared folder notification handle for the specified * shared folder. * * Results: * HgfsSharedFolderHandle that corresponds to the shared folder. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static HgfsSharedFolderHandle HgfsServerGetShareHandle(const char *shareName) // IN: name of the shared folder { DblLnkLst_Links *link; HgfsSharedFolderHandle result = HGFS_INVALID_FOLDER_HANDLE; if (!gHgfsDirNotifyActive) { return HGFS_INVALID_FOLDER_HANDLE; } MXUser_AcquireExclLock(gHgfsSharedFoldersLock); DblLnkLst_ForEach(link, &gHgfsSharedFoldersList) { HgfsSharedFolderProperties *folder = DblLnkLst_Container(link, HgfsSharedFolderProperties, links); if (strcmp(folder->name, shareName) == 0) { result = folder->notificationHandle; break; } } MXUser_ReleaseExclLock(gHgfsSharedFoldersLock); return result; } /* *----------------------------------------------------------------------------- * * HgfsServerGetShareName -- * * Get the share name for a shared folder handle by looking at the * requested handle, finding the matching share (if any), and returning * the share's name. * * Results: * An Bool value indicating if the result is returned. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsServerGetShareName(HgfsSharedFolderHandle sharedFolder, // IN: Notify handle size_t *shareNameLen, // OUT: Name length char **shareName) // OUT: Share name { Bool result = FALSE; DblLnkLst_Links *link; if (!gHgfsDirNotifyActive) { return FALSE; } MXUser_AcquireExclLock(gHgfsSharedFoldersLock); DblLnkLst_ForEach(link, &gHgfsSharedFoldersList) { HgfsSharedFolderProperties *folder = DblLnkLst_Container(link, HgfsSharedFolderProperties, links); if (folder->notificationHandle == sharedFolder) { *shareName = Util_SafeStrdup(folder->name); result = TRUE; *shareNameLen = strlen(*shareName); break; } } MXUser_ReleaseExclLock(gHgfsSharedFoldersLock); return result; } /* *----------------------------------------------------------------------------- * * HgfsServer_InitState -- * * Initialize the global server state * * Results: * TRUE if succeeded, FALSE if failed. * * Side effects: * Memory allocation. * *----------------------------------------------------------------------------- */ Bool HgfsServer_InitState(HgfsServerCallbacks **callbackTable, // IN/OUT: our callbacks HgfsServerConfig *serverCfgData, // IN: configurable settings HgfsServerMgrCallbacks *serverMgrData) // IN: mgr callback { Bool result = TRUE; ASSERT(callbackTable); /* Save any server manager data for logging state updates.*/ gHgfsMgrData = serverMgrData; if (NULL != serverCfgData) { gHgfsCfgSettings = *serverCfgData; } /* * Initialize the globals for handling the active shared folders. */ gHgfsAsyncLock = NULL; gHgfsAsyncVar = NULL; Atomic_Write(&gHgfsAsyncCounter, 0); DblLnkLst_Init(&gHgfsSharedFoldersList); gHgfsSharedFoldersLock = MXUser_CreateExclLock("sharedFoldersLock", RANK_hgfsSharedFolders); if (NULL != gHgfsSharedFoldersLock) { gHgfsAsyncLock = MXUser_CreateExclLock("asyncLock", RANK_hgfsSharedFolders); if (NULL != gHgfsAsyncLock) { gHgfsAsyncVar = MXUser_CreateCondVarExclLock(gHgfsAsyncLock); if (NULL != gHgfsAsyncVar) { if (!HgfsPlatformInit()) { LOG(4, ("Could not initialize server platform specific \n")); result = FALSE; } } else { LOG(4, ("%s: Could not create async counter cond var.\n", __FUNCTION__)); result = FALSE; } } else { LOG(4, ("%s: Could not create async counter mutex.\n", __FUNCTION__)); result = FALSE; } } else { LOG(4, ("%s: Could not create shared folders mutex.\n", __FUNCTION__)); result = FALSE; } if (result) { *callbackTable = &gHgfsServerCBTable; if (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_NOTIFY_ENABLED)) { gHgfsDirNotifyActive = HgfsNotify_Init() == HGFS_STATUS_SUCCESS; Log("%s: initialized notification %s.\n", __FUNCTION__, (gHgfsDirNotifyActive ? "active" : "inactive")); } if (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_OPLOCK_ENABLED)) { if (!HgfsServerOplockInit()) { gHgfsCfgSettings.flags &= ~HGFS_CONFIG_OPLOCK_ENABLED; } } gHgfsInitialized = TRUE; } else { HgfsServer_ExitState(); // Cleanup partially initialized state } return result; } /* *----------------------------------------------------------------------------- * * HgfsServer_ExitState -- * * Cleanup the global server state. * * This function should be called when all other HGFS threads stopped * running. Otherwise we'll be in trouble because this is where we delete * the node array lock. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsServer_ExitState(void) { gHgfsInitialized = FALSE; if (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_OPLOCK_ENABLED)) { HgfsServerOplockDestroy(); } if (gHgfsDirNotifyActive) { HgfsNotify_Exit(); gHgfsDirNotifyActive = FALSE; Log("%s: exit notification - inactive.\n", __FUNCTION__); } if (NULL != gHgfsSharedFoldersLock) { MXUser_DestroyExclLock(gHgfsSharedFoldersLock); gHgfsSharedFoldersLock = NULL; } if (NULL != gHgfsAsyncLock) { MXUser_DestroyExclLock(gHgfsAsyncLock); gHgfsAsyncLock = NULL; } if (NULL != gHgfsAsyncVar) { MXUser_DestroyCondVar(gHgfsAsyncVar); gHgfsAsyncVar = NULL; } HgfsPlatformDestroy(); /* * Reset the server manager callbacks. */ gHgfsMgrData = NULL; } /* *----------------------------------------------------------------------------- * * HgfsGenerateSessionId -- * * Generates unique session id. * * Results: * Unique 64-bit value. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static uint64 HgfsGenerateSessionId(void) { return RDTSC(); } /* *----------------------------------------------------------------------------- * * HgfsServerSetSessionCapability -- * * Sets session capability for a specific operation code. * * Results: * TRUE is the capability for the operation has been changed. * FALSE if the operation is not represented in the capabilities array. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerSetSessionCapability(HgfsOp op, // IN: operation code uint32 flags, // IN: flags that describe level of support HgfsSessionInfo *session) // INOUT: session to update { int i; Bool result = FALSE; for ( i = 0; i < ARRAYSIZE(session->hgfsSessionCapabilities); i++) { if (session->hgfsSessionCapabilities[i].op == op) { session->hgfsSessionCapabilities[i].flags = flags; result = TRUE; } } LOG(4, ("%s: Setting capabilitiy flags %x for op code %d %s\n", __FUNCTION__, flags, op, result ? "succeeded" : "failed")); return result; } /* *----------------------------------------------------------------------------- * * HgfsServerResEnumInit -- * * Initialize an enumeration of all exisitng resources. * * Results: * The enumeration state object. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void * HgfsServerResEnumInit(void) { void *enumState = NULL; if (gHgfsMgrData != NULL && gHgfsMgrData->enumResources.init != NULL) { enumState = gHgfsMgrData->enumResources.init(); } return enumState; } /* *----------------------------------------------------------------------------- * * HgfsServerResEnumGet -- * * Enumerates the next resource associated with the enumeration state. * * Results: * TRUE on success and . * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsServerResEnumGet(void *enumState, // IN/OUT: enumeration state char const **enumResName, // OUT: enumerated resource name size_t *enumResNameLen, // OUT: enumerated resource name len Bool *enumResDone) // OUT: enumerated resources done { Bool success = FALSE; if (gHgfsMgrData != NULL && gHgfsMgrData->enumResources.get != NULL) { success = gHgfsMgrData->enumResources.get(enumState, enumResName, enumResNameLen, enumResDone); } return success; } /* *----------------------------------------------------------------------------- * * HgfsServerResEnumExit -- * * Exit the enumeration of all existing resources. * * Results: * TRUE on success, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsServerResEnumExit(void *enumState) // IN/OUT: enumeration state { Bool success = FALSE; if (gHgfsMgrData != NULL && gHgfsMgrData->enumResources.exit != NULL) { success = gHgfsMgrData->enumResources.exit(enumState); } return success; } /* *----------------------------------------------------------------------------- * * HgfsServerEnumerateSharedFolders -- * * Enumerates all exisitng shared folders and registers shared folders with * directory notification package. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool HgfsServerEnumerateSharedFolders(void) { void *state; Bool success = FALSE; LOG(8, ("%s: entered\n", __FUNCTION__)); state = HgfsServerResEnumInit(); if (NULL != state) { Bool done; do { char const *shareName; size_t len; success = HgfsServerResEnumGet(state, &shareName, &len, &done); if (success && !done) { HgfsSharedFolderHandle handle; char const *sharePath; size_t sharePathLen; HgfsNameStatus nameStatus; nameStatus = HgfsServerPolicy_GetSharePath(shareName, len, HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, &sharePath); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { LOG(8, ("%s: registering share %s path %s\n", __FUNCTION__, shareName, sharePath)); handle = HgfsServerRegisterShare(shareName, sharePath, TRUE); success = handle != HGFS_INVALID_FOLDER_HANDLE; LOG(8, ("%s: registering share %s hnd %#x\n", __FUNCTION__, shareName, handle)); } } } while (!done && success); HgfsServerResEnumExit(state); } LOG(8, ("%s: exit %d\n", __FUNCTION__, success)); return success; } /* *----------------------------------------------------------------------------- * * HgfsServerSessionConnect -- * * Initialize a new client session. * * Allocate HgfsTransportSessionInfo and initialize it. * * Results: * TRUE on success, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool HgfsServerSessionConnect(void *transportData, // IN: transport session context HgfsServerChannelCallbacks *channelCbTable, // IN: Channel callbacks HgfsServerChannelData *channelCapabilities, // IN: channel capabilities void **transportSessionData) // OUT: server session context { HgfsTransportSessionInfo *transportSession; ASSERT(transportSessionData); LOG(4, ("%s: initting.\n", __FUNCTION__)); transportSession = Util_SafeCalloc(1, sizeof *transportSession); transportSession->transportData = transportData; transportSession->channelCbTable = channelCbTable; transportSession->type = HGFS_SESSION_TYPE_REGULAR; transportSession->state = HGFS_SESSION_STATE_OPEN; transportSession->channelCapabilities = *channelCapabilities; transportSession->numSessions = 0; transportSession->sessionArrayLock = MXUser_CreateExclLock("HgfsSessionArrayLock", RANK_hgfsSessionArrayLock); if (transportSession->sessionArrayLock == NULL) { LOG(4, ("%s: Could not create session sync mutex.\n", __FUNCTION__)); free(transportSession); return FALSE; } DblLnkLst_Init(&transportSession->sessionArray); transportSession->defaultSessionId = HGFS_INVALID_SESSION_ID; Atomic_Write(&transportSession->refCount, 0); /* Give our session a reference to hold while we are open. */ HgfsServerTransportSessionGet(transportSession); *transportSessionData = transportSession; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerAllocateSession -- * * Initialize a new Hgfs session. * * Allocate HgfsSessionInfo and initialize it. Create the nodeArray and * searchArray for the session. * * Results: * TRUE on success, FALSE otherwise. * * Side effects: * Allocates and initializes new session info. * *----------------------------------------------------------------------------- */ static Bool HgfsServerAllocateSession(HgfsTransportSessionInfo *transportSession, // IN: HgfsSessionInfo **sessionData) // OUT: { int i; HgfsSessionInfo *session; LOG(8, ("%s: entered\n", __FUNCTION__)); ASSERT(transportSession); session = Util_SafeCalloc(1, sizeof *session); /* * Initialize all our locks first as these can fail. */ session->fileIOLock = MXUser_CreateExclLock("HgfsFileIOLock", RANK_hgfsFileIOLock); if (session->fileIOLock == NULL) { LOG(4, ("%s: Could not create node array sync mutex.\n", __FUNCTION__)); free(session); return FALSE; } session->nodeArrayLock = MXUser_CreateExclLock("HgfsNodeArrayLock", RANK_hgfsNodeArrayLock); if (session->nodeArrayLock == NULL) { MXUser_DestroyExclLock(session->fileIOLock); LOG(4, ("%s: Could not create node array sync mutex.\n", __FUNCTION__)); free(session); return FALSE; } session->searchArrayLock = MXUser_CreateExclLock("HgfsSearchArrayLock", RANK_hgfsSearchArrayLock); if (session->searchArrayLock == NULL) { MXUser_DestroyExclLock(session->fileIOLock); MXUser_DestroyExclLock(session->nodeArrayLock); LOG(4, ("%s: Could not create search array sync mutex.\n", __FUNCTION__)); free(session); return FALSE; } session->sessionId = HgfsGenerateSessionId(); session->state = HGFS_SESSION_STATE_OPEN; DblLnkLst_Init(&session->links); session->maxPacketSize = transportSession->channelCapabilities.maxPacketSize; session->flags |= HGFS_SESSION_MAXPACKETSIZE_VALID; session->isInactive = TRUE; session->transportSession = transportSession; session->numInvalidationAttempts = 0; /* * Initialize the node handling components. */ DblLnkLst_Init(&session->nodeFreeList); DblLnkLst_Init(&session->nodeCachedList); /* Allocate array of FileNodes and add them to free list. */ session->numNodes = NUM_FILE_NODES; session->nodeArray = Util_SafeCalloc(session->numNodes, sizeof (HgfsFileNode)); session->numCachedOpenNodes = 0; session->numCachedLockedNodes = 0; for (i = 0; i < session->numNodes; i++) { DblLnkLst_Init(&session->nodeArray[i].links); /* Append at the end of the list. */ DblLnkLst_LinkLast(&session->nodeFreeList, &session->nodeArray[i].links); } /* * Initialize the search handling components. */ /* Initialize search freelist. */ DblLnkLst_Init(&session->searchFreeList); Atomic_Write(&session->refCount, 0); /* Give our session a reference to hold while we are open. */ HgfsServerSessionGet(session); /* Allocate array of searches and add them to free list. */ session->numSearches = NUM_SEARCHES; session->searchArray = Util_SafeCalloc(session->numSearches, sizeof (HgfsSearch)); for (i = 0; i < session->numSearches; i++) { DblLnkLst_Init(&session->searchArray[i].links); /* Append at the end of the list. */ DblLnkLst_LinkLast(&session->searchFreeList, &session->searchArray[i].links); } /* Get common to all sessions capabiities. */ HgfsServerGetDefaultCapabilities(session->hgfsSessionCapabilities, &session->numberOfCapabilities); if (transportSession->channelCapabilities.flags & HGFS_CHANNEL_SHARED_MEM) { HgfsServerSetSessionCapability(HGFS_OP_READ_FAST_V4, HGFS_REQUEST_SUPPORTED, session); HgfsServerSetSessionCapability(HGFS_OP_WRITE_FAST_V4, HGFS_REQUEST_SUPPORTED, session); if (gHgfsDirNotifyActive) { LOG(8, ("%s: notify is enabled\n", __FUNCTION__)); if (HgfsServerEnumerateSharedFolders()) { HgfsServerSetSessionCapability(HGFS_OP_SET_WATCH_V4, HGFS_REQUEST_SUPPORTED, session); HgfsServerSetSessionCapability(HGFS_OP_REMOVE_WATCH_V4, HGFS_REQUEST_SUPPORTED, session); session->flags |= HGFS_SESSION_CHANGENOTIFY_ENABLED; } else { HgfsServerSetSessionCapability(HGFS_OP_SET_WATCH_V4, HGFS_REQUEST_NOT_SUPPORTED, session); HgfsServerSetSessionCapability(HGFS_OP_REMOVE_WATCH_V4, HGFS_REQUEST_NOT_SUPPORTED, session); } LOG(8, ("%s: session notify capability is %s\n", __FUNCTION__, (session->flags & HGFS_SESSION_CHANGENOTIFY_ENABLED ? "enabled" : "disabled"))); } HgfsServerSetSessionCapability(HGFS_OP_SEARCH_READ_V4, HGFS_REQUEST_SUPPORTED, session); } *sessionData = session; Log("%s: init session %p id %"FMT64"x\n", __FUNCTION__, session, session->sessionId); return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsDisconnectSessionInt -- * * Disconnect a client session. * * Mark the session as closed as we are in the process of teardown * of the session. No more new requests should be processed. We would * start draining any outstanding pending operations at this point. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsDisconnectSessionInt(HgfsSessionInfo *session) // IN: session context { LOG(8, ("%s: entered\n", __FUNCTION__)); ASSERT(session); ASSERT(session->nodeArray); ASSERT(session->searchArray); session->state = HGFS_SESSION_STATE_CLOSED; LOG(8, ("%s: exit\n", __FUNCTION__)); } /* *----------------------------------------------------------------------------- * * HgfsServerSessionDisconnect -- * * Disconnect a client session. * * Mark the session as closed as we are in the process of teardown * of the session. No more new requests should be processed. We would * start draining any outstanding pending operations at this point. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerSessionDisconnect(void *clientData) // IN: session context { HgfsTransportSessionInfo *transportSession = clientData; DblLnkLst_Links *curr, *next; LOG(8, ("%s: entered\n", __FUNCTION__)); ASSERT(transportSession); MXUser_AcquireExclLock(transportSession->sessionArrayLock); DblLnkLst_ForEachSafe(curr, next, &transportSession->sessionArray) { HgfsSessionInfo *session = DblLnkLst_Container(curr, HgfsSessionInfo, links); HgfsDisconnectSessionInt(session); } MXUser_ReleaseExclLock(transportSession->sessionArrayLock); transportSession->state = HGFS_SESSION_STATE_CLOSED; LOG(8, ("%s: exit\n", __FUNCTION__)); } /* *----------------------------------------------------------------------------- * * HgfsServerSessionClose -- * * Closes a client session. * * Remvoing the final reference will free the session's nodeArray * and seachArrary, and finally free the session object. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerSessionClose(void *clientData) // IN: session context { HgfsTransportSessionInfo *transportSession = clientData; ASSERT(transportSession); ASSERT(transportSession->state == HGFS_SESSION_STATE_CLOSED); /* Remove, typically, the last reference, will teardown everything. */ HgfsServerTransportSessionPut(transportSession); } /* *----------------------------------------------------------------------------- * * HgfsServerExitSessionInternal -- * * Destroys a session. * * Free the session's nodeArray and seachArrary. Free the session. * * The caller must have previously acquired the global sessions lock. * * Results: * TRUE on success, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerExitSessionInternal(HgfsSessionInfo *session) // IN: session context { int i; ASSERT(session); ASSERT(session->nodeArray); ASSERT(session->searchArray); ASSERT(session->state == HGFS_SESSION_STATE_CLOSED); /* Check and remove any notification handles we have for this session. */ if (session->flags & HGFS_SESSION_CHANGENOTIFY_ENABLED) { LOG(8, ("%s: calling notify component to disconnect\n", __FUNCTION__)); /* * This routine will synchronize itself with notification generator. * Therefore, it will remove subscribers and prevent the event generator * from generating any new events while it locks the subscribers lists. * New events will continue once more but with the updated subscriber list * that will not contain this session. */ HgfsNotify_RemoveSessionSubscribers(session); } MXUser_AcquireExclLock(session->nodeArrayLock); Log("%s: exit session %p id %"FMT64"x\n", __FUNCTION__, session, session->sessionId); /* Recycle all nodes that are still in use, then destroy the node pool. */ for (i = 0; i < session->numNodes; i++) { HgfsHandle handle; if (session->nodeArray[i].state == FILENODE_STATE_UNUSED) { continue; } handle = HgfsFileNode2Handle(&session->nodeArray[i]); HgfsRemoveFromCacheInternal(handle, session); HgfsFreeFileNodeInternal(handle, session); } free(session->nodeArray); session->nodeArray = NULL; MXUser_ReleaseExclLock(session->nodeArrayLock); /* * Recycle all searches that are still in use, then destroy the * search pool. */ MXUser_AcquireExclLock(session->searchArrayLock); for (i = 0; i < session->numSearches; i++) { if (DblLnkLst_IsLinked(&session->searchArray[i].links)) { continue; } HgfsRemoveSearchInternal(&session->searchArray[i], session); } free(session->searchArray); session->searchArray = NULL; MXUser_ReleaseExclLock(session->searchArrayLock); /* Teardown the locks for the sessions and destroy itself. */ MXUser_DestroyExclLock(session->nodeArrayLock); MXUser_DestroyExclLock(session->searchArrayLock); MXUser_DestroyExclLock(session->fileIOLock); free(session); } /* *----------------------------------------------------------------------------- * * HgfsServer_GetHandleCounter -- * * Return file handle counter. This is used by the checkpointing code to * checkpoint this value so we avoid the risk of handle collision. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ uint32 HgfsServer_GetHandleCounter(void) { return HgfsServerGetHandleCounter(); } /* *----------------------------------------------------------------------------- * * HgfsServer_SetHandleCounter -- * * Set the file handle counter. This is used by the checkpointing code to * restore this value so we avoid the risk of handle collision. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsServer_SetHandleCounter(uint32 newHandleCounter) { HgfsServerInitHandleCounter(newHandleCounter); } /* *---------------------------------------------------------------------------- * * HgfsServerSessionSendComplete -- * * This is called by the Transport when it is done sending the packet. * Free the buffer. If we allocate buffers per session we have the session * that the buffer belongs too. * * Results: * None. * * Side effects: * Frees the packet buffer. * *--------------------------------------------------------------------------- */ void HgfsServerSessionSendComplete(HgfsPacket *packet, // IN/OUT: Hgfs packet void *clientData) // IN: session info { HgfsTransportSessionInfo *transportSession = clientData; if (0 != (packet->state & HGFS_STATE_CLIENT_REQUEST)) { HSPU_PutMetaPacket(packet, transportSession->channelCbTable); HSPU_PutReplyPacket(packet, transportSession->channelCbTable); HSPU_PutDataPacketBuf(packet, transportSession->channelCbTable); } else { if (packet->metaPacketIsAllocated) { free(packet->metaPacket); } free(packet); } } /* *---------------------------------------------------------------------------- * * HgfsServer_Quiesce -- * * The function is called when VM is about to take a snapshot and * when creation of the snapshot completed. When the freeze is TRUE the * function quiesces all asynchronous and background activity to prevent * interactions with snapshots and waits until there is no such activity. * When freeze is FALSE the function restarts background activity that * has been suspended previously. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ void HgfsServer_Quiesce(Bool freeze) // IN: { if (!gHgfsInitialized) { return; } if (freeze) { /* Suspend background activity. */ if (gHgfsDirNotifyActive) { HgfsNotify_Deactivate(HGFS_NOTIFY_REASON_SERVER_SYNC); } /* Wait for outstanding asynchronous requests to complete. */ MXUser_AcquireExclLock(gHgfsAsyncLock); while (Atomic_Read(&gHgfsAsyncCounter)) { MXUser_WaitCondVarExclLock(gHgfsAsyncLock, gHgfsAsyncVar); } MXUser_ReleaseExclLock(gHgfsAsyncLock); } else { /* Resume background activity. */ if (gHgfsDirNotifyActive) { HgfsNotify_Activate(HGFS_NOTIFY_REASON_SERVER_SYNC); } } } /* *---------------------------------------------------------------------------- * * HgfsNotifyPacketSent -- * * Decrements counter of outstanding asynchronous packets * and signal conditional variable when the counter * becomes 0. * * Results: * TRUE on success, FALSE on error. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void HgfsNotifyPacketSent(void) { if (Atomic_ReadDec32(&gHgfsAsyncCounter) == 1) { MXUser_AcquireExclLock(gHgfsAsyncLock); MXUser_BroadcastCondVar(gHgfsAsyncVar); MXUser_ReleaseExclLock(gHgfsAsyncLock); } } /* *---------------------------------------------------------------------------- * * HgfsPacketSend -- * * Send the packet. * * Results: * TRUE on success, FALSE on error. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool HgfsPacketSend(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsTransportSessionInfo *transportSession, // IN: session info HgfsSendFlags flags) // IN: flags for how to process { Bool result = FALSE; Bool notificationNeeded = (0 != (packet->state & HGFS_STATE_CLIENT_REQUEST) && 0 != (packet->state & HGFS_STATE_ASYNC_REQUEST)); ASSERT(packet); ASSERT(transportSession); if (transportSession->state == HGFS_SESSION_STATE_OPEN) { ASSERT(transportSession->type == HGFS_SESSION_TYPE_REGULAR); result = transportSession->channelCbTable->send(transportSession->transportData, packet, flags); } if (notificationNeeded) { HgfsNotifyPacketSent(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsInvalidateSessionObjects -- * * Iterates over all nodes and searches, invalidating and removing those * that are no longer within a share. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsInvalidateSessionObjects(DblLnkLst_Links *shares, // IN: List of new shares HgfsSessionInfo *session) // IN: Session info { unsigned int i; ASSERT(shares); ASSERT(session); ASSERT(session->nodeArray); ASSERT(session->searchArray); LOG(4, ("%s: Beginning\n", __FUNCTION__)); MXUser_AcquireExclLock(session->nodeArrayLock); /* * Iterate over each node, skipping those that are unused. For each node, * if its filename is no longer within a share, remove it. */ for (i = 0; i < session->numNodes; i++) { HgfsHandle handle; DblLnkLst_Links *l; if (session->nodeArray[i].state == FILENODE_STATE_UNUSED) { continue; } handle = HgfsFileNode2Handle(&session->nodeArray[i]); LOG(4, ("%s: Examining node with fd %d (%s)\n", __FUNCTION__, handle, session->nodeArray[i].utf8Name)); /* For each share, is the node within the share? */ for (l = shares->next; l != shares; l = l->next) { HgfsSharedFolder *share; share = DblLnkLst_Container(l, HgfsSharedFolder, links); ASSERT(share); if (strcmp(session->nodeArray[i].shareInfo.rootDir, share->path) == 0) { LOG(4, ("%s: Node is still valid\n", __FUNCTION__)); break; } } /* If the node wasn't found in any share, remove it. */ if (l == shares) { LOG(4, ("%s: Node is invalid, removing\n", __FUNCTION__)); if (!HgfsRemoveFromCacheInternal(handle, session)) { LOG(4, ("%s: Could not remove node with " "fh %d from the cache.\n", __FUNCTION__, handle)); } else { HgfsFreeFileNodeInternal(handle, session); } } } MXUser_ReleaseExclLock(session->nodeArrayLock); MXUser_AcquireExclLock(session->searchArrayLock); /* * Iterate over each search, skipping those that are on the free list. For * each search, if its base name is no longer within a share, remove it. */ for (i = 0; i < session->numSearches; i++) { DblLnkLst_Links *l; if (DblLnkLst_IsLinked(&session->searchArray[i].links)) { continue; } if (HgfsSearchIsBaseNameSpace(&session->searchArray[i])) { /* Skip search of the base name space. Maybe stale but it is okay. */ continue; } LOG(4, ("%s: Examining search (%s)\n", __FUNCTION__, session->searchArray[i].utf8Dir)); /* For each share, is the search within the share? */ for (l = shares->next; l != shares; l = l->next) { HgfsSharedFolder *share; share = DblLnkLst_Container(l, HgfsSharedFolder, links); ASSERT(share); if (strcmp(session->searchArray[i].shareInfo.rootDir, share->path) == 0) { LOG(4, ("%s: Search is still valid\n", __FUNCTION__)); break; } } /* If the node wasn't found in any share, remove it. */ if (l == shares) { LOG(4, ("%s: Search is invalid, removing\n", __FUNCTION__)); HgfsRemoveSearchInternal(&session->searchArray[i], session); } } MXUser_ReleaseExclLock(session->searchArrayLock); LOG(4, ("%s: Ending\n", __FUNCTION__)); } /* *----------------------------------------------------------------------------- * * HgfsServerSessionInvalidateObjects -- * * Iterates over all sessions and invalidate session objects for the shares * removed. * * Caller guarantees that the sessions won't go away under us, so no locks * needed. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsServerSessionInvalidateObjects(void *clientData, // IN: DblLnkLst_Links *shares) // IN: List of new shares { HgfsTransportSessionInfo *transportSession = clientData; DblLnkLst_Links *curr; ASSERT(transportSession); MXUser_AcquireExclLock(transportSession->sessionArrayLock); DblLnkLst_ForEach(curr, &transportSession->sessionArray) { HgfsSessionInfo *session = DblLnkLst_Container(curr, HgfsSessionInfo, links); HgfsServerSessionGet(session); HgfsInvalidateSessionObjects(shares, session); HgfsServerSessionPut(session); } MXUser_ReleaseExclLock(transportSession->sessionArrayLock); } /* *----------------------------------------------------------------------------- * * HgfsServerSessionInvalidateInactiveSessions -- * * Iterates over all sessions and invalidate all inactive session objects. * * Following clock algorithm is used to determine whether the session object * is inactive or not. * * When this function is called, the HGFS server manager will iterate * over all the sessions belonging to this manager. Each session is marked * as inactive. Whenever a message is processed for a session, that * session is marked as active. When this function is called the next time, * any sessions that are still inactive will be invalidated. * * Caller guarantees that the sessions won't go away under us, so no locks * needed. * * Results: * Number of active sessions remaining inside the HGFS server. * * Side effects: * None * *----------------------------------------------------------------------------- */ uint32 HgfsServerSessionInvalidateInactiveSessions(void *clientData) // IN: { HgfsTransportSessionInfo *transportSession = clientData; uint32 numActiveSessionsLeft = 0; DblLnkLst_Links shares, *curr, *next; ASSERT(transportSession); MXUser_AcquireExclLock(transportSession->sessionArrayLock); DblLnkLst_Init(&shares); DblLnkLst_ForEachSafe(curr, next, &transportSession->sessionArray) { HgfsSessionInfo *session = DblLnkLst_Container(curr, HgfsSessionInfo, links); HgfsServerSessionGet(session); session->numInvalidationAttempts++; numActiveSessionsLeft++; /* * Check if the session is inactive. If the session is inactive, then * invalidate the session objects. */ if (session->isInactive) { if (session->numInvalidationAttempts == MAX_SESSION_INVALIDATION_ATTEMPTS) { LOG(4, ("%s: closing inactive session %"FMT64"x\n", __FUNCTION__, session->sessionId)); session->state = HGFS_SESSION_STATE_CLOSED; HgfsServerTransportRemoveSessionFromList(transportSession, session); /* * We need to reduce the refcount by 1 since we want to * destroy the session. */ numActiveSessionsLeft--; HgfsServerSessionPut(session); } else { HgfsInvalidateSessionObjects(&shares, session); } } else { session->isInactive = TRUE; session->numInvalidationAttempts = 0; } HgfsServerSessionPut(session); } MXUser_ReleaseExclLock(transportSession->sessionArrayLock); return numActiveSessionsLeft; } /* *----------------------------------------------------------------------------- * * HgfsServerStatFs -- * * Calls on the wiper library to return the number of free bytes and * total bytes on the filesystem underlying the given pathname. * * Results: * TRUE if successful: freeBytes and totalBytes have been written to. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsServerStatFs(const char *pathName, // IN: Path we're interested in size_t pathLength, // IN: Length of path uint64 *freeBytes, // OUT: Free bytes on volume uint64 *totalBytes) // OUT: Total bytes on volume { WiperPartition p; unsigned char *wiperError; ASSERT(pathName); ASSERT(freeBytes); ASSERT(totalBytes); Wiper_Init(NULL); /* * Sanity checks. If length is good, assume well-formed drive path * (i.e. "C:\..." or "\\abc..."). Note that we throw out shares that * exactly equal p.mountPoint's size because we won't have room for a null * delimiter on copy. Allow 0 length drives so that hidden feature "" can * work. */ if (pathLength >= sizeof p.mountPoint) { LOG(4, ("%s: could not get the volume name\n", __FUNCTION__)); return FALSE; } /* Now call the wiper lib to get space information. */ Str_Strcpy(p.mountPoint, pathName, sizeof p.mountPoint); wiperError = WiperSinglePartition_GetSpace(&p, freeBytes, totalBytes); if (strlen(wiperError) > 0) { LOG(4, ("%s: error using wiper lib: %s\n", __FUNCTION__, wiperError)); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerGetLocalNameInfo -- * * Construct local name based on the crossplatform CPName for the file and the * share information. * * The name returned is allocated and must be freed by the caller. * The name length is optionally returned. * * Results: * A status code indicating either success (correspondent share exists) or * a failure status. * * Side effects: * Memory allocation in the success case * *----------------------------------------------------------------------------- */ static HgfsNameStatus HgfsServerGetLocalNameInfo(const char *cpName, // IN: Cross-platform filename to check size_t cpNameSize, // IN: Size of name cpName uint32 caseFlags, // IN: Case-sensitivity flags HgfsShareInfo *shareInfo,// OUT: properties of the shared folder char **bufOut, // OUT: File name in local fs size_t *outLen) // OUT: Length of name out optional { HgfsNameStatus nameStatus; const char *inEnd; const char *next; char *myBufOut; char *convertedMyBufOut; char *out; size_t outSize; size_t myBufOutLen; size_t convertedMyBufOutLen; int len; uint32 pathNameLen; char tempBuf[HGFS_PATH_MAX]; size_t tempSize; char *tempPtr; uint32 startIndex = 0; HgfsShareOptions shareOptions; ASSERT(cpName); ASSERT(bufOut); inEnd = cpName + cpNameSize; if (!Unicode_IsBufferValid(cpName, cpNameSize, STRING_ENCODING_UTF8)) { LOG(4, ("%s: invalid UTF8 string @ %p\n", __FUNCTION__, cpName)); return HGFS_NAME_STATUS_FAILURE; } /* * Get first component. */ len = CPName_GetComponent(cpName, inEnd, &next); if (len < 0) { LOG(4, ("%s: get first component failed\n", __FUNCTION__)); return HGFS_NAME_STATUS_FAILURE; } /* See if we are dealing with the base of the namespace */ if (!len) { return HGFS_NAME_STATUS_INCOMPLETE_BASE; } /* Check permission on the share and get the share path */ nameStatus = HgfsServerPolicy_ProcessCPName(cpName, len, &shareInfo->readPermissions, &shareInfo->writePermissions, &shareInfo->handle, &shareInfo->rootDir); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: No such share (%s)\n", __FUNCTION__, cpName)); return nameStatus; } shareInfo->rootDirLen = strlen(shareInfo->rootDir); /* Get the config options. */ nameStatus = HgfsServerPolicy_GetShareOptions(cpName, len, &shareOptions); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, cpName)); return nameStatus; } /* Point to the next component, if any */ cpNameSize -= next - cpName; cpName = next; /* * Allocate space for the string. We trim the unused space later. */ outSize = HGFS_PATH_MAX; myBufOut = (char *) malloc(outSize * sizeof *myBufOut); if (!myBufOut) { LOG(4, ("%s: out of memory allocating string\n", __FUNCTION__)); return HGFS_NAME_STATUS_OUT_OF_MEMORY; } out = myBufOut; /* * See if we are dealing with a "root" share or regular share */ if (shareInfo->rootDirLen == 0) { size_t prefixLen; /* Are root shares allowed? If not, we exit with an error. */ if (0 == (gHgfsCfgSettings.flags & HGFS_CONFIG_SHARE_ALL_HOST_DRIVES_ENABLED)) { LOG(4, ("%s: Root share being used\n", __FUNCTION__)); nameStatus = HGFS_NAME_STATUS_ACCESS_DENIED; goto error; } /* * This is a "root" share. Interpret the input appropriately as * either a drive letter or UNC name and append it to the output * buffer (for Win32) or simply get the prefix for root (for * linux). */ tempSize = sizeof tempBuf; tempPtr = tempBuf; nameStatus = CPName_ConvertFromRoot(&cpName, &cpNameSize, &tempSize, &tempPtr); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: ConvertFromRoot not complete\n", __FUNCTION__)); goto error; } prefixLen = tempPtr - tempBuf; /* Copy the UTF8 prefix to the output buffer. */ if (prefixLen >= HGFS_PATH_MAX) { Log("%s: error: prefix too long\n", __FUNCTION__); nameStatus = HGFS_NAME_STATUS_TOO_LONG; goto error; } memcpy(out, tempBuf, prefixLen); out += prefixLen; *out = 0; outSize -= prefixLen; } else { /* * This is a regular share. Append the path to the out buffer. */ if (outSize < shareInfo->rootDirLen + 1) { LOG(4, ("%s: share path too big\n", __FUNCTION__)); nameStatus = HGFS_NAME_STATUS_TOO_LONG; goto error; } memcpy(out, shareInfo->rootDir, shareInfo->rootDirLen + 1); out += shareInfo->rootDirLen; outSize -= shareInfo->rootDirLen; } /* Convert the rest of the input name (if any) to a local name */ tempSize = sizeof tempBuf; tempPtr = tempBuf; if (CPName_ConvertFrom(&cpName, &cpNameSize, &tempSize, &tempPtr) < 0) { LOG(4, ("%s: CP name conversion failed\n", __FUNCTION__)); nameStatus = HGFS_NAME_STATUS_FAILURE; goto error; } /* * For volume root directory shares the prefix will have a trailing * separator and since our remaining paths start with a separator, we * will skip over the second separator for this case. Bug 166755. */ if ((out != myBufOut) && (*(out - 1) == DIRSEPC) && (tempBuf[0] == DIRSEPC)) { startIndex++; } pathNameLen = tempPtr - &tempBuf[startIndex]; /* Copy UTF8 to the output buffer. */ if (pathNameLen >= outSize) { LOG(4, ("%s: pathname too long\n", __FUNCTION__)); nameStatus = HGFS_NAME_STATUS_TOO_LONG; goto error; } memcpy(out, &tempBuf[startIndex], pathNameLen); outSize -= pathNameLen; out += pathNameLen; *out = 0; myBufOutLen = out - myBufOut; #if defined(__APPLE__) { size_t nameLen; /* * For Mac hosts the unicode format is decomposed (form D) * so there is a need to convert the incoming name from HGFS clients * which is assumed to be in the normalized form C (precomposed). */ if (!CodeSet_Utf8FormCToUtf8FormD(myBufOut, myBufOutLen, &tempPtr, &nameLen)) { LOG(4, ("%s: unicode conversion to form D failed.\n", __FUNCTION__)); nameStatus = HGFS_NAME_STATUS_FAILURE; goto error; } free(myBufOut); LOG(4, ("%s: name is \"%s\"\n", __FUNCTION__, tempPtr)); /* Save returned pointers, update buffer length. */ myBufOut = tempPtr; out = tempPtr + nameLen; myBufOutLen = nameLen; } #endif /* defined(__APPLE__) */ /* * Look up the file name using the proper case if the config option is not set * to use the host default and lookup is supported for this platform. */ if (!HgfsServerPolicy_IsShareOptionSet(shareOptions, HGFS_SHARE_HOST_DEFAULT_CASE) && HgfsPlatformDoFilenameLookup()) { nameStatus = HgfsPlatformFilenameLookup(shareInfo->rootDir, shareInfo->rootDirLen, myBufOut, myBufOutLen, caseFlags, &convertedMyBufOut, &convertedMyBufOutLen); /* * On successful lookup, use the found matching file name for further operations. */ if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: HgfsPlatformFilenameLookup failed.\n", __FUNCTION__)); goto error; } free(myBufOut); myBufOut = convertedMyBufOut; myBufOutLen = convertedMyBufOutLen; ASSERT(myBufOut); } /* Check for symlinks if the followSymlinks option is not set. */ if (!HgfsServerPolicy_IsShareOptionSet(shareOptions, HGFS_SHARE_FOLLOW_SYMLINKS)) { /* * Verify that either the path is same as share path or the path until the * parent directory is within the share. * * XXX: Symlink check could become susceptible to TOCTOU (time-of-check, * time-of-use) attack when we move to asynchrounous HGFS operations. * We should use the resolved file path for further file system * operations, instead of using the one passed from the client. */ nameStatus = HgfsPlatformPathHasSymlink(myBufOut, myBufOutLen, shareInfo->rootDir, shareInfo->rootDirLen); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: parent path failed to be resolved: %d\n", __FUNCTION__, nameStatus)); goto error; } } { char *p; /* Trim unused memory */ /* Enough space for resulting string + NUL termination */ p = realloc(myBufOut, (myBufOutLen + 1) * sizeof *p); if (!p) { LOG(4, ("%s: failed to trim memory\n", __FUNCTION__)); } else { myBufOut = p; } if (outLen) { *outLen = myBufOutLen; } } LOG(4, ("%s: name is \"%s\"\n", __FUNCTION__, myBufOut)); *bufOut = myBufOut; return HGFS_NAME_STATUS_COMPLETE; error: free(myBufOut); return nameStatus; } /* *----------------------------------------------------------------------------- * * HgfsServerIsSharedFolderOnly -- * * Test a name if it is a shared folder only or not * * This function assumes that CPName_GetComponent() will always succeed * with a size greater than 0, so it must ONLY be called after a call to * HgfsServerGetLocalNameInfo() that returns HGFS_NAME_STATUS_COMPLETE. * * Results: * True if it is a shared folder only, otherwise false * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerIsSharedFolderOnly(char const *cpName,// IN: Cross-platform filename to check size_t cpNameSize) // IN: Size of name cpName { char const *inEnd; char const *next; int len; ASSERT(cpName); inEnd = cpName + cpNameSize; len = CPName_GetComponent(cpName, inEnd, &next); ASSERT(len > 0); (void) len; /* Shuts up gcc's -Werror=unused-but-set-variable. */ return (next == inEnd); } #ifdef VMX86_LOG /* *----------------------------------------------------------------------------- * * HgfsServerDirDumpDents -- * * Dump a set of directory entries (debugging code) * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsServerDirDumpDents(HgfsHandle searchHandle, // IN: Handle to dump dents from HgfsSessionInfo *session) // IN: Session info { HgfsSearch *search; MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsSearchHandle2Search(searchHandle, session); if (search != NULL) { HgfsPlatformDirDumpDents(search); } MXUser_ReleaseExclLock(session->searchArrayLock); } #endif /* *----------------------------------------------------------------------------- * * HgfsServerSearchRealDir -- * * Handle a search on a real directory. Takes a pointer to an enumerator * for the directory's contents and returns a handle to a search that is * correctly set up with the real directory's entries. * * The casual reader will notice that the "type" of this search is obviously * always DIRECTORY_SEARCH_TYPE_DIR, but the caller is nonetheless required * to pass it in, for completeness' sake with respect to * HgfsServerSearchVirtualDir. * * Results: * Zero on success, returns a handle to the created search. * Non-zero on failure. * * Side effects: * Memory allocation on success * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsServerSearchRealDir(char const *baseDir, // IN: Directory to search size_t baseDirLen, // IN: Length of directory char const *shareName, // IN: Share name containing the directory char const *rootDir, // IN: Shared folder root directory HgfsSessionInfo *session, // IN: Session info HgfsHandle *handle) // OUT: Search handle { HgfsSearch *search = NULL; HgfsInternalStatus status = 0; HgfsNameStatus nameStatus; Bool followSymlinks; HgfsShareOptions configOptions; ASSERT(baseDir); ASSERT(handle); ASSERT(shareName); MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsAddNewSearch(baseDir, DIRECTORY_SEARCH_TYPE_DIR, shareName, rootDir, session); if (!search) { LOG(4, ("%s: failed to get new search\n", __FUNCTION__)); status = HGFS_ERROR_INTERNAL; goto out; } /* Get the config options. */ nameStatus = HgfsServerPolicy_GetShareOptions(shareName, strlen(shareName), &configOptions); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, shareName)); status = HGFS_ERROR_INTERNAL; HgfsRemoveSearchInternal(search, session); goto out; } followSymlinks = HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS); status = HgfsPlatformScandir(baseDir, baseDirLen, followSymlinks, &search->dents, &search->numDents); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: couldn't scandir\n", __FUNCTION__)); HgfsRemoveSearchInternal(search, session); goto out; } *handle = HgfsSearch2SearchHandle(search); out: MXUser_ReleaseExclLock(session->searchArrayLock); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerSearchVirtualDir -- * * Handle a search on a virtual directory (i.e. one that does not * really exist on the server). Takes a pointer to an enumerator * for the directory's contents and returns a handle to a search that is * correctly set up with the virtual directory's entries. * * Results: * Zero on success, returns a handle to the created search. * Non-zero on failure. * * Side effects: * Memory allocation on success * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsServerSearchVirtualDir(HgfsServerResEnumGetFunc getName, // IN: Name enumerator HgfsServerResEnumInitFunc initName, // IN: Init function HgfsServerResEnumExitFunc cleanupName, // IN: Cleanup function DirectorySearchType type, // IN: Kind of search HgfsSessionInfo *session, // IN: Session info HgfsHandle *handle) // OUT: Search handle { HgfsInternalStatus status = 0; HgfsSearch *search = NULL; ASSERT(getName); ASSERT(initName); ASSERT(cleanupName); ASSERT(handle); MXUser_AcquireExclLock(session->searchArrayLock); search = HgfsAddNewSearch("", type, "", "", session); if (!search) { LOG(4, ("%s: failed to get new search\n", __FUNCTION__)); status = HGFS_ERROR_INTERNAL; goto out; } status = HgfsPlatformScanvdir(getName, initName, cleanupName, type, &search->dents, &search->numDents); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: couldn't get dents\n", __FUNCTION__)); HgfsRemoveSearchInternal(search, session); goto out; } *handle = HgfsSearch2SearchHandle(search); out: MXUser_ReleaseExclLock(session->searchArrayLock); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerRestartSearchVirtualDir -- * * Restart a search on a virtual directory (i.e. one that does not * really exist on the server). Takes a pointer to an enumerator * for the directory's contents and returns a handle to a search that is * correctly set up with the virtual directory's entries. * * Results: * Zero on success, returns a handle to the created search. * Non-zero on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsServerRestartSearchVirtualDir(HgfsServerResEnumGetFunc getName, // IN: Name enumerator HgfsServerResEnumInitFunc initName, // IN: Init function HgfsServerResEnumExitFunc cleanupName, // IN: Cleanup function HgfsSessionInfo *session, // IN: Session info HgfsHandle searchHandle) // IN: search to restart { HgfsInternalStatus status = 0; HgfsSearch *vdirSearch; ASSERT(getName); ASSERT(initName); ASSERT(cleanupName); ASSERT(searchHandle); MXUser_AcquireExclLock(session->searchArrayLock); vdirSearch = HgfsSearchHandle2Search(searchHandle, session); if (NULL == vdirSearch) { status = HGFS_ERROR_INVALID_HANDLE; goto exit; } /* Release the virtual directory's old set of entries. */ HgfsFreeSearchDirents(vdirSearch); /* Restart by rescanning the virtual directory. */ status = HgfsPlatformScanvdir(getName, initName, cleanupName, vdirSearch->type, &vdirSearch->dents, &vdirSearch->numDents); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: couldn't get root dents %u\n", __FUNCTION__, status)); goto exit; } /* Clear the flag to indicate that the client has read the entries. */ vdirSearch->flags &= ~HGFS_SEARCH_FLAG_READ_ALL_ENTRIES; exit: MXUser_ReleaseExclLock(session->searchArrayLock); LOG(4, ("%s: refreshing dents return %d\n", __FUNCTION__, status)); return status; } /* *----------------------------------------------------------------------------- * * HgfsRemoveFromCache -- * * Grab a node cache lock and call HgfsRemoveFromCacheInternal. * * If the node was not already in the cache then nothing is done. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsRemoveFromCache(HgfsHandle handle, // IN: Hgfs handle to the node HgfsSessionInfo *session) // IN: Session info { Bool removed = FALSE; MXUser_AcquireExclLock(session->nodeArrayLock); removed = HgfsRemoveFromCacheInternal(handle, session); MXUser_ReleaseExclLock(session->nodeArrayLock); return removed; } /* *----------------------------------------------------------------------------- * * HgfsIsCached -- * * Grab a lock and call HgfsIsCachedInternal. * * Results: * TRUE if the node is found in the cache. * FALSE if the node is not in the cache. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsIsCached(HgfsHandle handle, // IN: Structure representing file node HgfsSessionInfo *session) // IN: Session info { Bool cached = FALSE; MXUser_AcquireExclLock(session->nodeArrayLock); cached = HgfsIsCachedInternal(handle, session); MXUser_ReleaseExclLock(session->nodeArrayLock); return cached; } /* *----------------------------------------------------------------------------- * * HgfsRemoveLruNode-- * * Removes the least recently used node in the cache. The first node is * removed since most recently used nodes are moved to the end of the * list. * * XXX: Right now we do not remove nodes that have server locks on them * This is not correct and should be fixed before the release. * Instead we should cancel the server lock (by calling IoCancel) * notify client of the lock break, and close the file. * * Assumes that there is at least one node in the cache. * * The session's nodeArrayLock should be acquired prior to calling this * function. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsRemoveLruNode(HgfsSessionInfo *session) // IN: session info { HgfsFileNode *lruNode = NULL; HgfsHandle handle; Bool found = FALSE; uint32 numOpenNodes = session->numCachedOpenNodes; ASSERT(session); ASSERT(session->numCachedOpenNodes > 0); /* * Remove the first item from the list that does not have a server lock, * file context or is open in sequential mode. */ while (!found && (numOpenNodes-- > 0)) { lruNode = DblLnkLst_Container(session->nodeCachedList.next, HgfsFileNode, links); ASSERT(lruNode->state == FILENODE_STATE_IN_USE_CACHED); if (lruNode->serverLock != HGFS_LOCK_NONE || lruNode->fileCtx != NULL || (lruNode->flags & HGFS_FILE_NODE_SEQUENTIAL_FL) != 0) { /* * Move this node with the server lock to the beginning of the list. * Also, prevent files opened in HGFS_FILE_NODE_SEQUENTIAL_FL mode * from being closed. -- On some platforms, this mode does not * allow files to be closed/re-opened (eg: When restoring a file * into a Windows guest you cannot use BackupWrite, then close and * re-open the file and continue to use BackupWrite. */ DblLnkLst_Unlink1(&lruNode->links); DblLnkLst_LinkLast(&session->nodeCachedList, &lruNode->links); } else { found = TRUE; } } if (found) { handle = HgfsFileNode2Handle(lruNode); if (!HgfsRemoveFromCacheInternal(handle, session)) { LOG(4, ("%s: Could not remove the node from cache.\n", __FUNCTION__)); return FALSE; } } else { LOG(4, ("%s: Could not find a node to remove from cache.\n", __FUNCTION__)); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsAddToCache -- * * Grabs the cache lock and calls HgfsAddToCacheInternal. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsAddToCache(HgfsHandle handle, // IN: HGFS file handle HgfsSessionInfo *session) // IN: Session info { Bool added = FALSE; MXUser_AcquireExclLock(session->nodeArrayLock); added = HgfsAddToCacheInternal(handle, session); MXUser_ReleaseExclLock(session->nodeArrayLock); return added; } /* *----------------------------------------------------------------------------- * * HgfsCreateAndCacheFileNode -- * * Get a node from the free node list and cache it. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsCreateAndCacheFileNode(HgfsFileOpenInfo *openInfo, // IN: Open info struct HgfsLocalId const *localId, // IN: Local unique file ID fileDesc fileDesc, // IN: Handle to the fileopenInfo, Bool append, // IN: flag to append HgfsSessionInfo *session) // IN: session info { HgfsHandle handle; HgfsFileNode *node = NULL; char const *inEnd; char const *next; int len; Bool sharedFolderOpen = FALSE; ASSERT(openInfo); ASSERT(localId); ASSERT(session); inEnd = openInfo->cpName + openInfo->cpNameSize; /* * Get first component. */ len = CPName_GetComponent(openInfo->cpName, inEnd, &next); if (len < 0) { LOG(4, ("%s: get first component failed\n", __FUNCTION__)); HgfsPlatformCloseFile(fileDesc, NULL); return FALSE; } /* See if we are dealing with the base of the namespace */ if (!len) { HgfsPlatformCloseFile(fileDesc, NULL); return FALSE; } if (!next) { sharedFolderOpen = TRUE; } MXUser_AcquireExclLock(session->nodeArrayLock); node = HgfsAddNewFileNode(openInfo, localId, fileDesc, append, len, openInfo->cpName, sharedFolderOpen, session); if (node == NULL) { LOG(4, ("%s: Failed to add new node.\n", __FUNCTION__)); MXUser_ReleaseExclLock(session->nodeArrayLock); HgfsPlatformCloseFile(fileDesc, NULL); return FALSE; } handle = HgfsFileNode2Handle(node); if (!HgfsAddToCacheInternal(handle, session)) { HgfsFreeFileNodeInternal(handle, session); HgfsPlatformCloseFile(fileDesc, NULL); LOG(4, ("%s: Failed to add node to the cache.\n", __FUNCTION__)); MXUser_ReleaseExclLock(session->nodeArrayLock); return FALSE; } MXUser_ReleaseExclLock(session->nodeArrayLock); /* Only after everything is successful, save the handle in the open info. */ openInfo->file = handle; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsAllocInitReply -- * * Retrieves the hgfs protocol reply data buffer that follows the reply header. * * Results: * Cannot fail, returns the protocol reply data buffer for the corresponding * processed protocol request. * * Side effects: * None * *----------------------------------------------------------------------------- */ void * HgfsAllocInitReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header size_t replyDataSize, // IN: replyDataSize size HgfsSessionInfo *session) // IN: Session Info { const HgfsRequest *request = packetHeader; size_t replyPacketSize; size_t headerSize = 0; /* Replies prior to V3 do not have a header. */ void *replyHeader; void *replyData; /* * XXX - this should be modified to use the common HgfsServerGetRequestHeaderSize * so that all requests and replies are handled consistently. */ if (HGFS_OP_NEW_HEADER == request->op) { headerSize = sizeof(HgfsHeader); } else if (request->op < HGFS_OP_CREATE_SESSION_V4 && request->op > HGFS_OP_RENAME_V2) { headerSize = sizeof(HgfsReply); } replyHeader = HSPU_GetReplyPacket(packet, session->transportSession->channelCbTable, headerSize + replyDataSize, &replyPacketSize); ASSERT(replyHeader && (replyPacketSize >= headerSize + replyDataSize)); memset(replyHeader, 0, headerSize + replyDataSize); if (replyDataSize > 0) { replyData = (char *)replyHeader + headerSize; } else { replyData = NULL; ASSERT(FALSE); } return replyData; } /* *----------------------------------------------------------------------------- * * HgfsServerValidateRead -- * * Validate a Read request's arguments. * * Note, the readOffset is ignored here but is checked in the platform specific * read handler. * * Results: * HGFS_ERROR_SUCCESS on success. * HGFS error code on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerValidateRead(HgfsInputParam *input, // IN: Input params HgfsHandle readHandle, // IN: read Handle uint32 readSize, // IN: size to read uint64 readOffset, // IN: offset to read unused fileDesc *readfd, // OUT: read file descriptor size_t *readReplySize, // OUT: read reply size size_t *readDataSize) // OUT: read data size { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; size_t replyReadHeaderSize; size_t replyReadResultSize = 0; size_t replyReadResultDataSize = 0; size_t replyReadDataSize = 0; fileDesc readFileDesc = 0; Bool useMappedBuffer; useMappedBuffer = (input->transportSession->channelCbTable->getWriteVa != NULL); replyReadHeaderSize = HgfsServerGetRequestHeaderSize(input); switch (input->op) { case HGFS_OP_READ_FAST_V4: /* Data is packed into a separate buffer from the read results. */ replyReadResultSize = sizeof (HgfsReplyReadV3); replyReadResultDataSize = 0; replyReadDataSize = readSize; break; case HGFS_OP_READ_V3: /* Data is packed as a part of the read results. */ replyReadResultSize = sizeof (HgfsReplyReadV3); replyReadResultDataSize = readSize; replyReadDataSize = 0; break; case HGFS_OP_READ: /* Data is packed as a part of the read results. */ replyReadResultSize = sizeof (HgfsReplyRead); replyReadResultDataSize = readSize; replyReadDataSize = 0; break; default: status = HGFS_ERROR_PROTOCOL; LOG(4, ("%s: Unsupported protocol version passed %d -> PROTOCOL_ERROR.\n", __FUNCTION__, input->op)); NOT_IMPLEMENTED(); goto exit; } if (!HSPU_ValidateDataPacketSize(input->packet, replyReadDataSize) || !HSPU_ValidateReplyPacketSize(input->packet, replyReadHeaderSize, replyReadResultSize, replyReadResultDataSize, useMappedBuffer)) { status = HGFS_ERROR_INVALID_PARAMETER; LOG(4, ("%s: Error: arg validation read size -> %d.\n", __FUNCTION__, status)); goto exit; } /* Validate the file handle by retrieving it possibly from the cache. */ status = HgfsPlatformGetFd(readHandle, input->session, FALSE, &readFileDesc); if (status != HGFS_ERROR_SUCCESS) { LOG(4, ("%s: Error: arg validation handle -> %d.\n", __FUNCTION__, status)); goto exit; } exit: *readDataSize = replyReadDataSize; *readReplySize = replyReadResultSize + replyReadResultDataSize; *readfd = readFileDesc; LOG(4, ("%s: arg validation check return (%"FMTSZ"u) %d.\n", __FUNCTION__, replyReadDataSize, status)); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerRead -- * * Handle a Read request. * * Results: * HGFS_ERROR_SUCCESS on success. * HGFS error code on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerRead(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status; HgfsHandle file; fileDesc readFd; uint64 offset; uint32 requiredSize; size_t replyPayloadSize = 0; size_t replyReadSize = 0; size_t replyReadDataSize = 0; void *replyRead; HGFS_ASSERT_INPUT(input); if (!HgfsUnpackReadRequest(input->payload, input->payloadSize, input->op, &file, &offset, &requiredSize)) { LOG(4, ("%s: Failed to unpack a valid packet -> PROTOCOL_ERROR.\n", __FUNCTION__)); status = HGFS_ERROR_PROTOCOL; goto exit; } /* * Validate the read arguments with the data and reply buffers to ensure * there isn't a malformed request or we read more data than the buffer can * hold. */ status = HgfsServerValidateRead(input, file, requiredSize, offset, &readFd, &replyReadSize, &replyReadDataSize); if (status != HGFS_ERROR_SUCCESS) { LOG(4, ("%s: Error: validate args %u.\n", __FUNCTION__, status)); goto exit; } replyRead = HgfsAllocInitReply(input->packet, input->request, replyReadSize, input->session); switch (input->op) { case HGFS_OP_READ_FAST_V4: case HGFS_OP_READ_V3: { HgfsReplyReadV3 *reply = replyRead; void *payload; Bool readUseDataBuffer = replyReadDataSize != 0; /* * The read data size holds the size of the data to read which will be read * into the separate data packet buffer. Zero indicates data is read into the * same buffer as the reply arguments. */ if (readUseDataBuffer) { payload = HSPU_GetDataPacketBuf(input->packet, BUF_WRITEABLE, input->transportSession->channelCbTable); } else { payload = &reply->payload[0]; } if (payload) { status = HgfsPlatformReadFile(readFd, input->session, offset, requiredSize, payload, &reply->actualSize); if (HGFS_ERROR_SUCCESS == status) { reply->reserved = 0; replyPayloadSize = sizeof *reply; if (readUseDataBuffer) { HSPU_SetDataPacketSize(input->packet, reply->actualSize); } else { replyPayloadSize += reply->actualSize; } } } else { status = HGFS_ERROR_PROTOCOL; LOG(4, ("%s: V3/V4 Failed to get payload -> PROTOCOL_ERROR.\n", __FUNCTION__)); } break; } case HGFS_OP_READ: { HgfsReplyRead *reply = replyRead; status = HgfsPlatformReadFile(readFd, input->session, offset, requiredSize, reply->payload, &reply->actualSize); if (HGFS_ERROR_SUCCESS == status) { replyPayloadSize = sizeof *reply + reply->actualSize; } else { LOG(4, ("%s: V1 Failed to read-> %d.\n", __FUNCTION__, status)); } break; } default: NOT_REACHED(); break; } exit: HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerWrite -- * * Handle a Write request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerWrite(HgfsInputParam *input) // IN: Input params { uint32 numberBytesToWrite; HgfsInternalStatus status; HgfsWriteFlags flags; uint64 offset; const void *dataToWrite; uint32 replyActualSize; size_t replyPayloadSize = 0; HgfsHandle file; HGFS_ASSERT_INPUT(input); if (!HgfsUnpackWriteRequest(input->payload, input->payloadSize, input->op, &file, &offset, &numberBytesToWrite, &flags, &dataToWrite)) { LOG(4, ("%s: Error: Op %d unpack write request arguments\n", __FUNCTION__, input->op)); status = HGFS_ERROR_PROTOCOL; goto exit; } if (NULL == dataToWrite) { /* No inline data to write, get it from the transport shared memory. */ HSPU_SetDataPacketSize(input->packet, numberBytesToWrite); dataToWrite = HSPU_GetDataPacketBuf(input->packet, BUF_READABLE, input->transportSession->channelCbTable); if (NULL == dataToWrite) { LOG(4, ("%s: Error: Op %d mapping write data buffer\n", __FUNCTION__, input->op)); status = HGFS_ERROR_PROTOCOL; goto exit; } } status = HgfsPlatformWriteFile(file, input->session, offset, numberBytesToWrite, flags, dataToWrite, &replyActualSize); if (HGFS_ERROR_SUCCESS != status) { goto exit; } if (!HgfsPackWriteReply(input->packet, input->request, input->op, replyActualSize, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } exit: HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerQueryVolInt -- * * Internal function to query the volume's free space and capacity. * The volume queried can be: * - real taken from the file path of a real file or folder * - virtual taken from one of the HGFS virtual folders which can span * multiple volumes. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerQueryVolInt(HgfsSessionInfo *session, // IN: session info const char *fileName, // IN: cpName for the volume size_t fileNameLength, // IN: cpName length uint32 caseFlags, // IN: case sensitive/insensitive name uint64 *freeBytes, // OUT: free space in bytes uint64 *totalBytes) // OUT: capacity in bytes { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; uint64 outFreeBytes = 0; uint64 outTotalBytes = 0; char *utf8Name = NULL; size_t utf8NameLen; HgfsNameStatus nameStatus; HgfsShareInfo shareInfo; VolumeInfoType infoType; /* * XXX - make the filename const! * It is now safe to read the file name field. */ nameStatus = HgfsServerGetLocalNameInfo(fileName, fileNameLength, caseFlags, &shareInfo, &utf8Name, &utf8NameLen); /* Check if we have a real path and if so handle it here. */ if (nameStatus == HGFS_NAME_STATUS_COMPLETE) { Bool success; ASSERT(utf8Name); LOG(4,("%s: querying path %s\n", __FUNCTION__, utf8Name)); success = HgfsServerStatFs(utf8Name, utf8NameLen, &outFreeBytes, &outTotalBytes); free(utf8Name); if (!success) { LOG(4, ("%s: error getting volume information\n", __FUNCTION__)); status = HGFS_ERROR_IO; } goto exit; } /* * If we're outside the Tools, find out if we're to compute the minimum * values across all shares, or the maximum values. */ infoType = VOLUME_INFO_TYPE_MIN; /* We have a virtual folder path and if so pass it over to the platform code. */ if (0 == (gHgfsCfgSettings.flags & HGFS_CONFIG_VOL_INFO_MIN)) { /* Using the maximum volume size and space values. */ infoType = VOLUME_INFO_TYPE_MAX; } status = HgfsPlatformVDirStatsFs(session, nameStatus, infoType, &outFreeBytes, &outTotalBytes); exit: *freeBytes = outFreeBytes; *totalBytes = outTotalBytes; LOG(4, ("%s: return %"FMT64"u bytes Free %"FMT64"u bytes\n", __FUNCTION__, outTotalBytes, outFreeBytes)); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerQueryVolume -- * * Handle a Query Volume request. * * Right now we only handle the volume space request. Call Wiper library * to get the volume information. * It is possible that shared folders can belong to different volumes on * the server. If this is the case, default to return the space information * of the volume that has the least amount of the available space, but it's * configurable with a config option (tools.hgfs.volumeInfoType). 2 possible * options, min and max. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerQueryVolume(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status; size_t replyPayloadSize = 0; HgfsHandle file; const char *fileName; size_t fileNameLength; uint32 caseFlags; Bool useHandle; uint64 freeBytes; uint64 totalBytes; HGFS_ASSERT_INPUT(input); if (HgfsUnpackQueryVolumeRequest(input->payload, input->payloadSize, input->op, &useHandle, &fileName, &fileNameLength, &caseFlags, &file)) { /* * We don't yet support file handle for this operation. * Clients should retry using the file name. */ if (useHandle) { LOG(4, ("%s: Doesn't support file handle.\n", __FUNCTION__)); status = HGFS_ERROR_INVALID_PARAMETER; } else { status = HgfsServerQueryVolInt(input->session, fileName, fileNameLength, caseFlags, &freeBytes, &totalBytes); if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackQueryVolumeReply(input->packet, input->request, input->op, freeBytes, totalBytes, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsSymlinkCreate -- * * Platform independent function that verifies whether symbolic link creation * is allowed for the specific shared folder and then calls platform specific * HgfsPlatformSymlinkCreate to do the actual job. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsSymlinkCreate(HgfsSessionInfo *session, // IN: session info, const char *srcFileName, // IN: symbolic link file name uint32 srcFileNameLength, // IN: symbolic link name length uint32 srcCaseFlags, // IN: symlink case flags const char *trgFileName, // IN: symbolic link target name uint32 trgFileNameLength, // IN: target name length uint32 trgCaseFlags) // IN: target case flags { HgfsShareInfo shareInfo; HgfsInternalStatus status = 0; HgfsNameStatus nameStatus; HgfsShareOptions configOptions; char *localSymlinkName = NULL; size_t localSymlinkNameLen; char localTargetName[HGFS_PACKET_MAX]; /* * It is now safe to read the symlink file name and the * "targetName" field */ nameStatus = HgfsServerGetLocalNameInfo(srcFileName, srcFileNameLength, srcCaseFlags, &shareInfo, &localSymlinkName, &localSymlinkNameLen); if (nameStatus == HGFS_NAME_STATUS_COMPLETE) { if (shareInfo.writePermissions ) { /* Get the config options. */ nameStatus = HgfsServerPolicy_GetShareOptions(srcFileName, srcFileNameLength, &configOptions); if (nameStatus == HGFS_NAME_STATUS_COMPLETE) { /* Prohibit symlink ceation if symlink following is enabled. */ if (HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS)) { status = HGFS_ERROR_ACCESS_DENIED; } } else { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, srcFileName)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } else { status = HgfsPlatformFileExists(localSymlinkName); if (status != 0) { if (status == HGFS_ERROR_FILE_NOT_FOUND) { status = HGFS_ERROR_ACCESS_DENIED; } } else { status = HGFS_ERROR_FILE_EXIST; } LOG(4, ("%s: failed access check, error %d\n", __FUNCTION__, status)); } } else { LOG(4, ("%s: symlink name access check failed\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } if (HGFS_ERROR_SUCCESS == status) { /* Convert from CPName-lite to normal and NUL-terminate. */ memcpy(localTargetName, trgFileName, trgFileNameLength); CPNameLite_ConvertFrom(localTargetName, trgFileNameLength, DIRSEPC); localTargetName[trgFileNameLength] = '\0'; status = HgfsPlatformSymlinkCreate(localSymlinkName, localTargetName); } free(localSymlinkName); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerSymlinkCreate -- * * Handle a SymlinkCreate request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSymlinkCreate(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status; HgfsHandle srcFile; const char *srcFileName; size_t srcFileNameLength; uint32 srcCaseFlags; Bool srcUseHandle; HgfsHandle trgFile; const char *trgFileName; size_t trgFileNameLength; uint32 trgCaseFlags; Bool trgUseHandle; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackSymlinkCreateRequest(input->payload, input->payloadSize, input->op, &srcUseHandle, &srcFileName, &srcFileNameLength, &srcCaseFlags, &srcFile, &trgUseHandle, &trgFileName, &trgFileNameLength, &trgCaseFlags, &trgFile)) { /* * We don't yet support file handle for this operation. * Clients should retry using the file name. */ if (srcUseHandle || trgUseHandle) { LOG(4, ("%s: Doesn't support file handle.\n", __FUNCTION__)); status = HGFS_ERROR_INVALID_PARAMETER; } else { status = HgfsSymlinkCreate(input->session, srcFileName, srcFileNameLength, srcCaseFlags, trgFileName, trgFileNameLength, trgCaseFlags); if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackSymlinkCreateReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerSearchOpen -- * * Handle a search open request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSearchOpen(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status; size_t replyPayloadSize = 0; const char *dirName; size_t dirNameLength; uint32 caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; HgfsHandle search; HgfsNameStatus nameStatus; HgfsShareInfo shareInfo; char *baseDir = NULL; size_t baseDirLen; HGFS_ASSERT_INPUT(input); if (HgfsUnpackSearchOpenRequest(input->payload, input->payloadSize, input->op, &dirName, &dirNameLength, &caseFlags)) { nameStatus = HgfsServerGetLocalNameInfo(dirName, dirNameLength, caseFlags, &shareInfo, &baseDir, &baseDirLen); status = HgfsPlatformSearchDir(nameStatus, dirName, dirNameLength, caseFlags, &shareInfo, baseDir, baseDirLen, input->session, &search); if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackSearchOpenReply(input->packet, input->request, input->op, search, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); free(baseDir); } /* *----------------------------------------------------------------------------- * * HgfsValidateRenameFile -- * * Validates if the file can can participate in rename process either as * as a source or as a target. * * Results: * HGFS_ERROR_SUCCESS if rename operation is allowed. * Appropriate error code otherwise. * * Side effects: * Allcates locaFileName which must be freed by the caller. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsValidateRenameFile(Bool useHandle, // IN: HgfsHandle fileHandle, // IN: const char *cpName, // IN: size_t cpNameLength, // IN: uint32 caseFlags, // IN: HgfsSessionInfo *session, // IN: Session info fileDesc* descr, // OUT: HgfsShareInfo *shareInfo, // OUT: char **localFileName, // OUT: size_t *localNameLength) // OUT: { HgfsInternalStatus status; Bool sharedFolderOpen = FALSE; HgfsLockType serverLock = HGFS_LOCK_NONE; HgfsNameStatus nameStatus; if (useHandle) { status = HgfsPlatformGetFd(fileHandle, session, FALSE, descr); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: could not map cached handle %d, error %u\n", __FUNCTION__, fileHandle, status)); } else if (!HgfsHandle2FileNameMode(fileHandle, session, &shareInfo->writePermissions, &shareInfo->readPermissions, localFileName, localNameLength)) { /* * HgfsPlatformRename requires valid source file name even when file handle * is specified. * Also the name will be required to update the nodes on a successful * rename operation. */ LOG(4, ("%s: could not get file name for fd %d\n", __FUNCTION__, *descr)); status = HGFS_ERROR_INVALID_HANDLE; } else if (HgfsHandleIsSharedFolderOpen(fileHandle, session, &sharedFolderOpen) && sharedFolderOpen) { LOG(4, ("%s: Cannot rename shared folder\n", __FUNCTION__)); status = HGFS_ERROR_ACCESS_DENIED; } } else { nameStatus = HgfsServerGetLocalNameInfo(cpName, cpNameLength, caseFlags, shareInfo, localFileName, localNameLength); if (HGFS_NAME_STATUS_COMPLETE != nameStatus) { LOG(4, ("%s: access check failed\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } else if (HgfsServerIsSharedFolderOnly(cpName, cpNameLength)) { /* Guest OS is not allowed to rename shared folder. */ LOG(4, ("%s: Cannot rename shared folder\n", __FUNCTION__)); status = HGFS_ERROR_ACCESS_DENIED; } else { status = HGFS_ERROR_SUCCESS; } } ASSERT(*localFileName != NULL || HGFS_ERROR_SUCCESS != status); if (HGFS_ERROR_SUCCESS == status) { if (HgfsFileHasServerLock(*localFileName, session, &serverLock, descr)) { /* * XXX: Before renaming the file, check to see if we are holding * an oplock on both the old and new files. If one of them is oplocked, and * we commence with the rename, we'll trigger an oplock break that'll * deadlock us. The client should be smart enough to break necessary oplocks * on the source and target files before calling rename, so we'll return * an error. */ LOG (4, ("%s: File has an outstanding oplock. Client " "should remove this oplock and try again.\n", __FUNCTION__)); status = HGFS_ERROR_PATH_BUSY; } } return status; } /* *----------------------------------------------------------------------------- * * HgfsServerRename -- * * Handle a Rename request. * * Simply converts the new and old names to local filenames, calls * platform specific function to rename/move the file, and returns an * appropriate response to the driver. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerRename(HgfsInputParam *input) // IN: Input params { char *utf8OldName = NULL; size_t utf8OldNameLen; char *utf8NewName = NULL; size_t utf8NewNameLen; const char *cpOldName; size_t cpOldNameLen; const char *cpNewName; size_t cpNewNameLen; HgfsInternalStatus status; fileDesc srcFileDesc; fileDesc targetFileDesc; HgfsHandle srcFile; HgfsHandle targetFile; HgfsRenameHint hints; uint32 oldCaseFlags; uint32 newCaseFlags; HgfsShareInfo shareInfo; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackRenameRequest(input->payload, input->payloadSize, input->op, &cpOldName, &cpOldNameLen, &cpNewName, &cpNewNameLen, &hints, &srcFile, &targetFile, &oldCaseFlags, &newCaseFlags)) { status = HgfsValidateRenameFile((hints & HGFS_RENAME_HINT_USE_SRCFILE_DESC) != 0, srcFile, cpOldName, cpOldNameLen, oldCaseFlags, input->session, &srcFileDesc, &shareInfo, &utf8OldName, &utf8OldNameLen); if (HGFS_ERROR_SUCCESS == status) { /* * Renaming a file requires both read and write permssions for the * original file. * However the error code must be different depending on the existence * of the file with the same name. */ if (!shareInfo.writePermissions || !shareInfo.readPermissions) { status = HgfsPlatformFileExists(utf8OldName); if (HGFS_ERROR_SUCCESS == status) { status = HGFS_ERROR_ACCESS_DENIED; } LOG(4, ("HgfsServerRename: failed access check, error %d\n", status)); } else { status = HgfsValidateRenameFile((hints & HGFS_RENAME_HINT_USE_TARGETFILE_DESC) != 0, targetFile, cpNewName, cpNewNameLen, newCaseFlags, input->session, &targetFileDesc, &shareInfo, &utf8NewName, &utf8NewNameLen); if (HGFS_ERROR_SUCCESS == status) { /* * Renaming a file requires both read and write permssions for * the target directory. * However the error code must be different depending on the existence * of the target directory - if the destination directory exists then * ERROR_ACCESS_DENIED should be returned regardless if the destination * file exists. */ if (!shareInfo.writePermissions || !shareInfo.readPermissions) { status = HgfsPlatformFileExists(utf8NewName); if (HGFS_ERROR_SUCCESS == status || HGFS_ERROR_FILE_NOT_FOUND == status) { status = HGFS_ERROR_ACCESS_DENIED; } LOG(4, ("HgfsServerRename: failed access check, error %d\n", status)); } } } } } else { status = HGFS_ERROR_PROTOCOL; } /* If all pre-conditions are met go ahead with actual rename. */ if (HGFS_ERROR_SUCCESS == status) { status = HgfsPlatformRename(utf8OldName, srcFileDesc, utf8NewName, targetFileDesc, hints); if (HGFS_ERROR_SUCCESS == status) { /* Update all file nodes that refer to this file to contain the new name. */ HgfsUpdateNodeNames(utf8OldName, utf8NewName, input->session); if (!HgfsPackRenameReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } free(utf8OldName); free(utf8NewName); HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerCreateDir -- * * Handle a CreateDir request. * * Simply converts to the local filename, calls platform specific * code to create a directory, and returns an appropriate response to the driver. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerCreateDir(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status; HgfsNameStatus nameStatus; HgfsCreateDirInfo info; char *utf8Name = NULL; size_t utf8NameLen; size_t replyPayloadSize = 0; HgfsShareInfo shareInfo; HGFS_ASSERT_INPUT(input); if (HgfsUnpackCreateDirRequest(input->payload, input->payloadSize, input->op, &info)) { nameStatus = HgfsServerGetLocalNameInfo(info.cpName, info.cpNameSize, info.caseFlags, &shareInfo, &utf8Name, &utf8NameLen); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { ASSERT(utf8Name); LOG(4, ("%s: making dir \"%s\"", __FUNCTION__, utf8Name)); /* * For read-only shares we must never attempt to create a directory. * However the error code must be different depending on the existence * of the file with the same name. */ if (shareInfo.writePermissions) { status = HgfsPlatformCreateDir(&info, utf8Name); if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackCreateDirReply(input->packet, input->request, info.requestType, &replyPayloadSize, input->session)) { status = HGFS_ERROR_PROTOCOL; } } } else { status = HgfsPlatformFileExists(utf8Name); if (HGFS_ERROR_SUCCESS == status) { status = HGFS_ERROR_FILE_EXIST; } else if (HGFS_ERROR_FILE_NOT_FOUND == status) { status = HGFS_ERROR_ACCESS_DENIED; } } } else { /* * Check if the name does not exist - the share was not found. * Then it could one of two things: the share was removed/disabled; * or we could be in the root share itself and have a new name. * To return the correct error, if we are in the root share, * we must check the open mode too - creation of new files/folders * should fail access denied, for anything else "not found" is acceptable. */ if (nameStatus == HGFS_NAME_STATUS_DOES_NOT_EXIST) { if (HgfsServerIsSharedFolderOnly(info.cpName, info.cpNameSize)) { nameStatus = HGFS_NAME_STATUS_ACCESS_DENIED; LOG(4, ("%s: New file creation in share root not allowed\n", __FUNCTION__)); } else { LOG(4, ("%s: Shared folder not found\n", __FUNCTION__)); } } else { LOG(4, ("%s: Shared folder access error %u\n", __FUNCTION__, nameStatus)); } status = HgfsPlatformConvertFromNameStatus(nameStatus); } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); free(utf8Name); } /* *----------------------------------------------------------------------------- * * HgfsServerDeleteFile -- * * Handle a Delete File request. * * Simply converts to the local filename, calls DeleteFile on the * file or calls the Windows native API Delete, and returns an * appropriate response to the driver. * * Enforcing read-only shares restrictions * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerDeleteFile(HgfsInputParam *input) // IN: Input params { const char *cpName; size_t cpNameSize; HgfsLockType serverLock = HGFS_LOCK_NONE; fileDesc fileDesc; HgfsHandle file; HgfsDeleteHint hints = 0; HgfsInternalStatus status; HgfsNameStatus nameStatus; uint32 caseFlags; size_t replyPayloadSize = 0; HgfsShareInfo shareInfo; HGFS_ASSERT_INPUT(input); if (HgfsUnpackDeleteRequest(input->payload, input->payloadSize, input->op, &cpName, &cpNameSize, &hints, &file, &caseFlags)) { if (hints & HGFS_DELETE_HINT_USE_FILE_DESC) { status = HgfsPlatformDeleteFileByHandle(file, input->session); } else { char *utf8Name = NULL; size_t utf8NameLen; nameStatus = HgfsServerGetLocalNameInfo(cpName, cpNameSize, caseFlags, &shareInfo, &utf8Name, &utf8NameLen); if (nameStatus == HGFS_NAME_STATUS_COMPLETE) { /* * Deleting a file needs both read and write permssions. * However the error code must be different depending on the existence * of the file with the same name. */ if (!shareInfo.writePermissions || !shareInfo.readPermissions) { status = HgfsPlatformFileExists(utf8Name); if (HGFS_ERROR_SUCCESS == status) { status = HGFS_ERROR_ACCESS_DENIED; } LOG(4, ("HgfsServerDeleteFile: failed access check, error %d\n", status)); } else if (HgfsFileHasServerLock(utf8Name, input->session, &serverLock, &fileDesc)) { /* * XXX: If the file has an oplock, the client should have broken it on * its own by now. Sorry! */ LOG (4, ("%s: File has an outstanding oplock. Client should " "remove this oplock and try again.\n", __FUNCTION__)); status = HGFS_ERROR_PATH_BUSY; } else { LOG(4, ("%s: deleting \"%s\"\n", __FUNCTION__, utf8Name)); status = HgfsPlatformDeleteFileByName(utf8Name); } free(utf8Name); } else { LOG(4, ("%s: Shared folder does not exist.\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackDeleteReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerDeleteDir -- * * Handle a Delete Dir request. * * Simply converts to the local filename, calls RemoveDirectory on the * directory or Windows native API delete if we have a valid handle, * and returns an appropriate response to the driver. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerDeleteDir(HgfsInputParam *input) // IN: Input params { const char *cpName; size_t cpNameSize; HgfsInternalStatus status; HgfsNameStatus nameStatus; HgfsHandle file; HgfsDeleteHint hints = 0; fileDesc fileDesc; Bool sharedFolderOpen = FALSE; uint32 caseFlags; size_t replyPayloadSize = 0; HgfsShareInfo shareInfo; HGFS_ASSERT_INPUT(input); if (HgfsUnpackDeleteRequest(input->payload, input->payloadSize, input->op, &cpName, &cpNameSize, &hints, &file, &caseFlags)) { if (hints & HGFS_DELETE_HINT_USE_FILE_DESC) { status = HgfsPlatformGetFd(file, input->session, FALSE, &fileDesc); if (HGFS_ERROR_SUCCESS == status) { if (HgfsHandleIsSharedFolderOpen(file, input->session, &sharedFolderOpen) && sharedFolderOpen) { LOG(4, ("%s: Cannot delete shared folder\n", __FUNCTION__)); status = HGFS_ERROR_ACCESS_DENIED; } else { status = HgfsPlatformDeleteDirByHandle(file, input->session); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: error deleting directory %d: %d\n", __FUNCTION__, file, status)); } } } else { LOG(4, ("%s: could not map cached handle %u, error %u\n", __FUNCTION__, file, status)); } } else { char *utf8Name = NULL; size_t utf8NameLen; nameStatus = HgfsServerGetLocalNameInfo(cpName, cpNameSize, caseFlags, &shareInfo, &utf8Name, &utf8NameLen); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { ASSERT(utf8Name); /* Guest OS is not allowed to delete shared folder. */ if (HgfsServerIsSharedFolderOnly(cpName, cpNameSize)){ LOG(4, ("%s: Cannot delete shared folder\n", __FUNCTION__)); status = HGFS_ERROR_ACCESS_DENIED; } else if (!shareInfo.writePermissions || !shareInfo.readPermissions) { /* * Deleting a directory requires both read and write permissions. * However the error code must be different depending on the existence * of the file with the same name. */ status = HgfsPlatformFileExists(utf8Name); if (HGFS_ERROR_SUCCESS == status) { status = HGFS_ERROR_ACCESS_DENIED; } LOG(4, ("HgfsServerDeleteDir: failed access check, error %d\n", status)); } else { LOG(4, ("%s: removing \"%s\"\n", __FUNCTION__, utf8Name)); status = HgfsPlatformDeleteDirByName(utf8Name); } free(utf8Name); } else { LOG(4, ("%s: access check failed\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackDeleteReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerServerLockChange -- * * Called by the client when it wants to either acquire an oplock on a file * that was previously opened, or when it wants to release/downgrade an * oplock on a file that was previously oplocked. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerServerLockChange(HgfsInputParam *input) // IN: Input params { HGFS_ASSERT_INPUT(input); HgfsServerCompleteRequest(HGFS_ERROR_NOT_SUPPORTED, 0, input); } /* *----------------------------------------------------------------------------- * * HgfsServerWriteWin32Stream -- * * Handle a write request in the WIN32_STREAM_ID format. * * Results: * ERROR_SUCCESS or an appropriate Win32 error code. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerWriteWin32Stream(HgfsInputParam *input) // IN: Input params { uint32 actualSize; HgfsInternalStatus status; HgfsHandle file; const char *dataToWrite; Bool doSecurity; size_t replyPayloadSize = 0; size_t requiredSize; HGFS_ASSERT_INPUT(input); if (HgfsUnpackWriteWin32StreamRequest(input->payload, input->payloadSize, input->op, &file, &dataToWrite, &requiredSize, &doSecurity)) { status = HgfsPlatformWriteWin32Stream(file, (char *)dataToWrite, (uint32)requiredSize, doSecurity, &actualSize, input->session); if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackWriteWin32StreamReply(input->packet, input->request, input->op, actualSize, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerSetDirWatchByHandle -- * * Sets directory notification watch request using directory handle. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerSetDirWatchByHandle(HgfsInputParam *input, // IN: Input params HgfsHandle dir, // IN: directory handle uint32 events, // IN: event types to report Bool watchTree, // IN: recursive watch HgfsSubscriberHandle *watchId) // OUT: watch id { HgfsInternalStatus status; char *fileName = NULL; size_t fileNameSize; HgfsSharedFolderHandle sharedFolder = HGFS_INVALID_FOLDER_HANDLE; LOG(8, ("%s: entered\n", __FUNCTION__)); ASSERT(watchId != NULL); if (HgfsHandle2NotifyInfo(dir, input->session, &fileName, &fileNameSize, &sharedFolder)) { LOG(4, ("%s: adding a subscriber on shared folder handle %#x\n", __FUNCTION__, sharedFolder)); *watchId = HgfsNotify_AddSubscriber(sharedFolder, fileName, events, watchTree, HgfsServerDirWatchEvent, input->session); status = (HGFS_INVALID_SUBSCRIBER_HANDLE == *watchId) ? HGFS_ERROR_INTERNAL : HGFS_ERROR_SUCCESS; LOG(4, ("%s: result of add subscriber id %"FMT64"x status %u\n", __FUNCTION__, *watchId, status)); } else { status = HGFS_ERROR_INTERNAL; } free(fileName); LOG(8, ("%s: exit %u\n", __FUNCTION__, status)); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerSetDirWatchByName -- * * Sets directory notification watch request using directory name. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerSetDirWatchByName(HgfsInputParam *input, // IN: Input params const char *cpName, // IN: directory name uint32 cpNameSize, // IN: directory name length uint32 caseFlags, // IN: case flags uint32 events, // IN: event types to report Bool watchTree, // IN: recursive watch HgfsSubscriberHandle *watchId) // OUT: watch id { HgfsInternalStatus status; HgfsNameStatus nameStatus; char *utf8Name = NULL; size_t utf8NameLen; HgfsShareInfo shareInfo; HgfsSharedFolderHandle sharedFolder = HGFS_INVALID_FOLDER_HANDLE; ASSERT(cpName != NULL); ASSERT(watchId != NULL); LOG(8, ("%s: entered\n",__FUNCTION__)); nameStatus = HgfsServerGetLocalNameInfo(cpName, cpNameSize, caseFlags, &shareInfo, &utf8Name, &utf8NameLen); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { char const *inEnd = cpName + cpNameSize; char const *next; int len; ASSERT(utf8Name); /* * Get first component. */ len = CPName_GetComponent(cpName, inEnd, (char const **) &next); if (len < 0) { LOG(4, ("%s: get first component failed\n", __FUNCTION__)); nameStatus = HGFS_NAME_STATUS_FAILURE; } else if (0 == len) { /* See if we are dealing with the base of the namespace */ nameStatus = HGFS_NAME_STATUS_INCOMPLETE_BASE; } else { sharedFolder = HgfsServerGetShareHandle(cpName); } if (HGFS_NAME_STATUS_COMPLETE == nameStatus && HGFS_INVALID_FOLDER_HANDLE != sharedFolder) { if (cpNameSize > len + 1) { size_t nameSize = cpNameSize - len - 1; char tempBuf[HGFS_PATH_MAX]; char *tempPtr = tempBuf; size_t tempSize = sizeof tempBuf; nameStatus = CPName_ConvertFrom((char const **) &next, &nameSize, &tempSize, &tempPtr); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { LOG(8, ("%s: session %p id %"FMT64"x on share hnd %#x\n", __FUNCTION__, input->session, input->session->sessionId, sharedFolder)); *watchId = HgfsNotify_AddSubscriber(sharedFolder, tempBuf, events, watchTree, HgfsServerDirWatchEvent, input->session); status = (HGFS_INVALID_SUBSCRIBER_HANDLE == *watchId) ? HGFS_ERROR_INTERNAL : HGFS_ERROR_SUCCESS; LOG(8, ("%s: watchId %"FMT64"x result %u\n", __FUNCTION__, *watchId, status)); } else { LOG(4, ("%s: Conversion to platform specific name failed\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } else { LOG(8, ("%s: adding subscriber on share hnd %#x\n", __FUNCTION__, sharedFolder)); *watchId = HgfsNotify_AddSubscriber(sharedFolder, "", events, watchTree, HgfsServerDirWatchEvent, input->session); status = (HGFS_INVALID_SUBSCRIBER_HANDLE == *watchId) ? HGFS_ERROR_INTERNAL : HGFS_ERROR_SUCCESS; LOG(8, ("%s: adding subscriber on share hnd %#x result %u\n", __FUNCTION__, sharedFolder, status)); } } else if (HGFS_NAME_STATUS_INCOMPLETE_BASE == nameStatus) { LOG(4, ("%s: Notification for root share is not supported yet\n", __FUNCTION__)); status = HGFS_ERROR_INVALID_PARAMETER; } else { LOG(4, ("%s: file not found.\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } else { LOG(4, ("%s: file not found.\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } free(utf8Name); LOG(8, ("%s: exit %u\n",__FUNCTION__, status)); return status; } /* *----------------------------------------------------------------------------- * * HgfsServerSetDirNotifyWatch -- * * Handle a set directory notification watch request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSetDirNotifyWatch(HgfsInputParam *input) // IN: Input params { const char *cpName; size_t cpNameSize; HgfsInternalStatus status; HgfsHandle dir; uint32 caseFlags; size_t replyPayloadSize = 0; uint32 flags; uint32 events; HgfsSubscriberHandle watchId = HGFS_INVALID_SUBSCRIBER_HANDLE; Bool useHandle; HGFS_ASSERT_INPUT(input); LOG(8, ("%s: entered\n", __FUNCTION__)); /* * If the active session does not support directory change notification - bail out * with an error immediately. * Clients are expected to check the session capabilities and flags but a malicious * or broken client could still issue this to us. */ if (0 == (input->session->flags & HGFS_SESSION_CHANGENOTIFY_ENABLED)) { HgfsServerCompleteRequest(HGFS_ERROR_PROTOCOL, 0, input); return; } if (HgfsUnpackSetWatchRequest(input->payload, input->payloadSize, input->op, &useHandle, &cpName, &cpNameSize, &flags, &events, &dir, &caseFlags)) { Bool watchTree = 0 != (flags & HGFS_NOTIFY_FLAG_WATCH_TREE); if (useHandle) { status = HgfsServerSetDirWatchByHandle(input, dir, events, watchTree, &watchId); } else { status = HgfsServerSetDirWatchByName(input, cpName, cpNameSize, caseFlags, events, watchTree, &watchId); } if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackSetWatchReply(input->packet, input->request, input->op, watchId, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); LOG(8, ("%s: exit %u\n", __FUNCTION__, status)); } /* *----------------------------------------------------------------------------- * * HgfsServerRemoveDirNotifyWatch -- * * Handle a remove directory notification watch request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerRemoveDirNotifyWatch(HgfsInputParam *input) // IN: Input params { HgfsSubscriberHandle watchId; HgfsInternalStatus status; size_t replyPayloadSize = 0; LOG(8, ("%s: entered\n", __FUNCTION__)); HGFS_ASSERT_INPUT(input); /* * If the active session does not support directory change notification - bail out * with an error immediately. * Clients are expected to check the session capabilities and flags but a malicious * or broken client could still issue this to us. */ if (0 == (input->session->flags & HGFS_SESSION_CHANGENOTIFY_ENABLED)) { HgfsServerCompleteRequest(HGFS_ERROR_PROTOCOL, 0, input); return; } if (HgfsUnpackRemoveWatchRequest(input->payload, input->payloadSize, input->op, &watchId)) { LOG(8, ("%s: remove subscriber on subscr id %"FMT64"x\n", __FUNCTION__, watchId)); if (HgfsNotify_RemoveSubscriber(watchId)) { status = HGFS_ERROR_SUCCESS; } else { status = HGFS_ERROR_INTERNAL; } LOG(8, ("%s: remove subscriber on subscr id %"FMT64"x result %u\n", __FUNCTION__, watchId, status)); } else { status = HGFS_ERROR_PROTOCOL; } if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackRemoveWatchReply(input->packet, input->request, input->op, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } HgfsServerCompleteRequest(status, replyPayloadSize, input); LOG(8, ("%s: exit result %u\n", __FUNCTION__, status)); } /* *----------------------------------------------------------------------------- * * HgfsServerGetattr -- * * Handle a Getattr request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerGetattr(HgfsInputParam *input) // IN: Input params { char *localName = NULL; HgfsAttrHint hints = 0; HgfsFileAttrInfo attr; HgfsInternalStatus status = 0; HgfsNameStatus nameStatus; const char *cpName; size_t cpNameSize; char *targetName = NULL; uint32 targetNameLen = 0; HgfsHandle file; /* file handle from driver */ uint32 caseFlags = 0; HgfsShareOptions configOptions; size_t localNameLen; HgfsShareInfo shareInfo; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackGetattrRequest(input->payload, input->payloadSize, input->op, &attr, &hints, &cpName, &cpNameSize, &file, &caseFlags)) { /* Client wants us to reuse an existing handle. */ if (hints & HGFS_ATTR_HINT_USE_FILE_DESC) { fileDesc fd; targetNameLen = 0; status = HgfsPlatformGetFd(file, input->session, FALSE, &fd); if (HGFS_ERROR_SUCCESS == status) { status = HgfsPlatformGetattrFromFd(fd, input->session, &attr); } else { LOG(4, ("%s: Could not get file descriptor\n", __FUNCTION__)); } } else { /* * Depending on whether this file/dir is real or virtual, either * forge its attributes or look them up in the actual filesystem. */ nameStatus = HgfsServerGetLocalNameInfo(cpName, cpNameSize, caseFlags, &shareInfo, &localName, &localNameLen); switch (nameStatus) { case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* * This is the base of our namespace; make up fake status for * this directory. */ LOG(4, ("%s: getting attrs for base dir\n", __FUNCTION__)); HgfsPlatformGetDefaultDirAttrs(&attr); break; case HGFS_NAME_STATUS_COMPLETE: /* This is a regular lookup; proceed as usual */ ASSERT(localName); /* Get the config options. */ nameStatus = HgfsServerPolicy_GetShareOptions(cpName, cpNameSize, &configOptions); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { status = HgfsPlatformGetattrFromName(localName, configOptions, (char *)cpName, &attr, &targetName); } else { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, cpName)); status = HGFS_ERROR_FILE_NOT_FOUND; } if (HGFS_ERROR_SUCCESS == status && !HgfsServerPolicy_CheckMode(HGFS_OPEN_MODE_READ_ONLY, shareInfo.writePermissions, shareInfo.readPermissions)) { status = HGFS_ERROR_ACCESS_DENIED; } else if (status != HGFS_ERROR_SUCCESS) { /* * If it is a dangling share server should not return * HGFS_ERROR_FILE_NOT_FOUND * to the client because it causes confusion: a name that is returned * by directory enumeration should not produce "name not found" * error. * Replace it with a more appropriate error code: no such device. */ if (status == HGFS_ERROR_FILE_NOT_FOUND && HgfsIsShareRoot(cpName, cpNameSize)) { status = HGFS_ERROR_IO; } } break; default: status = HgfsPlatformHandleIncompleteName(nameStatus, &attr); } targetNameLen = targetName ? strlen(targetName) : 0; } if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackGetattrReply(input->packet, input->request, &attr, targetName, targetNameLen, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } free(targetName); free(localName); HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerSetattr -- * * Handle a Setattr request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSetattr(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; HgfsNameStatus nameStatus; HgfsFileAttrInfo attr; const char *cpName; size_t cpNameSize = 0; HgfsAttrHint hints = 0; HgfsOpenMode shareMode; uint32 caseFlags = 0; HgfsShareInfo shareInfo; HgfsHandle file; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackSetattrRequest(input->payload, input->payloadSize, input->op, &attr, &hints, &cpName, &cpNameSize, &file, &caseFlags)) { Bool useHostTime = 0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_USE_HOST_TIME); /* Client wants us to reuse an existing handle. */ if (hints & HGFS_ATTR_HINT_USE_FILE_DESC) { if (HgfsHandle2ShareMode(file, input->session, &shareMode)) { if (HGFS_OPEN_MODE_READ_ONLY != shareMode) { status = HgfsPlatformSetattrFromFd(file, input->session, &attr, hints, useHostTime); } else { status = HGFS_ERROR_ACCESS_DENIED; } } else { LOG(4, ("%s: could not get share mode fd %d\n", __FUNCTION__, file)); status = HGFS_ERROR_INVALID_HANDLE; } } else { /* Client wants us to open a new handle for this operation. */ char *utf8Name = NULL; size_t utf8NameLen; nameStatus = HgfsServerGetLocalNameInfo(cpName, cpNameSize, caseFlags, &shareInfo, &utf8Name, &utf8NameLen); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { fileDesc hFile; HgfsLockType serverLock = HGFS_LOCK_NONE; HgfsShareOptions configOptions; /* * XXX: If the client has an oplock on this file, it must reuse the * handle for the oplocked node (or break the oplock) prior to making * a setattr request. Fail this request. */ if (!HgfsServerPolicy_CheckMode(HGFS_OPEN_MODE_WRITE_ONLY, shareInfo.writePermissions, shareInfo.readPermissions)) { status = HGFS_ERROR_ACCESS_DENIED; } else if (HGFS_NAME_STATUS_COMPLETE != HgfsServerPolicy_GetShareOptions(cpName, cpNameSize, &configOptions)) { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, cpName)); status = HGFS_ERROR_FILE_NOT_FOUND; } else if (HgfsFileHasServerLock(utf8Name, input->session, &serverLock, &hFile)) { LOG(4, ("%s: An open, oplocked handle exists for " "this file. The client should retry with that handle\n", __FUNCTION__)); status = HGFS_ERROR_PATH_BUSY; } else { status = HgfsPlatformSetattrFromName(utf8Name, &attr, configOptions, hints, useHostTime); } free(utf8Name); } else { LOG(4, ("%s: file not found.\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } if (HGFS_ERROR_SUCCESS == status) { if (!HgfsPackSetattrReply(input->packet, input->request, attr.requestType, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerValidateOpenParameters -- * * Performs sanity check of the input parameters. * * Results: * HGFS_ERROR_SUCCESS if the parameters are valid. * Appropriate error code otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsServerValidateOpenParameters(HgfsFileOpenInfo *openInfo, // IN/OUT: openfile info Bool *denyCreatingFile, // OUT: No new files int *followSymlinks) // OUT: Host resolves link { size_t utf8NameLen; HgfsInternalStatus status; *followSymlinks = 0; *denyCreatingFile = FALSE; if ((openInfo->mask & HGFS_OPEN_VALID_MODE)) { HgfsNameStatus nameStatus; /* It is now safe to read the file name. */ nameStatus = HgfsServerGetLocalNameInfo(openInfo->cpName, openInfo->cpNameSize, openInfo->caseFlags, &openInfo->shareInfo, &openInfo->utf8Name, &utf8NameLen); if (HGFS_NAME_STATUS_COMPLETE == nameStatus) { if (openInfo->mask & HGFS_OPEN_VALID_FLAGS) { HgfsOpenFlags savedOpenFlags = openInfo->flags; if (HgfsServerCheckOpenFlagsForShare(openInfo, &openInfo->flags)) { HgfsShareOptions configOptions; /* Get the config options. */ nameStatus = HgfsServerPolicy_GetShareOptions(openInfo->cpName, openInfo->cpNameSize, &configOptions); if (nameStatus == HGFS_NAME_STATUS_COMPLETE) { *followSymlinks = HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS); *denyCreatingFile = savedOpenFlags != openInfo->flags; status = HGFS_ERROR_SUCCESS; } else { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, openInfo->cpName)); *denyCreatingFile = TRUE; status = HGFS_ERROR_FILE_NOT_FOUND; } } else { /* Incompatible open mode with share mode. */ status = HGFS_STATUS_ACCESS_DENIED; } } else { status = HGFS_ERROR_PROTOCOL; } } else { /* * Check if the name does not exist - the share was not found. * Then it could one of two things: the share was removed/disabled; * or we could be in the root share itself and have a new name. * To return the correct error, if we are in the root share, * we must check the open mode too - creation of new files/folders * should fail access denied, for anything else "not found" is acceptable. */ if (nameStatus == HGFS_NAME_STATUS_DOES_NOT_EXIST) { if ((openInfo->mask & HGFS_OPEN_VALID_FLAGS && (openInfo->flags == HGFS_OPEN_CREATE || openInfo->flags == HGFS_OPEN_CREATE_SAFE || openInfo->flags == HGFS_OPEN_CREATE_EMPTY)) && HgfsServerIsSharedFolderOnly(openInfo->cpName, openInfo->cpNameSize)) { nameStatus = HGFS_NAME_STATUS_ACCESS_DENIED; LOG(4, ("%s: New file creation in share root not allowed\n", __FUNCTION__)); } else { LOG(4, ("%s: Shared folder not found\n", __FUNCTION__)); } } else { LOG(4, ("%s: Shared folder access error %u\n", __FUNCTION__, nameStatus)); } status = HgfsPlatformConvertFromNameStatus(nameStatus); } } else { LOG(4, ("%s: filename or mode not provided\n", __FUNCTION__)); status = HGFS_ERROR_PROTOCOL; } return status; } /* *----------------------------------------------------------------------------- * * HgfsServerOpen -- * * Handle an Open request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerOpen(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status; fileDesc newHandle; HgfsLocalId localId; HgfsFileOpenInfo openInfo; fileDesc fileDesc; HgfsLockType serverLock = HGFS_LOCK_NONE; size_t replyPayloadSize = 0; HGFS_ASSERT_INPUT(input); if (HgfsUnpackOpenRequest(input->payload, input->payloadSize, input->op, &openInfo)) { int followSymlinks; Bool denyCreatingFile; status = HgfsServerValidateOpenParameters(&openInfo, &denyCreatingFile, &followSymlinks); if (HGFS_ERROR_SUCCESS == status) { ASSERT(openInfo.utf8Name); LOG(4, ("%s: opening \"%s\", mode %u, flags %u, perms %u%u%u%u attr %u\n", __FUNCTION__, openInfo.utf8Name, openInfo.mode, openInfo.mask & HGFS_OPEN_VALID_FLAGS ? openInfo.flags : 0, (openInfo.mask & HGFS_OPEN_VALID_SPECIAL_PERMS) ? openInfo.specialPerms : 0, (openInfo.mask & HGFS_OPEN_VALID_OWNER_PERMS) ? openInfo.ownerPerms : 0, (openInfo.mask & HGFS_OPEN_VALID_GROUP_PERMS) ? openInfo.groupPerms : 0, (openInfo.mask & HGFS_OPEN_VALID_OTHER_PERMS) ? openInfo.otherPerms : 0, openInfo.mask & HGFS_OPEN_VALID_FILE_ATTR ? (uint32)openInfo.attr : 0)); /* * XXX: Before opening the file, see if we already have this file opened on * the server with an oplock on it. If we do, we must fail the new open * request, otherwise we will trigger an oplock break that the guest cannot * handle at this time (since the HGFS server is running in the context of * the vcpu thread), and we'll deadlock. * * Until we overcome this limitation via Crosstalk, we will be extra smart * in the client drivers so as to prevent open requests on handles that * already have an oplock. And the server will protect itself like so. * * XXX: With some extra effort, we could allow a second open for read here, * since that won't break a shared oplock, but the clients should already * realize that the second open can be avoided via sharing handles, too. */ if (!HgfsFileHasServerLock(openInfo.utf8Name, input->session, &serverLock, &fileDesc)) { /* See if the name is valid, and if so add it and return the handle. */ status = HgfsPlatformValidateOpen(&openInfo, followSymlinks, input->session, &localId, &newHandle); if (status == HGFS_ERROR_SUCCESS) { ASSERT(newHandle >= 0); /* * Open succeeded, so make new node and return its handle. If we fail, * it's almost certainly an internal server error. */ if (HgfsCreateAndCacheFileNode(&openInfo, &localId, newHandle, FALSE, input->session)) { if (!HgfsPackOpenReply(input->packet, input->request, &openInfo, &replyPayloadSize, input->session)) { status = HGFS_ERROR_INTERNAL; } } } else if (denyCreatingFile && HGFS_ERROR_FILE_NOT_FOUND == status) { status = HGFS_ERROR_ACCESS_DENIED; } } else { status = HGFS_ERROR_PATH_BUSY; } free(openInfo.utf8Name); } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerSearchReadAttrToMask -- * * Sets a search read information mask from the retrieved attribute * information. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerSearchReadAttrToMask(HgfsFileAttrInfo *attr, // IN/OUT: attributes for entry HgfsSearchReadMask *mask) // IN/OUT: what info is required/returned { if (0 != (attr->mask & HGFS_ATTR_VALID_TYPE)) { *mask |= (HGFS_SEARCH_READ_FILE_NODE_TYPE); } if (0 != (attr->mask & HGFS_ATTR_VALID_SIZE)) { *mask |= (HGFS_SEARCH_READ_FILE_SIZE); } if (0 != (attr->mask & HGFS_ATTR_VALID_ALLOCATION_SIZE)) { *mask |= (HGFS_SEARCH_READ_ALLOCATION_SIZE); } if (0 != (attr->mask & (HGFS_ATTR_VALID_CREATE_TIME | HGFS_ATTR_VALID_ACCESS_TIME | HGFS_ATTR_VALID_WRITE_TIME | HGFS_ATTR_VALID_CHANGE_TIME))) { *mask |= (HGFS_SEARCH_READ_TIME_STAMP); } if (0 != (attr->mask & (HGFS_ATTR_VALID_FLAGS | HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | HGFS_ATTR_VALID_OTHER_PERMS))) { Bool isReadOnly = TRUE; *mask |= (HGFS_SEARCH_READ_FILE_ATTRIBUTES); /* * For V4 we don't return the permissions as they are really not * used. Only used to see if the entry is read only. So set the * attribute flag if the entry is read only. */ if (attr->mask & HGFS_ATTR_VALID_OWNER_PERMS && attr->ownerPerms & HGFS_PERM_WRITE) { isReadOnly = FALSE; } if (attr->mask & HGFS_ATTR_VALID_GROUP_PERMS && attr->groupPerms & HGFS_PERM_WRITE) { isReadOnly = FALSE; } if (attr->mask & HGFS_ATTR_VALID_OTHER_PERMS && attr->otherPerms & HGFS_PERM_WRITE) { isReadOnly = FALSE; } if (isReadOnly) { attr->flags |= HGFS_ATTR_READONLY; attr->mask |= HGFS_ATTR_VALID_FLAGS; } } if (0 != (attr->mask & (HGFS_ATTR_VALID_FILEID | HGFS_ATTR_VALID_NON_STATIC_FILEID))) { *mask |= (HGFS_SEARCH_READ_FILE_ID); } } /* *----------------------------------------------------------------------------- * * HgfsGetDirEntry -- * * Gets a directory entry at specified index. * * Results: * A platform specific error or success. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsGetDirEntry(HgfsHandle hgfsSearchHandle, // IN: ID for search data HgfsSearch *search, // IN: search data HgfsShareOptions configOptions, // IN: share configuration settings HgfsSessionInfo *session, // IN: session we are called in HgfsSearchReadInfo *info, // IN/OUT: request details HgfsSearchReadEntry *entry, // OUT: directory entry Bool *moreEntries) // OUT: any more entries { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; struct DirectoryEntry *dent; HgfsSearchReadMask infoRetrieved; HgfsSearchReadMask infoRequested; HgfsFileAttrInfo *entryAttr; char **entryName; uint32 *entryNameLength; Bool getAttrs; uint32 requestedIndex; infoRequested = info->requestedMask; entryAttr = &entry->attr; entryName = &entry->name; entryNameLength = &entry->nameLength; requestedIndex = info->currentIndex; getAttrs = (0 != (infoRequested & (HGFS_SEARCH_READ_FILE_SIZE | HGFS_SEARCH_READ_ALLOCATION_SIZE | HGFS_SEARCH_READ_TIME_STAMP | HGFS_SEARCH_READ_FILE_ATTRIBUTES | HGFS_SEARCH_READ_FILE_ID | HGFS_SEARCH_READ_FILE_NODE_TYPE))); /* Clear out what we will return. */ infoRetrieved = 0; memset(entryAttr, 0, sizeof *entryAttr); *moreEntries = FALSE; *entryName = NULL; *entryNameLength = 0; status = HgfsServerGetDirEntry(hgfsSearchHandle, session, requestedIndex, FALSE, &dent); if (HGFS_ERROR_SUCCESS != status) { goto exit; } if (NULL == dent) { /* End of directory entries marker. */ info->replyFlags |= HGFS_SEARCH_READ_REPLY_FINAL_ENTRY; HgfsSearchSetReadAllEntries(hgfsSearchHandle, session); goto exit; } status = HgfsPlatformSetDirEntry(search, configOptions, session, dent, getAttrs, entryAttr, entryName, entryNameLength); if (HGFS_ERROR_SUCCESS != status) { goto exit; } if (getAttrs) { /* * Update the search read mask for the attributes information. */ HgfsServerSearchReadAttrToMask(entryAttr, &infoRetrieved); } infoRetrieved |= HGFS_SEARCH_READ_NAME; /* Update the entry fields for valid data and index for the dent. */ entry->mask = infoRetrieved; entry->fileIndex = requestedIndex; *moreEntries = TRUE; exit: free(dent); return status; } /* *----------------------------------------------------------------------------- * * HgfsDoSearchRead -- * * Gets all the directory entries that remain or as many that will * fit into the reply buffer from the specified index. Fill in the * reply with the records and complete the reply details. * * Results: * A platform specific error or success. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsDoSearchRead(HgfsHandle hgfsSearchHandle, // IN: ID for search data HgfsSearch *search, // IN: search data HgfsShareOptions configOptions, // IN: share configuration settings HgfsSessionInfo *session, // IN: session we are called in HgfsSearchReadInfo *info, // IN/OUT: request details size_t *replyHeaderSize, // OUT: reply info written size size_t *replyDirentSize) // OUT: reply dirent written size { HgfsSearchReadEntry entry; size_t bytesWritten = 0; size_t bytesRemaining = 0; char *currentSearchReadRecord = NULL; char *lastSearchReadRecord = NULL; Bool moreEntries = TRUE; HgfsInternalStatus status = HGFS_ERROR_SUCCESS; info->currentIndex = info->startIndex; *replyHeaderSize = 0; *replyDirentSize = 0; while (moreEntries) { size_t offsetInBuffer = ROUNDUP(*replyDirentSize, sizeof (uint64)); if (info->payloadSize <= offsetInBuffer) { break; } memset(&entry, 0, sizeof entry); currentSearchReadRecord = (char*)info->replyPayload + offsetInBuffer; bytesRemaining = info->payloadSize - offsetInBuffer; bytesWritten = 0; status = HgfsGetDirEntry(hgfsSearchHandle, search, configOptions, session, info, &entry, &moreEntries); if (HGFS_ERROR_SUCCESS != status) { /* Failed to retrieve an entry record, bail. */ break; } if (!HgfsPackSearchReadReplyRecord(info->requestType, &entry, bytesRemaining, lastSearchReadRecord, currentSearchReadRecord, &bytesWritten)) { /* * The current entry is too large to be contained in the reply. * If this is the first entry returned then we have an error. * Otherwise, we return success for what is already in the reply. */ if (0 == info->numberRecordsWritten) { status = HGFS_ERROR_INTERNAL; } moreEntries = FALSE; } if (NULL != entry.name) { free(entry.name); } if (HGFS_ERROR_SUCCESS != status) { /* Failed to pack any entry records, bail. */ break; } /* * Only count records actually written to the reply. * (The final, empty record is not written for all protocol versions.) */ if (0 < bytesWritten) { if (0 != (info->flags & HGFS_SEARCH_READ_SINGLE_ENTRY)) { moreEntries = FALSE; } *replyDirentSize = ROUNDUP(*replyDirentSize, sizeof (uint64)) + bytesWritten; lastSearchReadRecord = currentSearchReadRecord; info->currentIndex++; info->numberRecordsWritten++; } } /* Now pack the search read reply common reply part. */ if (HgfsPackSearchReadReplyHeader(info, &bytesWritten)) { /* The search read reply common reply part size was already done so should be 0. */ *replyHeaderSize = bytesWritten; } else { status = HGFS_ERROR_PROTOCOL; } return status; } /* *----------------------------------------------------------------------------- * * HgfsServerSearchRead -- * * Handle a "Search Read" request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerSearchRead(HgfsInputParam *input) // IN: Input params { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; HgfsNameStatus nameStatus; HgfsHandle hgfsSearchHandle; HgfsSearch search; HgfsShareOptions configOptions = 0; size_t replyInfoSize = 0; size_t replyDirentSize = 0; size_t replyPayloadSize = 0; size_t inlineDataSize = 0; size_t baseReplySize; HgfsSearchReadInfo info; HGFS_ASSERT_INPUT(input); memset(&info, 0, sizeof info); /* * For search read V4 we use the whole packet buffer available to pack * as many replies as can fit into that size. For all previous versions * only one record is going to be returned, so we allow the old packet * max for the reply. */ if (HgfsUnpackSearchReadRequest(input->payload, input->payloadSize, input->op, &info, &baseReplySize, &inlineDataSize, &hgfsSearchHandle)) { LOG(4, ("%s: read search #%u, offset %u\n", __FUNCTION__, hgfsSearchHandle, info.startIndex)); info.reply = HgfsAllocInitReply(input->packet, input->request, baseReplySize + inlineDataSize, input->session); if (inlineDataSize == 0) { info.replyPayload = HSPU_GetDataPacketBuf(input->packet, BUF_WRITEABLE, input->transportSession->channelCbTable); } else { info.replyPayload = (char *)info.reply + baseReplySize; } if (info.replyPayload == NULL) { LOG(4, ("%s: Op %d reply buffer failure\n", __FUNCTION__, input->op)); status = HGFS_ERROR_PROTOCOL; } else { if (HgfsGetSearchCopy(hgfsSearchHandle, input->session, &search)) { /* Get the config options. */ if (search.utf8ShareNameLen != 0) { nameStatus = HgfsServerPolicy_GetShareOptions(search.utf8ShareName, search.utf8ShareNameLen, &configOptions); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: no matching share: %s.\n", __FUNCTION__, search.utf8ShareName)); status = HGFS_ERROR_FILE_NOT_FOUND; } } else if (0 == info.startIndex) { Bool readAllEntries = FALSE; /* * Reading the first entry, we check if this is a second scan * of the directory. If so, in some cases we restart the scan * by refreshing the entries first. */ if (!HgfsSearchHasReadAllEntries(hgfsSearchHandle, input->session, &readAllEntries)) { status = HGFS_ERROR_INTERNAL; } if (readAllEntries) { /* * XXX - a hack that is now required until Fusion 5.0 end * of lifes see bug 710697. * The coder modified the server instead of the OS X client * for the shares directory refresh needed by OS X clients in * order to work around handles remaining open by Finder. * This was fixed CLN 1988575 in the OS X client for 5.0.2. * However, Fusion 4.0 and Fusion 5.0 tools will rely on this hack. * At least now it works correctly without breaking everything * else. */ status = HgfsPlatformRestartSearchDir(hgfsSearchHandle, input->session, search.type); } } if (HGFS_ERROR_SUCCESS == status) { status = HgfsDoSearchRead(hgfsSearchHandle, &search, configOptions, input->session, &info, &replyInfoSize, &replyDirentSize); } if (HGFS_ERROR_SUCCESS == status) { replyPayloadSize = replyInfoSize + ((inlineDataSize == 0) ? 0 : replyDirentSize); if (0 == inlineDataSize) { HSPU_SetDataPacketSize(input->packet, replyDirentSize); } } free(search.utf8Dir); free(search.utf8ShareName); } else { LOG(4, ("%s: handle %u is invalid\n", __FUNCTION__, hgfsSearchHandle)); status = HGFS_ERROR_INVALID_HANDLE; } } } else { status = HGFS_ERROR_PROTOCOL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerCreateSession -- * * Handle a "Create session" request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerCreateSession(HgfsInputParam *input) // IN: Input params { size_t replyPayloadSize = 0; HgfsCreateSessionInfo info; HgfsInternalStatus status; HGFS_ASSERT_INPUT(input); if (HgfsUnpackCreateSessionRequest(input->payload, input->payloadSize, input->op, &info)) { HgfsSessionInfo *session; LOG(4, ("%s: create session\n", __FUNCTION__)); if (!HgfsServerAllocateSession(input->transportSession, &session)) { status = HGFS_ERROR_NOT_ENOUGH_MEMORY; goto abort; } else { status = HgfsServerTransportAddSessionToList(input->transportSession, session); if (HGFS_ERROR_SUCCESS != status) { LOG(4, ("%s: Could not add session to the list.\n", __FUNCTION__)); HgfsServerSessionPut(session); goto abort; } } if (info.maxPacketSize < session->maxPacketSize) { session->maxPacketSize = info.maxPacketSize; } /* * If the server is enabled for processing oplocks and the client * is requesting to use them, then report back to the client oplocks * are enabled by propagating the session flag. */ if ((0 != (info.flags & HGFS_SESSION_OPLOCK_ENABLED)) && (0 != (gHgfsCfgSettings.flags & HGFS_CONFIG_OPLOCK_ENABLED))) { session->flags |= HGFS_SESSION_OPLOCK_ENABLED; } if (HgfsPackCreateSessionReply(input->packet, input->request, &replyPayloadSize, session)) { status = HGFS_ERROR_SUCCESS; } else { status = HGFS_ERROR_INTERNAL; } } else { status = HGFS_ERROR_PROTOCOL; } abort: HgfsServerCompleteRequest(status, replyPayloadSize, input); } /* *----------------------------------------------------------------------------- * * HgfsServerDestroySession -- * * Handle a "Destroy session" request. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerDestroySession(HgfsInputParam *input) // IN: Input params { HgfsTransportSessionInfo *transportSession; HgfsSessionInfo *session; size_t replyPayloadSize = 0; HgfsInternalStatus status; HGFS_ASSERT_INPUT(input); transportSession = input->transportSession; session = input->session; session->state = HGFS_SESSION_STATE_CLOSED; if (session->sessionId == transportSession->defaultSessionId) { transportSession->defaultSessionId = HGFS_INVALID_SESSION_ID; } /* * Remove the session from the list. By doing that, the refcount of * the session will be decremented. Later, we will be invoking * HgfsServerCompleteRequest which will decrement the session's * refcount and cleanup the session */ MXUser_AcquireExclLock(transportSession->sessionArrayLock); HgfsServerTransportRemoveSessionFromList(transportSession, session); MXUser_ReleaseExclLock(transportSession->sessionArrayLock); if (HgfsPackDestroySessionReply(input->packet, input->request, &replyPayloadSize, session)) { status = HGFS_ERROR_SUCCESS; } else { status = HGFS_ERROR_INTERNAL; } HgfsServerCompleteRequest(status, replyPayloadSize, input); HgfsServerSessionPut(session); } /* *----------------------------------------------------------------------------- * * HgfsServerGetTargetRelativePath -- * * Generates relative file path which need to be used a symbolic link * target which would generate target name defined in "target" if the path * to symbolic link file defined in the "source". * Both source and target parameters represent absolute paths. * * Results: * Allocated path that caller must free. * NULL if there is a low memory condition. * * Side effects: * None * *----------------------------------------------------------------------------- */ char* HgfsServerGetTargetRelativePath(const char* source, // IN: source file name const char* target) // IN: target file name { const char *relativeSource = source; const char *relativeTarget = target; const char* sourceSep; const char* targetSep; int level = 0; size_t targetSize; char *result; char *currentPosition; /* * First remove the part of the path which is common between source and * target */ while (*relativeSource != '\0' && *relativeTarget != '\0') { sourceSep = strchr(relativeSource, DIRSEPC); targetSep = strchr(relativeTarget, DIRSEPC); if (sourceSep == NULL || targetSep == NULL) { break; } if ((sourceSep - relativeSource) != (targetSep - relativeTarget)) { break; } if (strncmp(relativeSource, relativeTarget, (targetSep - relativeTarget)) != 0) { break; } relativeSource = sourceSep + 1; relativeTarget = targetSep + 1; }; /* * Find out how many directories deep the source file is from the common * part of the path. */ while(*relativeSource != '\0') { sourceSep = strchr(relativeSource, DIRSEPC); if (sourceSep != NULL) { /* Several consecutive separators mean only one level. */ while (*sourceSep == DIRSEPC) { sourceSep++; } if (*sourceSep != '\0') { level++; relativeSource = sourceSep; } else { break; } } else { break; } } /* * Consruct relative path by adding level number of "../" * to the relative target path. */ targetSize = level * HGFS_PARENT_DIR_LEN + strlen(relativeTarget) + sizeof '\0'; result = malloc(targetSize); currentPosition = result; if (result != NULL) { while (level != 0) { memcpy(currentPosition, HGFS_PARENT_DIR, HGFS_PARENT_DIR_LEN); level--; currentPosition += HGFS_PARENT_DIR_LEN; } memcpy(currentPosition, relativeTarget, strlen(relativeTarget) + sizeof '\0'); } return result; } /* *----------------------------------------------------------------------------- * * HgfsServerDirWatchEvent -- * * The callback is invoked by the file system change notification component * in response to a change event when the client has set at least one watch * on a directory. * * The function builds directory notification packet and queues it to be sent * to the client. It processes one notification at a time. Any consolidation of * packets is expected to occur at the transport layer. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerDirWatchEvent(HgfsSharedFolderHandle sharedFolder, // IN: shared folder HgfsSubscriberHandle subscriber, // IN: subsciber char* fileName, // IN: name of the file uint32 mask, // IN: event type struct HgfsSessionInfo *session) // IN: session info { HgfsPacket *packet = NULL; HgfsHeader *packetHeader = NULL; char *shareName = NULL; size_t shareNameLen; size_t sizeNeeded; uint32 notifyFlags; LOG(4, ("%s:Entered shr hnd %u hnd %"FMT64"x file %s mask %u\n", __FUNCTION__, sharedFolder, subscriber, fileName, mask)); if (session->state == HGFS_SESSION_STATE_CLOSED) { LOG(4, ("%s: session has been closed drop the notification %"FMT64"x\n", __FUNCTION__, session->sessionId)); goto exit; } if (!HgfsServerGetShareName(sharedFolder, &shareNameLen, &shareName)) { LOG(4, ("%s: failed to find shared folder for a handle %x\n", __FUNCTION__, sharedFolder)); goto exit; } sizeNeeded = HgfsPackCalculateNotificationSize(shareName, fileName); /* * Use a single buffer zero'd out, as the packet and metapacket have the same * lifespan which is ended at the send complete callback (HgfsServerSessionSendComplete). */ packet = Util_SafeCalloc(1, sizeof *packet + sizeNeeded); packetHeader = (HgfsHeader *)((char *)packet + sizeof *packet); /* * The buffer is zero'd out, so no need to set the following explicitly: * packet->metaPacketIsAllocated = FALSE; * packet->state &= ~HGFS_STATE_CLIENT_REQUEST; */ packet->metaPacketSize = sizeNeeded; packet->metaPacketDataSize = packet->metaPacketSize; packet->metaPacket = packetHeader; notifyFlags = 0; if (mask & HGFS_NOTIFY_EVENTS_DROPPED) { notifyFlags |= HGFS_NOTIFY_FLAG_OVERFLOW; } if (!HgfsPackChangeNotificationRequest(packetHeader, subscriber, shareName, fileName, mask, notifyFlags, session, &sizeNeeded)) { LOG(4, ("%s: failed to pack notification request\n", __FUNCTION__)); goto exit; } if (!HgfsPacketSend(packet, session->transportSession, 0)) { LOG(4, ("%s: failed to send notification to the host\n", __FUNCTION__)); goto exit; } /* The transport will call the server send complete callback to release the packets. */ packet = NULL; LOG(4, ("%s: Sent notify for: %u index: %"FMT64"u file name %s mask %x\n", __FUNCTION__, sharedFolder, subscriber, fileName, mask)); exit: if (shareName) { free(shareName); } if (packet) { free(packet); } } /* *----------------------------------------------------------------------------- * * HgfsIsShareRoot -- * * Checks if the cpName represents the root directory for a share. * Components in CPName format are separated by NUL characters. * CPName for the root of a share contains only one component thus * it does not have any embedded '\0' characters in the name. * * Results: * TRUE if it is the root directory, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsIsShareRoot(char const *cpName, // IN: name to test size_t cpNameSize) // IN: length of the name { size_t i; for (i = 0; i < cpNameSize; i++) { if (cpName[i] == '\0') { return FALSE; } } return TRUE; } /* * more testing */ #if 0 void TestNodeFreeList(void) { HgfsHandle array[10 * NUM_FILE_NODES]; HgfsFileNode *node; unsigned int i; printf("%s: begin >>>>>>>>>>>>>>>>>>>>>>>>>>>\n", __FUNCTION__); for (i = 0; i < sizeof array / sizeof array[0]; i++) { char tempName[20]; HgfsLocalId localId; Str_Sprintf(tempName, sizeof tempName, "name%u", i); printf("\nadding node with name: %s\n", tempName); localId.volumeId = 0; localId.fileId = i + 1000; node = HgfsAddNewFileNode(Util_SafeStrdup(tempName), &localId); array[i] = HgfsFileNode2Handle(node); } HgfsDumpAllNodes(); printf("done getting nodes, now freeing\n"); for (i = 0; i < sizeof array / sizeof array[0]; i++) { printf("removing node #%u\n", i); HgfsRemoveFileNode(&nodeArray[array[i]]); } HgfsDumpAllNodes(); printf("%s: end <<<<<<<<<<<<<<<<<<<<<<<<<< \n", __FUNCTION__); } void TestSearchFreeList(void) { HgfsHandle array[10 * NUM_SEARCHES]; HgfsSearch *search; unsigned int i; printf("%s: begin >>>>>>>>>>>>>>>>>>>>>>>>>>>\n", __FUNCTION__); for (i = 0; i < sizeof array / sizeof array[0]; i++) { char tempName[20]; Str_Sprintf(tempName, sizeof tempName, "baseDir%u", i); printf("\nadding search with baseDir: \"%s\"\n", tempName); search = HgfsAddNewSearch(Util_SafeStrdup(tempName)); array[i] = HgfsSearch2SearchHandle(search); } HgfsDumpAllSearches(); printf("done getting searches, now freeing\n"); for (i = 0; i < sizeof array / sizeof array[0]; i++) { printf("removing search #%u\n", i); HgfsRemoveSearch(&searchArray[array[i]]); } HgfsDumpAllSearches(); printf("%s: end <<<<<<<<<<<<<<<<<<<<<<<<<< \n", __FUNCTION__); } #endif open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerOplockLinux.c0000644000000000000000000002472012660700525023216 0ustar rootroot/********************************************************* * Copyright (C) 2012-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerOplockLinux.c -- * * HGFS server opportunistic lock support for the Linux platform. */ #include #include #include #include #include "vmware.h" #include "hgfsServerInt.h" #include "hgfsServerOplockInt.h" #ifdef HGFS_OPLOCKS # include # include "sig.h" #endif /* * Local data */ /* * Global data */ /* * Local functions */ #ifdef HGFS_OPLOCKS static void HgfsServerSigOplockBreak(int sigNum, siginfo_t *info, ucontext_t *u, void *clientData); #endif /* *----------------------------------------------------------------------------- * * HgfsPlatformOplockInit -- * * Set up any state needed to start Linux HGFS server oplock support. * * Results: * TRUE always. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsPlatformOplockInit(void) { #ifdef HGFS_OPLOCKS /* Register a signal handler to catch oplock break signals. */ Sig_Callback(SIGIO, SIG_SAFE, HgfsServerSigOplockBreak, NULL); #endif return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPlatformOplockDestroy -- * * Tear down any state used for Linux HGFS server. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsPlatformOplockDestroy(void) { #ifdef HGFS_OPLOCKS /* Tear down oplock state, so we no longer catch signals. */ Sig_Callback(SIGIO, SIG_NOHANDLER, NULL, NULL); #endif } /* *----------------------------------------------------------------------------- * * HgfsAcquireServerLock -- * * Acquire a lease for the open file. Typically we try and get the exact * lease desired, but if the client asked for HGFS_LOCK_OPPORTUNISTIC, we'll * take the "best" lease we can get. * * Results: * TRUE on success. serverLock contains the type of the lock acquired. * FALSE on failure. serverLock is HGFS_LOCK_NONE. * * XXX: This function has the potential to return per-platform error codes, * but since it is opportunistic by nature, it isn't necessary to do so. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsAcquireServerLock(fileDesc fileDesc, // IN: OS handle HgfsSessionInfo *session, // IN: session info HgfsLockType *serverLock) // IN/OUT: Oplock asked for/granted { #ifdef HGFS_OPLOCKS HgfsLockType desiredLock; int leaseType, error; ASSERT(serverLock); ASSERT(session); desiredLock = *serverLock; if (desiredLock == HGFS_LOCK_NONE) { return TRUE; } if (!HgfsIsServerLockAllowed(session)) { return FALSE; } /* * First tell the kernel which signal to send us. SIGIO is already the * default, but if we skip this step, we won't get the siginfo_t when * a lease break occurs. * * XXX: Do I need to do fcntl(fileDesc, F_SETOWN, getpid())? */ if (fcntl(fileDesc, F_SETSIG, SIGIO)) { error = errno; Log("%s: Could not set SIGIO as the desired lease break signal for " "fd %d: %s\n", __FUNCTION__, fileDesc, strerror(error)); return FALSE; } /* * If the client just wanted the best lock possible, start off with a write * lease and move down to a read lease if that was unavailable. */ if ((desiredLock == HGFS_LOCK_OPPORTUNISTIC) || (desiredLock == HGFS_LOCK_EXCLUSIVE)) { leaseType = F_WRLCK; } else if (desiredLock == HGFS_LOCK_SHARED) { leaseType = F_RDLCK; } else { LOG(4, ("%s: Unknown server lock\n", __FUNCTION__)); return FALSE; } if (fcntl(fileDesc, F_SETLEASE, leaseType)) { /* * If our client was opportunistic and we failed to get his lease because * someone else is already writing or reading to the file, try again with * a read lease. */ if (desiredLock == HGFS_LOCK_OPPORTUNISTIC && (errno == EAGAIN || errno == EACCES)) { leaseType = F_RDLCK; if (fcntl(fileDesc, F_SETLEASE, leaseType)) { error = errno; LOG(4, ("%s: Could not get any opportunistic lease for fd %d: %s\n", __FUNCTION__, fileDesc, strerror(error))); return FALSE; } } else { error = errno; LOG(4, ("%s: Could not get %s lease for fd %d: %s\n", __FUNCTION__, leaseType == F_WRLCK ? "write" : "read", fileDesc, strerror(errno))); return FALSE; } } /* Got a lease of some kind. */ LOG(4, ("%s: Got %s lease for fd %d\n", __FUNCTION__, leaseType == F_WRLCK ? "write" : "read", fileDesc)); *serverLock = leaseType == F_WRLCK ? HGFS_LOCK_EXCLUSIVE : HGFS_LOCK_SHARED; return TRUE; #else return FALSE; #endif } #ifdef HGFS_OPLOCKS /* *----------------------------------------------------------------------------- * * HgfsAckOplockBreak -- * * Platform-dependent implementation of oplock break acknowledgement. * This function gets called when the oplock break rpc command is completed. * The rpc oplock break command (HgfsServerOplockBreak) is in hgfsServer.c * * On Linux, we use fcntl() to downgrade the lease. Then we update the node * cache, free the clientData, and call it a day. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsAckOplockBreak(ServerLockData *lockData, // IN: server lock info HgfsLockType replyLock) // IN: client has this lock { int fileDesc, newLock; HgfsLockType actualLock; ASSERT(lockData); fileDesc = lockData->fileDesc; LOG(4, ("%s: Acknowledging break on fd %d\n", __FUNCTION__, fileDesc)); /* * The Linux server supports lock downgrading. We only downgrade to a shared * lock if our previous call to fcntl() said we could, and if the client * wants to downgrade to a shared lock. Otherwise, we break altogether. */ if (lockData->serverLock == HGFS_LOCK_SHARED && replyLock == HGFS_LOCK_SHARED) { newLock = F_RDLCK; actualLock = replyLock; } else { newLock = F_UNLCK; actualLock = HGFS_LOCK_NONE; } /* Downgrade or acknowledge the break altogether. */ if (fcntl(fileDesc, F_SETLEASE, newLock) == -1) { int error = errno; Log("%s: Could not break lease on fd %d: %s\n", __FUNCTION__, fileDesc, strerror(error)); } /* Cleanup. */ HgfsUpdateNodeServerLock(fileDesc, actualLock); free(lockData); } /* *----------------------------------------------------------------------------- * * HgfsServerSigOplockBreak -- * * Handle a pending oplock break. Called from the VMX poll loop context. * All we really do is set up the state for an oplock break and call * HgfsServerOplockBreak which will do the rest of the work. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void HgfsServerSigOplockBreak(int sigNum, // IN: Signal number siginfo_t *info, // IN: Additional info about signal ucontext_t *u, // IN: Interrupted context (regs etc) void *clientData) // IN: Ignored { ServerLockData *lockData; int newLease, fd; HgfsLockType newServerLock; ASSERT(sigNum == SIGIO); ASSERT(info); ASSERT(clientData == NULL); fd = info->si_fd; LOG(4, ("%s: Received SIGIO for fd %d\n", __FUNCTION__, fd)); /* * We've got all we need from the signal handler, let it continue handling * signals of this type. */ Sig_Continue(sigNum); /* * According to locks.c in kernel source, doing F_GETLEASE when a lease * break is pending will return the new lease we should use. It'll be * F_RDLCK if we can downgrade, or F_UNLCK if we should break altogether. */ newLease = fcntl(fd, F_GETLEASE); if (newLease == F_RDLCK) { newServerLock = HGFS_LOCK_SHARED; } else if (newLease == F_UNLCK) { newServerLock = HGFS_LOCK_NONE; } else if (newLease == -1) { int error = errno; Log("%s: Could not get old lease for fd %d: %s\n", __FUNCTION__, fd, strerror(error)); goto error; } else { Log("%s: Unexpected reply to get lease for fd %d: %d\n", __FUNCTION__, fd, newLease); goto error; } /* * Setup a ServerLockData struct so that we can make use of * HgfsServerOplockBreak which does the heavy lifting of discovering which * HGFS handle we're interested in breaking, sending the break, receiving * the acknowledgement, and firing the platform-specific acknowledgement * function (where we'll downgrade the lease). */ lockData = malloc(sizeof *lockData); if (lockData) { lockData->fileDesc = fd; lockData->serverLock = newServerLock; lockData->event = 0; // not needed /* * Relinquish control of this data. It'll get freed later, when the RPC * command completes. */ HgfsServerOplockBreak(lockData); return; } else { Log("%s: Could not allocate memory for lease break on behalf of fd %d\n", __FUNCTION__, fd); } error: /* Clean up as best we can. */ fcntl(fd, F_SETLEASE, F_UNLCK); HgfsUpdateNodeServerLock(fd, HGFS_LOCK_NONE); } #endif /* HGFS_OPLOCKS */ open-vm-tools-10.0.7-3227872/lib/hgfsServer/Makefile.am0000644000000000000000000000253412660700525020577 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libHgfsServer.la libHgfsServer_la_SOURCES = libHgfsServer_la_SOURCES += hgfsServer.c libHgfsServer_la_SOURCES += hgfsServerLinux.c libHgfsServer_la_SOURCES += hgfsServerPacketUtil.c libHgfsServer_la_SOURCES += hgfsDirNotifyStub.c libHgfsServer_la_SOURCES += hgfsServerParameters.c libHgfsServer_la_SOURCES += hgfsServerOplock.c libHgfsServer_la_SOURCES += hgfsServerOplockLinux.c AM_CFLAGS = AM_CFLAGS += -DVMTOOLS_USE_GLIB AM_CFLAGS += @GLIB2_CPPFLAGS@ open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsDirNotify.h0000644000000000000000000000637412660700525021501 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _HGFS_DIRNOTIFY_H #define _HGFS_DIRNOTIFY_H /* * hgfsDirNotify.h -- * * Function definitions for directory change notification. */ #include "hgfsServer.h" // for HgfsSharedFolderHandle #include "hgfsProto.h" // for HgfsSubscriberHandle #include "hgfsUtil.h" // for HgfsInternalStatus struct HgfsSessionInfo; /* * Activate and deactivate reason. * Currently, there are two scenarios: * 1) HGFS server is check point synchronizing: the file system event * generation is deactivated at the start and activated at the end. * 2) The client has added the first subscriber or removed the last * subscriber. The file system event generation is activated on the * addition of the first subscriber and deactivated on removal of * the last one. * * Note, in case 1 above, if there are no subscribers even at the end * of the HGFS server check point syncing, the activation will not * activate the file system events. */ typedef enum { HGFS_NOTIFY_REASON_SERVER_SYNC, HGFS_NOTIFY_REASON_SUBSCRIBERS, } HgfsNotifyActivateReason; /* This is a callback that is implemented in hgfsServer.c */ typedef void HgfsNotifyEventReceiveCb(HgfsSharedFolderHandle sharedFolder, HgfsSubscriberHandle subscriber, char *name, uint32 mask, struct HgfsSessionInfo *session); HgfsInternalStatus HgfsNotify_Init(void); void HgfsNotify_Exit(void); void HgfsNotify_Deactivate(HgfsNotifyActivateReason mode); void HgfsNotify_Activate(HgfsNotifyActivateReason mode); HgfsSharedFolderHandle HgfsNotify_AddSharedFolder(const char *path, const char *shareName); HgfsSubscriberHandle HgfsNotify_AddSubscriber(HgfsSharedFolderHandle sharedFolder, const char *path, uint32 eventFilter, uint32 recursive, HgfsNotifyEventReceiveCb notify, struct HgfsSessionInfo *session); Bool HgfsNotify_RemoveSharedFolder(HgfsSharedFolderHandle sharedFolder); Bool HgfsNotify_RemoveSubscriber(HgfsSubscriberHandle subscriber); void HgfsNotify_RemoveSessionSubscribers(struct HgfsSessionInfo *session); #endif // _HGFS_DIRNOTIFY_H open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerLinux.c0000644000000000000000000051026112660700525022046 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerLinux.c -- * * This file contains the linux implementation of the server half * of the Host/Guest File System (hgfs), a.k.a. "Shared Folder". * * The hgfs server carries out filesystem requests that it receives * over the backdoor from a driver in the other world. */ #define _GNU_SOURCE // for O_NOFOLLOW #if defined(__APPLE__) #define _DARWIN_USE_64_BIT_INODE #endif #include #include #include #include #include #include #include // for utimes(2) #include #include #include #include #include // for getrlimit #if defined(__FreeBSD__) # include #else # include # include #endif #include "vmware.h" #include "hgfsServerPolicy.h" // for security policy #include "hgfsServerInt.h" #include "hgfsServerOplock.h" #include "hgfsEscape.h" #include "str.h" #include "cpNameLite.h" #include "hgfsUtil.h" // for cross-platform time conversion #include "posix.h" #include "file.h" #include "util.h" #include "su.h" #include "codeset.h" #include "unicodeOperations.h" #include "userlock.h" #if defined(linux) && !defined(SYS_getdents64) /* For DT_UNKNOWN */ # include #endif #ifndef VMX86_TOOLS # include "config.h" #endif #define LOGLEVEL_MODULE hgfs #include "loglevel_user.h" #if defined(__APPLE__) #include // for the alias manager #include // for CFString and CFURL #include // for getattrlist #include // for VERG / VDIR #endif #ifdef linux typedef struct DirectoryEntry { uint64 d_ino; uint64 d_off; uint16 d_reclen; uint8 d_type; char d_name[256]; } DirectoryEntry; #else #include typedef struct DirectoryEntry { uint64 d_ino; uint16 d_reclen; uint16 d_namlen; uint8 d_type; char d_name[1024]; } DirectoryEntry; #endif /* * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the * Solaris version of . */ #ifdef sun # define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) # define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) #endif /* * On Linux, we must wrap getdents64, as glibc does not wrap it for us. We use getdents64 * (rather than getdents) because with the latter, we'll get 64-bit offsets and inode * numbers. Note that getdents64 isn't supported everywhere, in particular, kernels older * than 2.4.1 do not implement it. On those older guests, we try using getdents(), and * translating the results to our DirectoryEntry structure... * * On FreeBSD and Mac platforms, getdents is implemented as getdirentries, and takes an * additional parameter which returns the position of the block read, which we don't care * about. */ #if defined(linux) static INLINE int getdents_linux(unsigned int fd, DirectoryEntry *dirp, unsigned int count) { # if defined(SYS_getdents64) return syscall(SYS_getdents64, fd, dirp, count); # else /* * Fall back to regular getdents on older Linux systems that don't have * getdents64. Because glibc does translation between the kernel's "struct dirent" and * the libc "struct dirent", this structure matches the one in linux/dirent.h, rather * than us using the libc 'struct dirent' directly */ struct linux_dirent { long d_ino; long d_off; /* __kernel_off_t expands to long on RHL 6.2 */ unsigned short d_reclen; char d_name[NAME_MAX]; } *dirp_temp; int retval; dirp_temp = alloca((sizeof *dirp_temp) * count); retval = syscall(SYS_getdents, fd, dirp_temp, count); if (retval > 0) { int i; /* * Translate from the Linux 'struct dirent' to the hgfs DirectoryEntry, since * they're not always the same layout. */ for (i = 0; i < count; i++) { dirp[i].d_ino = dirp_temp[i].d_ino; dirp[i].d_off = dirp_temp[i].d_off; dirp[i].d_reclen = dirp_temp[i].d_reclen; dirp[i].d_type = DT_UNKNOWN; memset(dirp[i].d_name, 0, sizeof dirp->d_name); memcpy(dirp[i].d_name, dirp_temp[i].d_name, ((sizeof dirp->d_name) < (sizeof dirp_temp->d_name)) ? (sizeof dirp->d_name) : (sizeof dirp_temp->d_name)); } } return retval; # endif } # define getdents getdents_linux #elif defined(__FreeBSD__) #define getdents(fd, dirp, count) \ ({ \ long basep; \ getdirentries(fd, dirp, count, &basep); \ }) #elif defined(__APPLE__) static INLINE int getdents_apple(DIR *fd, // IN DirectoryEntry *dirp, // OUT unsigned int count) // IN: ignored { int res = 0; struct dirent *dirEntry; dirEntry = readdir(fd); if (NULL != dirEntry) { /* * Assert that the hgfs DirectoryEntry version and system dirent * name fields are of the same size. Since that is where it was taken from. */ ASSERT_ON_COMPILE(sizeof dirp->d_name == sizeof dirEntry->d_name); dirp->d_ino = dirEntry->d_ino; dirp->d_type = dirEntry->d_type; dirp->d_namlen = dirEntry->d_namlen; memcpy(dirp->d_name, dirEntry->d_name, dirEntry->d_namlen + 1); dirp->d_reclen = offsetof(DirectoryEntry, d_name) + dirp->d_namlen + 1; res = dirp->d_reclen; } return res; } # define getdents getdents_apple #endif /* * O_DIRECTORY is only relevant on Linux. For other platforms, we'll hope that * the kernel is smart enough to deny getdents(2) (or getdirentries(2)) on * files which aren't directories. * * Likewise, O_NOFOLLOW doesn't exist on Solaris 9. Oh well. */ #ifndef O_DIRECTORY #define O_DIRECTORY 0 #endif #ifndef O_NOFOLLOW #define O_NOFOLLOW 0 #endif #if defined(sun) || defined(linux) || \ (defined(__FreeBSD_version) && __FreeBSD_version < 490000) /* * Implements futimes(), which was introduced in glibc 2.3.3. FreeBSD 3.2 * doesn't have it, but 4.9 does. Unfortunately, these early FreeBSD versions * don't have /proc/self, so futimes() will simply fail. For now the only * caller to futimes() is HgfsServerSetattr which doesn't get invoked at all * in the HGFS server which runs in the Tools, so it's OK. */ #define PROC_SELF_FD "/proc/self/fd/" #define STRLEN_OF_MAXINT_AS_STRING 10 int futimes(int fd, const struct timeval times[2]) { #ifndef sun /* * Hack to allow the timevals in futimes() to be const even when utimes() * expects non-const timevals. This is the case on glibc up to 2.3 or * thereabouts. */ struct timeval mytimes[2]; /* Maximum size of "/proc/self/fd/" as a string. Accounts for nul. */ char nameBuffer[sizeof PROC_SELF_FD + STRLEN_OF_MAXINT_AS_STRING]; mytimes[0] = times[0]; mytimes[1] = times[1]; if (snprintf(nameBuffer, sizeof nameBuffer, PROC_SELF_FD "%d", fd) < 0) { return -1; } return Posix_Utimes(nameBuffer, mytimes); #else /* !sun */ return futimesat(fd, NULL, times); #endif /* !sun */ } #undef PROC_SELF_FD #undef STRLEN_OF_MAXINT_AS_STRING #endif #if defined(__APPLE__) struct FInfoAttrBuf { uint32 length; fsobj_type_t objType; char finderInfo[32]; }; #endif /* * Taken from WinNT.h. * For verifying the Windows client which can ask for delete access as well as the * standard read, write, execute permissions. * XXX - should probably be moved into a header file and may need to be expanded if * Posix looks at the access mode more thoroughly or we expand the set of cross-platform * access mode flags. */ #define DELETE (0x00010000L) /* * Server open flags, indexed by HgfsOpenFlags. Stolen from * lib/fileIOPosix.c * * Using O_NOFOLLOW will allow us to forgo a (racy) symlink check just * before opening the file. * * Using O_NONBLOCK will prevent us from blocking the HGFS server if * we open a FIFO. */ static const int HgfsServerOpenFlags[] = { O_NONBLOCK | O_NOFOLLOW, O_NONBLOCK | O_NOFOLLOW | O_TRUNC, O_NONBLOCK | O_NOFOLLOW | O_CREAT, O_NONBLOCK | O_NOFOLLOW | O_CREAT | O_EXCL, O_NONBLOCK | O_NOFOLLOW | O_CREAT | O_TRUNC, }; /* * Server open mode, indexed by HgfsOpenMode. */ static const int HgfsServerOpenMode[] = { O_RDONLY, O_WRONLY, O_RDWR, }; /* Local functions. */ static HgfsInternalStatus HgfsGetattrResolveAlias(char const *fileName, char **targetName); static void HgfsStatToFileAttr(struct stat *stats, uint64 *creationTime, HgfsFileAttrInfo *attr); static int HgfsStat(const char* fileName, Bool followLink, struct stat *stats, uint64 *creationTime); static int HgfsFStat(int fd, struct stat *stats, uint64 *creationTime); static void HgfsGetSequentialOnlyFlagFromName(const char *fileName, Bool followSymlinks, HgfsFileAttrInfo *attr); static void HgfsGetSequentialOnlyFlagFromFd(int fd, HgfsFileAttrInfo *attr); static int HgfsConvertComponentCase(char *currentComponent, const char *dirPath, const char **convertedComponent, size_t *convertedComponentSize); static int HgfsConstructConvertedPath(char **path, size_t *pathSize, char *convertedPath, size_t convertedPathSize); static int HgfsCaseInsensitiveLookup(const char *sharePath, size_t sharePathLength, char *fileName, size_t fileNameLength, char **convertedFileName, size_t *convertedFileNameLength); static Bool HgfsSetattrMode(struct stat *statBuf, HgfsFileAttrInfo *attr, mode_t *newPermissions); static Bool HgfsSetattrOwnership(HgfsFileAttrInfo *attr, uid_t *newUid, gid_t *newGid); static HgfsInternalStatus HgfsSetattrTimes(struct stat *statBuf, HgfsFileAttrInfo *attr, HgfsAttrHint hints, Bool useHostTime, struct timeval *accessTime, struct timeval *modTime, Bool *timesChanged); static HgfsInternalStatus HgfsGetHiddenXAttr(char const *fileName, Bool *attribute); static HgfsInternalStatus HgfsSetHiddenXAttr(char const *fileName, Bool value, mode_t permissions); static HgfsInternalStatus HgfsEffectivePermissions(char *fileName, Bool readOnlyShare, uint32 *permissions); static uint64 HgfsGetCreationTime(const struct stat *stats); #if !defined(sun) static HgfsInternalStatus HgfsWriteCheckIORange(off_t offset, uint32 bytesToWrite); #endif /* *----------------------------------------------------------------------------- * * HgfsPlatformConvertFromNameStatus -- * * This function converts between a status code used in processing a cross * platform filename, and a platform-specific status code. * * Because the two status codes never go down the wire, there is no danger * of backwards compatibility here, and we should ASSERT if we encounter * an status code that we're not familiar with. * * Results: * Converted status code. * * Side effects: * None. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformConvertFromNameStatus(HgfsNameStatus status) // IN { switch(status) { case HGFS_NAME_STATUS_COMPLETE: return 0; case HGFS_NAME_STATUS_FAILURE: case HGFS_NAME_STATUS_INCOMPLETE_BASE: case HGFS_NAME_STATUS_INCOMPLETE_ROOT: case HGFS_NAME_STATUS_INCOMPLETE_DRIVE: case HGFS_NAME_STATUS_INCOMPLETE_UNC: case HGFS_NAME_STATUS_INCOMPLETE_UNC_MACH: return EINVAL; case HGFS_NAME_STATUS_DOES_NOT_EXIST: return ENOENT; case HGFS_NAME_STATUS_ACCESS_DENIED: return EACCES; case HGFS_NAME_STATUS_SYMBOLIC_LINK: return ELOOP; case HGFS_NAME_STATUS_OUT_OF_MEMORY: return ENOMEM; case HGFS_NAME_STATUS_TOO_LONG: return ENAMETOOLONG; case HGFS_NAME_STATUS_NOT_A_DIRECTORY: return ENOTDIR; default: NOT_IMPLEMENTED(); } } /* *----------------------------------------------------------------------------- * * HgfsPlatformGetDefaultDirAttrs -- * * Get default directory attributes. Permissions are Read and * Execute permission only. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsPlatformGetDefaultDirAttrs(HgfsFileAttrInfo *attr) // OUT { struct timeval tv; uint64 hgfsTime; ASSERT(attr); attr->type = HGFS_FILE_TYPE_DIRECTORY; attr->size = 4192; /* * Linux and friends are OK with receiving timestamps of 0, but just * for consistency with the Windows server, we'll pass back the * host's time in a virtual directory's timestamps. */ if (gettimeofday(&tv, NULL) != 0) { hgfsTime = 0; } else { hgfsTime = HgfsConvertToNtTime(tv.tv_sec, tv.tv_usec * 1000); } attr->creationTime = hgfsTime; attr->accessTime = hgfsTime; attr->writeTime = hgfsTime; attr->attrChangeTime = hgfsTime; attr->specialPerms = 0; attr->ownerPerms = HGFS_PERM_READ | HGFS_PERM_EXEC; attr->groupPerms = HGFS_PERM_READ | HGFS_PERM_EXEC; attr->otherPerms = HGFS_PERM_READ | HGFS_PERM_EXEC; attr->mask = HGFS_ATTR_VALID_TYPE | HGFS_ATTR_VALID_SIZE | HGFS_ATTR_VALID_CREATE_TIME | HGFS_ATTR_VALID_ACCESS_TIME | HGFS_ATTR_VALID_WRITE_TIME | HGFS_ATTR_VALID_CHANGE_TIME | HGFS_ATTR_VALID_SPECIAL_PERMS | HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | HGFS_ATTR_VALID_OTHER_PERMS; } /* *----------------------------------------------------------------------------- * * HgfsServerGetOpenFlags -- * * Retrieve system open flags from HgfsOpenFlags. * * Does the correct bounds checking on the HgfsOpenFlags before * indexing into the array of flags to use. See bug 54429. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsServerGetOpenFlags(HgfsOpenFlags flagsIn, // IN int *flagsOut) // OUT { unsigned int arraySize; ASSERT(flagsOut); arraySize = ARRAYSIZE(HgfsServerOpenFlags); if ((unsigned int)flagsIn >= arraySize) { Log("%s: Invalid HgfsOpenFlags %d\n", __FUNCTION__, flagsIn); return FALSE; } *flagsOut = HgfsServerOpenFlags[flagsIn]; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPlatformInit -- * * Set up any state needed to start Linux HGFS server. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsPlatformInit(void) { return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPlatformDestroy -- * * Tear down any state used for Linux HGFS server. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsPlatformDestroy(void) { } /* *----------------------------------------------------------------------------- * * HgfsServerGetOpenMode -- * * Retrieve system open mode from HgfsOpenMode. * * Does the correct bounds checking on the HgfsOpenMode before * indexing into the array of modes to use. See bug 54429. * * This is just the POSIX implementation; the Windows implementation is * more complicated, hence the need for the HgfsFileOpenInfo as an * argument. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerGetOpenMode(HgfsFileOpenInfo *openInfo, // IN: Open info to examine uint32 *modeOut) // OUT: Local mode { ASSERT(modeOut); /* * If we didn't get the mode in the open request, we'll return a mode of 0. * This has the effect of failing the call to open(2) later, which is * exactly what we want. */ if ((openInfo->mask & HGFS_OPEN_VALID_MODE) == 0) { *modeOut = 0; return TRUE; } if (!HGFS_OPEN_MODE_IS_VALID_MODE(openInfo->mode)) { Log("%s: Invalid HgfsOpenMode %d\n", __FUNCTION__, openInfo->mode); return FALSE; } *modeOut = HgfsServerOpenMode[HGFS_OPEN_MODE_ACCMODE(openInfo->mode)]; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPlatformCloseFile -- * * Closes the file descriptor and release the file context. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformCloseFile(fileDesc fileDesc, // IN: File descriptor void *fileCtx) // IN: File context { if (close(fileDesc) != 0) { int error = errno; LOG(4, ("%s: Could not close fd %d: %s\n", __FUNCTION__, fileDesc, strerror(error))); return error; } return 0; } /* *----------------------------------------------------------------------------- * * HgfsCheckFileNode -- * * Check if a file node is still valid (i.e. if the file name stored in the * file node still refers to the same file) * * Results: * Zero if the file node is valid * Non-zero if the file node is stale * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsCheckFileNode(char const *localName, // IN HgfsLocalId const *localId) // IN { struct stat nodeStat; ASSERT(localName); ASSERT(localId); /* * A file is uniquely identified by a (device; inode) pair. Check that the * file name still refers to the same pair */ #if defined(__APPLE__) /* * Can't use Posix_Stat because of inconsistent definition * of _DARWIN_USE_64_BIT_INODE in this file and in other libraries. */ if (stat(localName, &nodeStat) < 0) { #else if (Posix_Stat(localName, &nodeStat) < 0) { #endif int error = errno; LOG(4, ("%s: couldn't stat local file \"%s\": %s\n", __FUNCTION__, localName, strerror(error))); return error; } if (nodeStat.st_dev != localId->volumeId || nodeStat.st_ino != localId->fileId) { LOG(4, ("%s: local Id mismatch\n", __FUNCTION__)); return ENOENT; } return 0; } /* *----------------------------------------------------------------------------- * * HgfsPlatformGetFd -- * * Returns the file descriptor associated with the node. If the node is * cached then it just returns the cached file descriptor (checking for * correct write flags). Otherwise, it opens a new file, caches the node * and returns the file desriptor. * * Results: * Zero on success. fd contains the opened file descriptor. * Non-zero on error. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformGetFd(HgfsHandle hgfsHandle, // IN: HGFS file handle HgfsSessionInfo *session, // IN: Session info Bool append, // IN: Open with append flag fileDesc *fd) // OUT: Opened file descriptor { int newFd = -1, openFlags = 0; HgfsFileNode node; HgfsInternalStatus status = 0; ASSERT(fd); ASSERT(session); /* * Use node copy convenience function to get the node information. * Note that we shouldn't keep this node around for too long because * the information can become stale. However, it's ok to get all the * fields in one step, instead of getting them all separate. * * XXX: It would be better if we didn't do this node copy on the fast * path. Unfortuntely, even the fast path may need to look at the node's * append flag. */ node.utf8Name = NULL; if (!HgfsGetNodeCopy(hgfsHandle, session, TRUE, &node)) { /* XXX: Technically, this can also fail if we're out of memory. */ LOG(4, ("%s: Invalid hgfs handle.\n", __FUNCTION__)); status = EBADF; goto exit; } /* If the node is found in the cache */ if (HgfsIsCached(hgfsHandle, session)) { /* * If the append flag is set check to see if the file was opened * in append mode. If not, close the file and reopen it in append * mode. */ if (append && !(node.flags & HGFS_FILE_NODE_APPEND_FL)) { status = HgfsPlatformCloseFile(node.fileDesc, node.fileCtx); if (status != 0) { LOG(4, ("%s: Couldn't close file \"%s\" for reopening\n", __FUNCTION__, node.utf8Name)); goto exit; } /* * Update the node in the cache with the new value of the append * flag. */ if (!HgfsUpdateNodeAppendFlag(hgfsHandle, session, TRUE)) { LOG(4, ("%s: Could not update the node in the cache\n", __FUNCTION__)); status = EBADF; goto exit; } } else { newFd = node.fileDesc; goto exit; } } /* * If we got here then the file was either not in the cache or needs * reopening. This means we need to open a file. But first, verify * that the file we intend to open isn't stale. */ status = HgfsCheckFileNode(node.utf8Name, &node.localId); if (status != 0) { goto exit; } /* * We're not interested in creating a new file. So let's just get the * flags for a simple open request. This really should always work. */ HgfsServerGetOpenFlags(0, &openFlags); /* * We don't need to specify open permissions here because we're only * reopening an existing file, not creating a new one. * * XXX: We should use O_LARGEFILE, see lib/file/fileIOPosix.c --hpreg */ newFd = Posix_Open(node.utf8Name, node.mode | openFlags | (append ? O_APPEND : 0)); if (newFd < 0) { int error = errno; LOG(4, ("%s: Couldn't open file \"%s\": %s\n", __FUNCTION__, node.utf8Name, strerror(errno))); status = error; goto exit; } /* * Update the original node with the new value of the file desc. * This call might fail if the node is not used anymore. */ if (!HgfsUpdateNodeFileDesc(hgfsHandle, session, newFd, NULL)) { LOG(4, ("%s: Could not update the node -- node is not used.\n", __FUNCTION__)); status = EBADF; goto exit; } /* Add the node to the cache. */ if (!HgfsAddToCache(hgfsHandle, session)) { LOG(4, ("%s: Could not add node to the cache\n", __FUNCTION__)); status = EBADF; goto exit; } exit: if (status == 0) { *fd = newFd; } free(node.utf8Name); return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformValidateOpen -- * * Verify that the file with the given local name exists in the * local filesystem by trying to open the file with the requested * mode and permissions. If the open succeeds we stat the file * and fill in the volumeId and fileId with the file's local * filesystem device and inode number, respectively. * * Results: * Zero on success * Non-zero on failure. * * Side effects: * File with name "localName" may be created or truncated. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformValidateOpen(HgfsFileOpenInfo *openInfo, // IN: Open info struct Bool followSymlinks, // IN: followSymlinks config option HgfsSessionInfo *session, // IN: session info HgfsLocalId *localId, // OUT: Local unique file ID fileDesc *fileDesc) // OUT: Handle to the file { struct stat fileStat; int fd; int openMode = 0, openFlags = 0; mode_t openPerms; HgfsLockType serverLock; HgfsInternalStatus status = 0; Bool needToSetAttribute = FALSE; ASSERT(openInfo); ASSERT(localId); ASSERT(fileDesc); ASSERT(session); /* * Get correct system flags and mode from the HgfsOpenFlags and * HgfsOpenMode. This is related to bug 54429. */ if (!HgfsServerGetOpenFlags(openInfo->mask & HGFS_OPEN_VALID_FLAGS ? openInfo->flags : 0, &openFlags) || !HgfsServerGetOpenMode(openInfo, &openMode)) { status = EPROTO; goto exit; } /* * Create mode_t for use in open(). If owner permissions are missing, use * read/write for the owner permissions. If group or other permissions * are missing, use the owner permissions. * * This sort of makes sense. If the Windows driver wants to make a file * read-only, it probably intended for the file to be 555. Since creating * a file requires a valid mode, it's highly unlikely that we'll ever * be creating a file without owner permissions. */ openPerms = 0; openPerms |= openInfo->mask & HGFS_OPEN_VALID_SPECIAL_PERMS ? openInfo->specialPerms << 9 : 0; openPerms |= openInfo->mask & HGFS_OPEN_VALID_OWNER_PERMS ? openInfo->ownerPerms << 6 : S_IWUSR | S_IRUSR; openPerms |= openInfo->mask & HGFS_OPEN_VALID_GROUP_PERMS ? openInfo->groupPerms << 3 : (openPerms & S_IRWXU) >> 3; openPerms |= openInfo->mask & HGFS_OPEN_VALID_OTHER_PERMS ? openInfo->otherPerms : (openPerms & S_IRWXU) >> 6; /* * By default we don't follow symlinks, O_NOFOLLOW is always set. * Unset it if followSymlinks config option is specified. */ if (followSymlinks) { openFlags &= ~O_NOFOLLOW; } /* * Need to validate that open does not change the file for read * only shared folders. */ status = 0; if (!openInfo->shareInfo.writePermissions) { Bool deleteAccess = FALSE; /* * If a valid desiredAccess field specified by the Windows client, we use that * as the desiredAccess field has more data such as delete than is contained * in the mode. */ if ((0 != (openInfo->mask & HGFS_OPEN_VALID_DESIRED_ACCESS)) && (0 != (openInfo->desiredAccess & DELETE))) { deleteAccess = TRUE; } if ((openFlags & (O_APPEND | O_CREAT | O_TRUNC)) || (openMode & (O_WRONLY | O_RDWR)) || deleteAccess) { status = Posix_Access(openInfo->utf8Name, F_OK); if (status < 0) { status = errno; if (status == ENOENT && (openFlags & O_CREAT) != 0) { status = EACCES; } } else { /* * Handle the case when the file already exists: * If there is an attempt to createa new file, fail with "EEXIST" * error, otherwise set error to "EACCES". */ if ((openFlags & O_CREAT) && (openFlags & O_EXCL)) { status = EEXIST; } else { status = EACCES; } } } if (status != 0) { LOG(4, ("%s: Error: Unwritable share mode %u flags %u file \"%s\": %d %s\n", __FUNCTION__, openMode, openFlags, openInfo->utf8Name, status, strerror(status))); goto exit; } } if (!openInfo->shareInfo.readPermissions) { /* * "Drop Box" / "FTP incoming" type of shared folders. * Allow creating a new file. Deny opening exisitng file. */ status = Posix_Access(openInfo->utf8Name, F_OK); if (status < 0) { status = errno; if (status != ENOENT || (openFlags & O_CREAT) == 0) { status = EACCES; } } else { status = EACCES; } if (status != 0) { LOG(4, ("%s: Error: Unreadable share flags %u file \"%s\": %d %s\n", __FUNCTION__, openFlags, openInfo->utf8Name, status, strerror(status))); goto exit; } } /* * Determine if hidden attribute needs to be updated. * It needs to be updated if a new file is created or an existing file is truncated. * Since Posix_Open does not tell us if a new file has been created when O_CREAT is * specified we need to find out if the file exists before an open that may create * it. */ if (openInfo->mask & HGFS_OPEN_VALID_FILE_ATTR) { if ((openFlags & O_TRUNC) || ((openFlags & O_CREAT) && (openFlags & O_EXCL))) { needToSetAttribute = TRUE; } else if (openFlags & O_CREAT) { int err = Posix_Access(openInfo->utf8Name, F_OK); needToSetAttribute = (err != 0) && (errno == ENOENT); } } /* * Try to open the file with the requested mode, flags and permissions. */ fd = Posix_Open(openInfo->utf8Name, openMode | openFlags, openPerms); if (fd < 0) { status = errno; if (status == EAGAIN) { /* * We have tried opening with O_NONBLOCK but looks like an incompatible * lease may be held on the file. Tell the client that this access mode * is not allowed currently. */ status = EACCES; } LOG(4, ("%s: Error: open file \"%s\": %d %s\n", __FUNCTION__, openInfo->utf8Name, status, strerror(status))); goto exit; } /* Stat file to get its volume and file info */ if (fstat(fd, &fileStat) < 0) { status = errno; LOG(4, ("%s: Error: stat file\"%s\": %d %s\n", __FUNCTION__, openInfo->utf8Name, status, strerror(status))); close(fd); goto exit; } /* Set the rest of the Windows specific attributes if necessary. */ if (needToSetAttribute) { HgfsSetHiddenXAttr(openInfo->utf8Name, (openInfo->attr & HGFS_ATTR_HIDDEN) != 0, fileStat.st_mode); } /* Try to acquire an oplock. */ if (openInfo->mask & HGFS_OPEN_VALID_SERVER_LOCK) { serverLock = openInfo->desiredLock; if (!HgfsAcquireServerLock(fd, session, &serverLock)) { openInfo->acquiredLock = HGFS_LOCK_NONE; } else { openInfo->acquiredLock = serverLock; } } else { openInfo->acquiredLock = HGFS_LOCK_NONE; } *fileDesc = fd; /* Set volume and file ids from stat results */ localId->volumeId = fileStat.st_dev; localId->fileId = fileStat.st_ino; exit: return status; } /* *----------------------------------------------------------------------------- * * HgfsGetattrResolveAlias -- * * Mac OS defines a special file type known as an alias which behaves like a * symlink when viewed through the Finder, but is actually a regular file * otherwise. * * If the given filename is (or contains) an alias, this function will * resolve it completely and set targetName to something non-NULL. * * Results: * Zero on success. targetName is allocated if the file was an alias, and * NULL otherwise. * Non-zero on failure. targetName is unmodified. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsGetattrResolveAlias(char const *fileName, // IN: Input filename char **targetName) // OUT: Target filename { #ifndef __APPLE__ *targetName = NULL; return 0; #else // __APPLE__ HgfsInternalStatus status = HGFS_INTERNAL_STATUS_ERROR; Boolean success; CFURLRef resolvedURL = NULL; CFStringRef resolvedString = NULL; CFIndex maxPath; *targetName = NULL; if (CFURLCreateBookmarkDataFromFile != NULL) { /* We are running on Mac OS 10.6 or later. */ CFURLRef fileURL; CFBooleanRef isAlias = NULL; CFDataRef bookmarkData = NULL; CFURLBookmarkResolutionOptions resolutionOptions; Boolean isStale; fileURL = CFURLCreateFromFileSystemRepresentation(NULL, fileName, strlen(fileName), FALSE); if (!fileURL) { Log("%s: could not create CFURL for file.\n", __FUNCTION__); goto newExit; } success = CFURLCopyResourcePropertyForKey(fileURL, kCFURLIsAliasFileKey, &isAlias, NULL); if (!success) { Log("%s: could not copy IsAlias property key for file.\n", __FUNCTION__); goto newExit; } if (!CFBooleanGetValue(isAlias)) { status = 0; LOG(4, ("%s: file was not an alias\n", __FUNCTION__)); goto newExit; } LOG(4, ("%s: file was an alias\n", __FUNCTION__)); bookmarkData = CFURLCreateBookmarkDataFromFile(NULL, fileURL, NULL); if (!bookmarkData) { Log("%s: could not retrieve bookmark data for file.\n", __FUNCTION__); goto newExit; } /* * Don't show any UI during alias resolution and don't mount volumes * containing the alias target. This avoids blocking the current process * and/or Finder while trying to mount unreachable hosts (bug 1396411). */ resolutionOptions = kCFBookmarkResolutionWithoutUIMask | kCFBookmarkResolutionWithoutMountingMask; resolvedURL = CFURLCreateByResolvingBookmarkData(NULL, bookmarkData, resolutionOptions, NULL, NULL, &isStale, NULL); if (!resolvedURL) { Log("%s: could not resolve bookmark data for file.\n", __FUNCTION__); goto newExit; } newExit: if (fileURL) { CFRelease(fileURL); } if (isAlias) { CFRelease(isAlias); } if (bookmarkData) { CFRelease(bookmarkData); } } else { /* We are running on Mac OS 10.5 or earlier. */ #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060 /* * Mac OS 10.5 used a type of alias which appears on disk as a 0-byte * file but stores its linking data in a resource fork. The APIs for * interacting with this type of alias are deprecated when targetting * 10.8+. */ FSRef fileRef; Boolean isAlias; Boolean targetIsFolder; OSStatus osStatus; ASSERT_ON_COMPILE(sizeof osStatus == sizeof (int32)); osStatus = FSPathMakeRef(fileName, &fileRef, NULL); if (osStatus != noErr) { Log("%s: could not create file reference: error %d\n", __FUNCTION__, (int32)osStatus); goto oldExit; } osStatus = FSIsAliasFile(&fileRef, &isAlias, &targetIsFolder); if (osStatus != noErr) { Log("%s: could not detect if file is an old style alias: error %d\n", __FUNCTION__, (int32)osStatus); goto oldExit; } if (!isAlias) { status = 0; LOG(4, ("%s: file was not an alias\n", __FUNCTION__)); goto oldExit; } LOG(4, ("%s: file was an alias\n", __FUNCTION__)); /* * Create and resolve an FSRef of the desired path. We pass FALSE to * resolveAliasChains because aliases to aliases should behave as * symlinks to symlinks. * * If alias points to an unmounted volume, the volume needs to be * explicitly mounted. Mount flag kResolveAliasFileNoUI prevents the user * from being prompted about mounting. * * Caution: Mac OS 10.10.2 will attempt to mount volumes silently, * unlike the earlier behavior of only resolving within existing mounts. * The new CFURLCreateByResolvingBookmarkData API must be used to avoid * mounting the alias target. * * XXX: This function returns fnfErr (file not found) if it encounters a * broken alias. Perhaps we should make that look like a dangling symlink * instead of returning an error? */ osStatus = FSResolveAliasFileWithMountFlags(&fileRef, FALSE, &targetIsFolder, &isAlias, kResolveAliasFileNoUI); if (osStatus != noErr) { Log("%s: could not resolve reference: error %d\n", __FUNCTION__, (int32)osStatus); goto oldExit; } resolvedURL = CFURLCreateFromFSRef(NULL, &fileRef); if (!resolvedURL) { Log("%s: could not create resolved URL reference from " "resolved filesystem reference\n", __FUNCTION__); goto oldExit; } oldExit: (void)0; // Need a statement for the label. #else // __MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 // We are running on 10.5 but the build was targetting 10.6+. Eject! NOT_IMPLEMENTED(); #endif // __MAC_OS_X_VERSION_MIN_REQUIRED } if (resolvedURL) { /* * This is somewhat convoluted. We want to call * CFURLGetFileSystemRepresentation() to get a UTF-8 string representing * the target of the alias. But to call * CFStringGetMaximumSizeOfFileSystemRepresentation(), we need a CFString, * so we make one from the CFURL. Once we've got the max number of bytes * for a filename on the filesystem, we allocate some memory and convert * the CFURL to a basic UTF-8 string using a call to * CFURLGetFileSystemRepresentation(). */ resolvedString = CFURLGetString(resolvedURL); if (!resolvedString) { Log("%s: could not create resolved string reference from " "resolved URL reference\n", __FUNCTION__); goto exit; } maxPath = CFStringGetMaximumSizeOfFileSystemRepresentation(resolvedString); *targetName = malloc(maxPath); if (*targetName == NULL) { Log("%s: could not allocate %"FMTSZ"d bytes of memory for " "target name storage\n", __FUNCTION__, maxPath); goto exit; } success = CFURLGetFileSystemRepresentation(resolvedURL, FALSE, *targetName, maxPath); if (!success) { Log("%s: could not convert and copy resolved URL reference " "into allocated buffer\n", __FUNCTION__); goto exit; } status = 0; } exit: if (resolvedURL) { CFRelease(resolvedURL); } if (status != 0) { free(*targetName); *targetName = NULL; } return status; #endif // __APPLE__ } /* *----------------------------------------------------------------------------- * * HgfsGetHiddenAttr -- * * For Mac hosts and Linux hosts, if a guest is Windows we force the "dot", * files to be treated as hidden too in the Windows client by always setting * the hidden attribute flag. * Currently, this flag cannot be removed by Windows clients. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsGetHiddenAttr(char const *fileName, // IN: Input filename HgfsFileAttrInfo *attr) // OUT: Struct to copy into { char *baseName; ASSERT(fileName); ASSERT(attr); baseName = strrchr(fileName, DIRSEPC); if ((baseName != NULL) && (baseName[1] == '.') && (strcmp(&baseName[1], ".") != 0) && (strcmp(&baseName[1], "..") != 0)) { attr->mask |= HGFS_ATTR_VALID_FLAGS; attr->flags |= HGFS_ATTR_HIDDEN; /* * The request sets the forced flag so the client knows it is simulated * and is not a real attribute, which can only happen on a Windows server. * This allows the client to enforce some checks correctly if the flag * is real or not. * This replicates SMB behavior see bug 292189. */ attr->flags |= HGFS_ATTR_HIDDEN_FORCED; } else { Bool isHidden = FALSE; /* * Do not propagate any error returned from HgfsGetHiddenXAttr. * Consider that the file is not hidden if can't get hidden attribute for * whatever reason; most likely it fails because hidden attribute is not supported * by the OS or file system. */ HgfsGetHiddenXAttr(fileName, &isHidden); if (isHidden) { attr->mask |= HGFS_ATTR_VALID_FLAGS; attr->flags |= HGFS_ATTR_HIDDEN; } } } /* *----------------------------------------------------------------------------- * * HgfsConvertComponentCase -- * * Do a case insensitive search of a directory for the specified entry. If * a matching entry is found, return it in the convertedComponent argument. * * Results: * On Success: * Returns 0 and the converted component name in the argument convertedComponent. * The length for the convertedComponent is returned in convertedComponentSize. * * On Failure: * Non-zero errno return, with convertedComponent and convertedComponentSize * set to NULL and 0 respectively. * * Side effects: * On success, allocated memory is returned in convertedComponent and needs * to be freed. * *----------------------------------------------------------------------------- */ static int HgfsConvertComponentCase(char *currentComponent, // IN const char *dirPath, // IN const char **convertedComponent, // OUT size_t *convertedComponentSize) // OUT { struct dirent *dirent; DIR *dir = NULL; char *dentryName; size_t dentryNameLen; char *myConvertedComponent = NULL; size_t myConvertedComponentSize; int ret; ASSERT(currentComponent); ASSERT(dirPath); ASSERT(convertedComponent); ASSERT(convertedComponentSize); /* Open the specified directory. */ dir = Posix_OpenDir(dirPath); if (!dir) { ret = errno; goto exit; } /* * Unicode_CompareIgnoreCase crashes with invalid unicode strings, * validate it before passing it to Unicode_* functions. */ if (!Unicode_IsBufferValid(currentComponent, -1, STRING_ENCODING_UTF8)) { /* Invalid unicode string, return failure. */ ret = EINVAL; goto exit; } /* * Read all of the directory entries. For each one, convert the name * to lower case and then compare it to the lower case component. */ while ((dirent = readdir(dir))) { char *dentryNameU; int cmpResult; dentryName = dirent->d_name; dentryNameLen = strlen(dentryName); /* * Unicode_CompareIgnoreCase crashes with invalid unicode strings, * validate and convert it appropriately before passing it to Unicode_* * functions. */ if (!Unicode_IsBufferValid(dentryName, dentryNameLen, STRING_ENCODING_DEFAULT)) { /* Invalid unicode string, skip the entry. */ continue; } dentryNameU = Unicode_Alloc(dentryName, STRING_ENCODING_DEFAULT); cmpResult = Unicode_CompareIgnoreCase(currentComponent, dentryNameU); free(dentryNameU); if (cmpResult == 0) { /* * The current directory entry is a case insensitive match to * the specified component. Malloc and copy the current directory entry. */ myConvertedComponentSize = dentryNameLen + 1; myConvertedComponent = malloc(myConvertedComponentSize); if (myConvertedComponent == NULL) { ret = errno; LOG(4, ("%s: failed to malloc myConvertedComponent.\n", __FUNCTION__)); goto exit; } Str_Strcpy(myConvertedComponent, dentryName, myConvertedComponentSize); /* Success. Cleanup and exit. */ ret = 0; *convertedComponentSize = myConvertedComponentSize; *convertedComponent = myConvertedComponent; goto exit; } } /* We didn't find a match. Failure. */ ret = ENOENT; exit: if (dir) { closedir(dir); } if (ret) { *convertedComponent = NULL; *convertedComponentSize = 0; } return ret; } /* *----------------------------------------------------------------------------- * * HgfsConstructConvertedPath -- * * Expand the passed string and append the converted path. * * Results: * Returns 0 if successful, errno on failure. Note that this * function cannot return ENOENT. * * Side effects: * Reallocs the path. * *----------------------------------------------------------------------------- */ static int HgfsConstructConvertedPath(char **path, // IN/OUT size_t *pathSize, // IN/OUT char *convertedPath, // IN size_t convertedPathSize) // IN { char *p; size_t convertedPathLen = convertedPathSize - 1; ASSERT(path); ASSERT(*path); ASSERT(convertedPath); ASSERT(pathSize); p = realloc(*path, *pathSize + convertedPathLen + sizeof (DIRSEPC)); if (!p) { int error = errno; LOG(4, ("%s: failed to realloc.\n", __FUNCTION__)); return error; } *path = p; *pathSize += convertedPathLen + sizeof (DIRSEPC); /* Copy out the converted component to curDir, and free it. */ Str_Strncat(p, *pathSize, DIRSEPS, sizeof (DIRSEPS)); Str_Strncat(p, *pathSize, convertedPath, convertedPathLen); return 0; } /* *----------------------------------------------------------------------------- * * HgfsCaseInsensitiveLookup -- * * Do a case insensitive lookup for fileName. Each component past sharePath is * looked-up case-insensitively. Expensive! * * NOTE: * shareName is always expected to be a prefix of fileName. * * Results: * Returns 0 if successful and resolved path for fileName is returned in * convertedFileName and its length (without nul) in convertedFileNameLength. * Otherwise returns non-zero errno with convertedFileName and * convertedFileNameLength set to NULL and 0 respectively. * * Side effects: * On success, allocated memory is returned in convertedFileName and needs * to be freed. * *----------------------------------------------------------------------------- */ static int HgfsCaseInsensitiveLookup(const char *sharePath, // IN size_t sharePathLength, // IN char *fileName, // IN size_t fileNameLength, // IN char **convertedFileName, // OUT size_t *convertedFileNameLength) // OUT { char *currentComponent; char *nextComponent; char *curDir; size_t curDirSize; char *convertedComponent = NULL; size_t convertedComponentSize = 0; int error = 0; ASSERT(sharePath); ASSERT(fileName); ASSERT(convertedFileName); ASSERT(fileNameLength >= sharePathLength); curDirSize = sharePathLength + 1; curDir = malloc(curDirSize); if (!curDir) { error = errno; LOG(4, ("%s: failed to allocate for curDir\n", __FUNCTION__)); goto exit; } Str_Strcpy(curDir, sharePath, curDirSize); currentComponent = fileName + sharePathLength; /* Check there is something beyond the share name. */ if (*currentComponent == '\0') { /* * The fileName is the same as sharePath. Nothing else to do. * Return the duplicated sharePath string and return. */ goto exit; } /* Skip a component separator if not in the share path. */ if (*currentComponent == DIRSEPC) { currentComponent += 1; } while (TRUE) { /* Get the next component. */ nextComponent = strchr(currentComponent, DIRSEPC); if (nextComponent != NULL) { *nextComponent = '\0'; } /* * Try to match the current component against the one in curDir. * HgfsConvertComponentCase may return ENOENT. In that case return * the path case-converted uptil now (curDir) and append to it the * rest of the unconverted path. */ error = HgfsConvertComponentCase(currentComponent, curDir, (const char **)&convertedComponent, &convertedComponentSize); /* Restore the path separator if we removed it earlier. */ if (nextComponent != NULL) { *nextComponent = DIRSEPC; } if (error) { if (error == ENOENT) { /* * We could not find the current component so no need to convert it. * So it most likely a new path is to be created or an ENOENT genuine error. * Copy out the components starting from currentComponent. We do this * after replacing DIRSEPC, so all the components following * currentComponent gets copied. */ error = HgfsConstructConvertedPath(&curDir, &curDirSize, currentComponent, strlen(currentComponent) + 1); } break; } /* Expand curDir and copy out the converted component. */ error = HgfsConstructConvertedPath(&curDir, &curDirSize, convertedComponent, convertedComponentSize); if (error) { break; } /* Free the converted component. */ free(convertedComponent); convertedComponent = NULL; /* If there is no component after the current one then we are done. */ if (nextComponent == NULL) { /* Set success. */ error = 0; break; } /* * Set the current component pointer to point at the start of the next * component. */ currentComponent = nextComponent + 1; } exit: /* * If the conversion was successful, return the result. * The length does NOT include the nul terminator. */ if (error == 0) { *convertedFileName = curDir; *convertedFileNameLength = curDirSize - 1; } else { *convertedFileName = NULL; *convertedFileNameLength = 0; free(curDir); } free(convertedComponent); return error; } /* *----------------------------------------------------------------------------- * * HgfsPlatformFilenameLookup -- * * Perform a fileName lookup of the fileName if requested. * * The type of lookup depends on the flags passed. Currently, * case insensitive is checked and if set we lookup the file name. * Otherwise this function assumes the file system is the default * of case sensitive and returns a copy of the passed name. * * Results: * Returns HGFS_NAME_STATUS_COMPLETE if successful and converted * path for fileName is returned in convertedFileName and it length in * convertedFileNameLength. * * Otherwise returns non-zero integer without affecting fileName with * convertedFileName and convertedFileNameLength set to NULL and 0 * respectively. * * Side effects: * On success, allocated memory is returned in convertedFileName and needs * to be freed. * *----------------------------------------------------------------------------- */ HgfsNameStatus HgfsPlatformFilenameLookup(const char *sharePath, // IN size_t sharePathLength, // IN char *fileName, // IN size_t fileNameLength, // IN uint32 caseFlags, // IN char **convertedFileName, // OUT size_t *convertedFileNameLength) // OUT { int error = 0; HgfsNameStatus nameStatus = HGFS_NAME_STATUS_COMPLETE; ASSERT(sharePath); ASSERT(fileName); ASSERT(convertedFileName); ASSERT(convertedFileNameLength); *convertedFileName = NULL; *convertedFileNameLength = 0; /* * Case-insensitive lookup is expensive, do it only if the flag is set * and file is inaccessible using the case passed to us. We use access(2) * call to check if the passed case of the file name is correct. */ if (caseFlags == HGFS_FILE_NAME_CASE_INSENSITIVE && Posix_Access(fileName, F_OK) == -1) { LOG(4, ("%s: Case insensitive lookup, fileName: %s, flags: %u.\n", __FUNCTION__, fileName, caseFlags)); error = HgfsCaseInsensitiveLookup(sharePath, sharePathLength, fileName, fileNameLength, convertedFileName, convertedFileNameLength); /* * Map the success or an error code. */ switch (error) { /* * 0 means that HgfsCaseInsensitiveLookup completed * successfully built the converted name thus we return * HGFS_NAME_STATUS_COMPLETE in this case. */ case 0: nameStatus = HGFS_NAME_STATUS_COMPLETE; break; case ENOTDIR: nameStatus = HGFS_NAME_STATUS_NOT_A_DIRECTORY; break; default: nameStatus = HGFS_NAME_STATUS_FAILURE; break; } return nameStatus; } *convertedFileName = strdup(fileName); if (!*convertedFileName) { nameStatus = HGFS_NAME_STATUS_OUT_OF_MEMORY; LOG(4, ("%s: strdup on fileName failed.\n", __FUNCTION__)); } else { *convertedFileNameLength = fileNameLength; } return nameStatus; } /* *----------------------------------------------------------------------------- * * HgfsPlatformDoFilenameLookup -- * * Determines if the file name lookup depending on case flags is required. * * Results: * TRUE on Linux / Apple. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsPlatformDoFilenameLookup(void) { return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsEffectivePermissions -- * * Get permissions that are in efffect for the current user. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsEffectivePermissions(char *fileName, // IN: Input filename Bool readOnlyShare, // IN: Share name uint32 *permissions) // OUT: Effective permissions { *permissions = 0; if (Posix_Access(fileName, R_OK) == 0) { *permissions |= HGFS_PERM_READ; } if (Posix_Access(fileName, X_OK) == 0) { *permissions |= HGFS_PERM_EXEC; } if (!readOnlyShare && (Posix_Access(fileName, W_OK) == 0)) { *permissions |= HGFS_PERM_WRITE; } return 0; } /* *----------------------------------------------------------------------------- * * HgfsGetCreationTime -- * * Calculates actual or emulated file creation time from stat structure. * Definition of stat structure are different on diferent platforms. * This function hides away all these differences and produces 64 bit value * which should be reported to the client. * * Results: * Value that should be used as a file creation time stamp. * The resulting timestamp is in platform independent HGFS format. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static uint64 HgfsGetCreationTime(const struct stat *stats) { uint64 creationTime; /* * Linux and FreeBSD before v5 doesn't know about creation time; we just use the time * of last data modification for the creation time. * FreeBSD 5+ supprots file creation time. * * Using mtime when creation time is unavailable to be consistent with SAMBA. */ #ifdef __FreeBSD__ /* * FreeBSD: All supported versions have timestamps with nanosecond resolution. * FreeBSD 5+ has also file creation time. */ # if __IS_FREEBSD_VER__(500043) creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_birthtimespec); # else creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_mtimespec); # endif #elif defined(linux) /* * Linux: Glibc 2.3+ has st_Xtim. Glibc 2.1/2.2 has st_Xtime/__unusedX on * same place (see below). We do not support Glibc 2.0 or older. */ # if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) && !defined(__UCLIBC__) /* * stat structure is same between glibc 2.3 and older glibcs, just * these __unused fields are always zero. If we'll use __unused* * instead of zeroes, we get automatically nanosecond timestamps * when running on host which provides them. */ creationTime = HgfsConvertToNtTime(stats->st_mtime, stats->__unused2); # else creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_mtim); # endif #elif defined(__APPLE__) creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_birthtimespec); #else /* * Solaris: No nanosecond timestamps, no file create timestamp. */ creationTime = HgfsConvertToNtTime(stats->st_mtime, 0); #endif return creationTime; } /* *----------------------------------------------------------------------------- * * HgfsStat -- * * Wrapper function that invokes stat on Mac OS and on Linux. * * Returns filled stat structure and a file creation time. File creation time is * the birthday time for Mac OS and last write time for Linux (which does not support * file creation time). * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static int HgfsStat(const char* fileName, // IN: file name Bool followLink, // IN: If true then follow symlink struct stat *stats, // OUT: file attributes uint64 *creationTime) // OUT: file creation time { int error; #if defined(__APPLE__) if (followLink) { error = stat(fileName, stats); } else { error = lstat(fileName, stats); } #else if (followLink) { error = Posix_Stat(fileName, stats); } else { error = Posix_Lstat(fileName, stats); } #endif *creationTime = HgfsGetCreationTime(stats); return error; } /* *----------------------------------------------------------------------------- * * HgfsFStat -- * * Wrapper function that invokes fstat. * * Returns filled stat structure and a file creation time. File creation time is * the birthday time for Mac OS and last write time for Linux (which does not support * file creation time). * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static int HgfsFStat(int fd, // IN: file descriptor struct stat *stats, // OUT: file attributes uint64 *creationTime) // OUT: file creation time { int error = 0; if (fstat(fd, stats) < 0) { error = errno; } *creationTime = HgfsGetCreationTime(stats); return error; } /* *---------------------------------------------------------------------------- * * HgfsGetSequentialOnlyFlagFromName -- * * Certain files like 'kallsyms' residing in /proc/ filesystem can be * copied only if they are opened in sequential mode. Check for such files * and set the 'sequential only' flag. This is done by trying to read the file * content using 'pread'. If 'pread' fails with ESPIPE then they are * tagged as 'sequential only' files. * * Results: * None. * * Side effects: * None * *---------------------------------------------------------------------------- */ static void HgfsGetSequentialOnlyFlagFromName(const char *fileName, // IN Bool followSymlinks, // IN: If true then follow symlink HgfsFileAttrInfo *attr) // IN/OUT { #if defined(__linux) || defined(__APPLE__) int fd; int openFlags; if ((NULL == fileName) || (NULL == attr)) { return; } /* * We're not interested in creating a new file. So let's just get the * flags for a simple open request. This really should always work. */ HgfsServerGetOpenFlags(0, &openFlags); /* * By default we don't follow symlinks, O_NOFOLLOW is always set. * Unset it if followSymlinks config option is specified. */ if (followSymlinks) { openFlags &= ~O_NOFOLLOW; } /* * Checking for a FIFO we open in nonblocking mode. In this case, opening for * read only will succeed even if no-one has opened on the write side yet, * opening for write only will fail with ENXIO (no such device or address) * unless the other end has already been opened. * Note, Under Linux, opening a FIFO for read and write will succeed both * in blocking and nonblocking mode. POSIX leaves this behavior undefined. */ fd = Posix_Open(fileName, openFlags | O_RDONLY); if (fd < 0) { LOG(4, ("%s: Couldn't open the file \"%s\"\n", __FUNCTION__, fileName)); return; } HgfsGetSequentialOnlyFlagFromFd(fd, attr); close(fd); return; #endif } /* *---------------------------------------------------------------------------- * * HgfsGetSequentialOnlyFlagFromFd -- * * Certain files like 'kallsyms' residing in /proc/ filesystem can be * copied only if they are opened in sequential mode. Check for such files * and set the 'sequential only' flag. This is done by trying to read the file * content using 'pread'. If 'pread' fails with ESPIPE then they are * tagged as 'sequential only' files. * * Results: * None. * * Side effects: * None * *---------------------------------------------------------------------------- */ static void HgfsGetSequentialOnlyFlagFromFd(int fd, // IN HgfsFileAttrInfo *attr) // IN/OUT { #if defined(__linux) || defined(__APPLE__) int error; char buffer[2]; struct stat stats; if (NULL == attr) { return; } if (fstat(fd, &stats) < 0) { return; } if (S_ISDIR(stats.st_mode) || S_ISLNK(stats.st_mode)) { return; } /* * At this point in the code, we are not reading any amount of data from the * file. We just want to check the behavior of pread. Since we are not * reading any data, we can call pread with size specified as 0. */ error = pread(fd, buffer, 0, 0); LOG(4, ("%s: pread returned %d, errno %d\n", __FUNCTION__, error, errno)); if ((-1 == error) && (ESPIPE == errno)) { LOG(4, ("%s: Marking the file as 'Sequential only' file\n", __FUNCTION__)); attr->flags |= HGFS_ATTR_SEQUENTIAL_ONLY; } return; #endif } /* *----------------------------------------------------------------------------- * * HgfsPlatformGetattrFromName -- * * Performs a stat operation on the given filename, and, if it is a symlink, * allocates the target filename on behalf of the caller and performs a * readlink to get it. If not a symlink, the targetName argument is * untouched. Does necessary translation between Unix file stats and the * HgfsFileAttrInfo formats. * NOTE: The function is different from HgfsGetAttrFromId: this function returns * effectve permissions while HgfsGetAttrFromId does not. * The reason for this asymmetry is that effective permissions are needed * to get a new handle. If the file is already opened then * getting effective permissions does not have any value. However getting * effective permissions would hurt perfomance and should be avoided. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformGetattrFromName(char *fileName, // IN/OUT: Input filename HgfsShareOptions configOptions, // IN: Share config options char *shareName, // IN: Share name HgfsFileAttrInfo *attr, // OUT: Struct to copy into char **targetName) // OUT: Symlink target { HgfsInternalStatus status = 0; struct stat stats; int error; char *myTargetName = NULL; uint64 creationTime; Bool followSymlinks; ASSERT(fileName); ASSERT(attr); LOG(4, ("%s: getting attrs for \"%s\"\n", __FUNCTION__, fileName)); followSymlinks = HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS), error = HgfsStat(fileName, followSymlinks, &stats, &creationTime); if (error) { status = errno; LOG(4, ("%s: error stating file: %s\n", __FUNCTION__, strerror(status))); goto exit; } /* * Deal with the file type returned from lstat(2). We currently support * regular files, directories, and symlinks. On Mac OS, we'll additionally * treat finder aliases as symlinks. */ if (S_ISDIR(stats.st_mode)) { attr->type = HGFS_FILE_TYPE_DIRECTORY; LOG(4, ("%s: is a directory\n", __FUNCTION__)); } else if (S_ISLNK(stats.st_mode)) { attr->type = HGFS_FILE_TYPE_SYMLINK; LOG(4, ("%s: is a symlink\n", __FUNCTION__)); /* * In the case of a symlink, we should populate targetName if the * caller asked. Use st_size and readlink() to do so. */ if (targetName != NULL) { myTargetName = Posix_ReadLink(fileName); if (myTargetName == NULL) { error = errno; LOG(4, ("%s: readlink returned wrong size\n", __FUNCTION__)); /* * Because of an unavoidable race between the lstat(2) and the * readlink(2), the symlink target may have lengthened and we may * not have read the entire link. If that happens, just return * "out of memory". */ status = error ? error : ENOMEM; goto exit; } } } else { /* * Now is a good time to check if the file was an alias. If so, we'll * treat it as a symlink. * * XXX: If HgfsGetattrResolveAlias fails, we'll treat the file as a * regular file. This isn't completely correct (the function may have * failed because we're out of memory), but it's better than having to * call LScopyItemInfoForRef for each file, which may negatively affect * performance. See: * * http://lists.apple.com/archives/carbon-development/2001/Nov/msg00007.html */ LOG(4, ("%s: NOT a directory or symlink\n", __FUNCTION__)); if (HgfsGetattrResolveAlias(fileName, &myTargetName)) { LOG(4, ("%s: could not resolve file aliases\n", __FUNCTION__)); } attr->type = HGFS_FILE_TYPE_REGULAR; if (myTargetName != NULL) { /* * At this point the alias target has been successfully resolved. If * the alias target is inside the same shared folder then convert it * to relative path. Converting to a relative path produces a symlink * that points to the target file in the guest OS. If the target lies * outside the shared folder then treat it the same way as if alias * has not been resolved - we drop the error and treat as a regular file! */ HgfsNameStatus nameStatus; size_t sharePathLen; const char* sharePath; nameStatus = HgfsServerPolicy_GetSharePath(shareName, strlen(shareName), HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, &sharePath); if (nameStatus == HGFS_NAME_STATUS_COMPLETE && sharePathLen < strlen(myTargetName) && Str_Strncmp(sharePath, myTargetName, sharePathLen) == 0) { char *relativeName; relativeName = HgfsServerGetTargetRelativePath(fileName, myTargetName); free(myTargetName); myTargetName = relativeName; if (myTargetName != NULL) { /* * Let's mangle the permissions and size of the file so that * it more closely resembles a symlink. The size should be * the length of the target name (not including the * nul-terminator), and the permissions should be 777. */ stats.st_size = strlen(myTargetName); stats.st_mode |= ACCESSPERMS; attr->type = HGFS_FILE_TYPE_SYMLINK; } else { LOG(4, ("%s: out of memory\n", __FUNCTION__)); } } else { LOG(4, ("%s: alias target is outside shared folder\n", __FUNCTION__)); } } } if (myTargetName != NULL && targetName != NULL) { #if defined(__APPLE__) /* * HGFS clients will expect filenames in unicode normal form C * (precomposed) so Mac hosts must convert from normal form D * (decomposed). */ if (!CodeSet_Utf8FormDToUtf8FormC(myTargetName, strlen(myTargetName), targetName, NULL)) { LOG(4, ("%s: Unable to normalize form C \"%s\"\n", __FUNCTION__, myTargetName)); status = HgfsPlatformConvertFromNameStatus(HGFS_NAME_STATUS_FAILURE); goto exit; } #else *targetName = myTargetName; myTargetName = NULL; #endif LOG(4, ("%s: symlink target \"%s\"\n", __FUNCTION__, *targetName)); } HgfsStatToFileAttr(&stats, &creationTime, attr); /* * In the case we have a Windows client, force the hidden flag. * This will be ignored by Linux, Solaris clients. */ HgfsGetHiddenAttr(fileName, attr); HgfsGetSequentialOnlyFlagFromName(fileName, followSymlinks, attr); /* Get effective permissions if we can */ if (!(S_ISLNK(stats.st_mode))) { HgfsOpenMode shareMode; uint32 permissions; HgfsNameStatus nameStatus; nameStatus = HgfsServerPolicy_GetShareMode(shareName, strlen(shareName), &shareMode); if (nameStatus == HGFS_NAME_STATUS_COMPLETE && HgfsEffectivePermissions(fileName, shareMode == HGFS_OPEN_MODE_READ_ONLY, &permissions) == 0) { attr->mask |= HGFS_ATTR_VALID_EFFECTIVE_PERMS; attr->effectivePerms = permissions; } } exit: free(myTargetName); return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformGetattrFromFd -- * * Performs a stat operation on the given file desc. * Does necessary translation between Unix file stats and the * HgfsFileAttrInfo formats. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformGetattrFromFd(fileDesc fileDesc, // IN: file descriptor HgfsSessionInfo *session, // IN: session info HgfsFileAttrInfo *attr) // OUT: FileAttrInfo to copy into { HgfsInternalStatus status = 0; struct stat stats; int error; HgfsOpenMode shareMode; HgfsHandle handle = HGFS_INVALID_HANDLE; char *fileName = NULL; size_t fileNameLen; uint64 creationTime; ASSERT(attr); ASSERT(session); LOG(4, ("%s: getting attrs for %u\n", __FUNCTION__, fileDesc)); error = HgfsFStat(fileDesc, &stats, &creationTime); if (error) { LOG(4, ("%s: error stating file: %s\n", __FUNCTION__, strerror(error))); status = error; goto exit; } /* * For now, everything that isn't a directory or symlink is a regular * file. */ if (S_ISDIR(stats.st_mode)) { attr->type = HGFS_FILE_TYPE_DIRECTORY; LOG(4, ("%s: is a directory\n", __FUNCTION__)); } else if (S_ISLNK(stats.st_mode)) { attr->type = HGFS_FILE_TYPE_SYMLINK; LOG(4, ("%s: is a symlink\n", __FUNCTION__)); } else { attr->type = HGFS_FILE_TYPE_REGULAR; LOG(4, ("%s: NOT a directory or symlink\n", __FUNCTION__)); } HgfsStatToFileAttr(&stats, &creationTime, attr); /* * XXX - Correct share mode checking should be fully implemented. * * For now, we must ensure that the client only sees read only * attributes when the share is read only. This allows the client * to make decisions to fail write/delete operations. * It is required by clients who use file handles that * are cached, for setting attributes, renaming and deletion. */ if (!HgfsFileDesc2Handle(fileDesc, session, &handle)) { LOG(4, ("%s: could not get HGFS handle for fd %u\n", __FUNCTION__, fileDesc)); status = EBADF; goto exit; } if (!HgfsHandle2ShareMode(handle, session, &shareMode)) { LOG(4, ("%s: could not get share mode fd %u\n", __FUNCTION__, fileDesc)); status = EBADF; goto exit; } if (!HgfsHandle2FileName(handle, session, &fileName, &fileNameLen)) { LOG(4, ("%s: could not map cached target file handle %u\n", __FUNCTION__, handle)); status = EBADF; goto exit; } /* * In the case we have a Windows client, force the hidden flag. * This will be ignored by Linux, Solaris clients. */ HgfsGetHiddenAttr(fileName, attr); HgfsGetSequentialOnlyFlagFromFd(fileDesc, attr); if (shareMode == HGFS_OPEN_MODE_READ_ONLY) { /* * Share does not allow write, so tell the client * everything is read only. */ if (attr->mask & HGFS_ATTR_VALID_OWNER_PERMS) { attr->ownerPerms &= ~HGFS_PERM_WRITE; } if (attr->mask & HGFS_ATTR_VALID_GROUP_PERMS) { attr->groupPerms &= ~HGFS_PERM_WRITE; } if (attr->mask & HGFS_ATTR_VALID_OTHER_PERMS) { attr->otherPerms &= ~HGFS_PERM_WRITE; } } exit: free(fileName); return status; } /* *----------------------------------------------------------------------------- * * HgfsStatToFileAttr -- * * Does necessary translation between Unix file stats and the * HgfsFileAttrInfo formats. * It expects creationTime to be in platform-independent HGFS format and * stats in a platform-specific stat format. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsStatToFileAttr(struct stat *stats, // IN: stat information uint64 *creationTime, // IN: file creation time HgfsFileAttrInfo *attr) // OUT: FileAttrInfo to copy into { attr->size = stats->st_size; attr->allocationSize = stats->st_blocks * 512; attr->creationTime = *creationTime; #ifdef __FreeBSD__ /* * FreeBSD: All supported versions have timestamps with nanosecond resolution. * FreeBSD 5+ has also file creation time. */ attr->accessTime = HgfsConvertTimeSpecToNtTime(&stats->st_atimespec); attr->writeTime = HgfsConvertTimeSpecToNtTime(&stats->st_mtimespec); attr->attrChangeTime = HgfsConvertTimeSpecToNtTime(&stats->st_ctimespec); #elif defined(linux) /* * Linux: Glibc 2.3+ has st_Xtim. Glibc 2.1/2.2 has st_Xtime/__unusedX on * same place (see below). We do not support Glibc 2.0 or older. */ # if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) && !defined(__UCLIBC__) /* * stat structure is same between glibc 2.3 and older glibcs, just * these __unused fields are always zero. If we'll use __unused* * instead of zeroes, we get automatically nanosecond timestamps * when running on host which provides them. */ attr->accessTime = HgfsConvertToNtTime(stats->st_atime, stats->__unused1); attr->writeTime = HgfsConvertToNtTime(stats->st_mtime, stats->__unused2); attr->attrChangeTime = HgfsConvertToNtTime(stats->st_ctime, stats->__unused3); # else attr->accessTime = HgfsConvertTimeSpecToNtTime(&stats->st_atim); attr->writeTime = HgfsConvertTimeSpecToNtTime(&stats->st_mtim); attr->attrChangeTime = HgfsConvertTimeSpecToNtTime(&stats->st_ctim); # endif #else /* * Solaris, Mac OS: No nanosecond timestamps. */ attr->accessTime = HgfsConvertToNtTime(stats->st_atime, 0); attr->writeTime = HgfsConvertToNtTime(stats->st_mtime, 0); attr->attrChangeTime = HgfsConvertToNtTime(stats->st_ctime, 0); #endif attr->specialPerms = (stats->st_mode & (S_ISUID | S_ISGID | S_ISVTX)) >> 9; attr->ownerPerms = (stats->st_mode & S_IRWXU) >> 6; attr->groupPerms = (stats->st_mode & S_IRWXG) >> 3; attr->otherPerms = stats->st_mode & S_IRWXO; LOG(4, ("%s: done, permissions %o%o%o%o, size %"FMT64"u\n", __FUNCTION__, attr->specialPerms, attr->ownerPerms, attr->groupPerms, attr->otherPerms, attr->size)); #ifdef __FreeBSD__ # if !defined(VM_X86_64) && __FreeBSD_version >= 500043 # define FMTTIMET "" # else # define FMTTIMET "l" # endif #else # define FMTTIMET "l" #endif LOG(4, ("access: %"FMTTIMET"d/%"FMT64"u \nwrite: %"FMTTIMET"d/%"FMT64"u \n" "attr: %"FMTTIMET"d/%"FMT64"u\n", stats->st_atime, attr->accessTime, stats->st_mtime, attr->writeTime, stats->st_ctime, attr->attrChangeTime)); #undef FMTTIMET attr->userId = stats->st_uid; attr->groupId = stats->st_gid; attr->hostFileId = stats->st_ino; attr->volumeId = stats->st_dev; attr->mask = HGFS_ATTR_VALID_TYPE | HGFS_ATTR_VALID_SIZE | HGFS_ATTR_VALID_ALLOCATION_SIZE | HGFS_ATTR_VALID_CREATE_TIME | HGFS_ATTR_VALID_ACCESS_TIME | HGFS_ATTR_VALID_WRITE_TIME | HGFS_ATTR_VALID_CHANGE_TIME | HGFS_ATTR_VALID_SPECIAL_PERMS | HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | HGFS_ATTR_VALID_OTHER_PERMS | HGFS_ATTR_VALID_USERID | HGFS_ATTR_VALID_GROUPID | HGFS_ATTR_VALID_FILEID | HGFS_ATTR_VALID_VOLID; } /* *----------------------------------------------------------------------------- * * HgfsSetattrMode -- * * Set the permissions based on stat and attributes. * * Results: * TRUE if permissions have changed. * FALSE otherwise. * * Note that newPermissions is always set. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsSetattrMode(struct stat *statBuf, // IN: stat info HgfsFileAttrInfo *attr, // IN: attrs to set mode_t *newPermissions) // OUT: new perms { Bool permsChanged = FALSE; ASSERT(statBuf); ASSERT(attr); ASSERT(newPermissions); *newPermissions = 0; if (attr->mask & HGFS_ATTR_VALID_SPECIAL_PERMS) { *newPermissions |= attr->specialPerms << 9; permsChanged = TRUE; } else { *newPermissions |= statBuf->st_mode & (S_ISUID | S_ISGID | S_ISVTX); } if (attr->mask & HGFS_ATTR_VALID_OWNER_PERMS) { *newPermissions |= attr->ownerPerms << 6; permsChanged = TRUE; } else { *newPermissions |= statBuf->st_mode & S_IRWXU; } if (attr->mask & HGFS_ATTR_VALID_GROUP_PERMS) { *newPermissions |= attr->groupPerms << 3; permsChanged = TRUE; } else { *newPermissions |= statBuf->st_mode & S_IRWXG; } if (attr->mask & HGFS_ATTR_VALID_OTHER_PERMS) { *newPermissions |= attr->otherPerms; permsChanged = TRUE; } else { *newPermissions |= statBuf->st_mode & S_IRWXO; } return permsChanged; } /* *----------------------------------------------------------------------------- * * HgfsSetattrOwnership -- * * Set the user and group ID based the attributes. * * Results: * TRUE if ownership has changed. * FALSE otherwise. * * Note that newUid/newGid are always set. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsSetattrOwnership(HgfsFileAttrInfo *attr, // IN: attrs to set uid_t *newUid, // OUT: new user ID gid_t *newGid) // OUT: new group ID { Bool idChanged = FALSE; ASSERT(attr); ASSERT(newUid); ASSERT(newGid); *newUid = *newGid = -1; if (attr->mask & HGFS_ATTR_VALID_USERID) { *newUid = attr->userId; idChanged = TRUE; } if (attr->mask & HGFS_ATTR_VALID_GROUPID) { *newGid = attr->groupId; idChanged = TRUE; } return idChanged; } /* *----------------------------------------------------------------------------- * * HgfsSetattrTimes -- * * Set the time stamps based on stat and attributes. * * Results: * Zero on success. accessTime/modTime contain new times. * Non-zero on failure. * * Note that timesChanged is always set. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsSetattrTimes(struct stat *statBuf, // IN: stat info HgfsFileAttrInfo *attr, // IN: attrs to set HgfsAttrHint hints, // IN: attr hints Bool useHostTime, // IN: use the current host time struct timeval *accessTime, // OUT: access time struct timeval *modTime, // OUT: modification time Bool *timesChanged) // OUT: times changed { HgfsInternalStatus status = 0; int error; ASSERT(statBuf); ASSERT(attr); ASSERT(accessTime); ASSERT(modTime); ASSERT(timesChanged); *timesChanged = FALSE; if (attr->mask & (HGFS_ATTR_VALID_ACCESS_TIME | HGFS_ATTR_VALID_WRITE_TIME)) { /* * utime(2) only lets you update both atime and mtime at once, so * if either one needs updating, first we get the current times * and call utime with some combination of the current and new * times. This is a bit racy because someone else could update * one of them in between, but this seems to be how "touch" does * things, so we'll go with it. [bac] */ if ((attr->mask & (HGFS_ATTR_VALID_ACCESS_TIME | HGFS_ATTR_VALID_WRITE_TIME)) != (HGFS_ATTR_VALID_ACCESS_TIME | HGFS_ATTR_VALID_WRITE_TIME)) { /* * XXX Set also usec from nsec stat fields. */ accessTime->tv_sec = statBuf->st_atime; accessTime->tv_usec = 0; modTime->tv_sec = statBuf->st_mtime; modTime->tv_usec = 0; } /* * If times need updating, we either use the guest-provided time or the * host time. HGFS_ATTR_HINT_SET_x_TIME_ will be set if we should use * the guest time, and useHostTime will be TRUE if the config * option to always use host time is set. */ if (attr->mask & HGFS_ATTR_VALID_ACCESS_TIME) { if (!useHostTime && (hints & HGFS_ATTR_HINT_SET_ACCESS_TIME)) { /* Use the guest-provided time */ struct timespec ts; HgfsConvertFromNtTimeNsec(&ts, attr->accessTime); accessTime->tv_sec = ts.tv_sec; accessTime->tv_usec = ts.tv_nsec / 1000; } else { /* Use the host's time */ struct timeval tv; if (gettimeofday(&tv, NULL) != 0) { error = errno; LOG(4, ("%s: gettimeofday error: %s\n", __FUNCTION__, strerror(error))); status = error; goto exit; } accessTime->tv_sec = tv.tv_sec; accessTime->tv_usec = tv.tv_usec; } } if (attr->mask & HGFS_ATTR_VALID_WRITE_TIME) { if (!useHostTime && (hints & HGFS_ATTR_HINT_SET_WRITE_TIME)) { struct timespec ts; HgfsConvertFromNtTimeNsec(&ts, attr->writeTime); modTime->tv_sec = ts.tv_sec; modTime->tv_usec = ts.tv_nsec / 1000; } else { struct timeval tv; if (gettimeofday(&tv, NULL) != 0) { error = errno; LOG(4, ("%s: gettimeofday error: %s\n", __FUNCTION__, strerror(error))); status = error; goto exit; } modTime->tv_sec = tv.tv_sec; modTime->tv_usec = tv.tv_usec; } } *timesChanged = TRUE; } exit: return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformSetattrFromFd -- * * Handle a Setattr request by file descriptor. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformSetattrFromFd(HgfsHandle file, // IN: file descriptor HgfsSessionInfo *session, // IN: session info HgfsFileAttrInfo *attr, // OUT: attrs to set HgfsAttrHint hints, // IN: attr hints Bool useHostTime) // IN: use current host time { HgfsInternalStatus status = 0, timesStatus; int error; struct stat statBuf; struct timeval times[2]; mode_t newPermissions; uid_t newUid = -1; gid_t newGid = -1; Bool permsChanged = FALSE; Bool timesChanged = FALSE; Bool idChanged = FALSE; int fd; HgfsLockType serverLock; ASSERT(session); ASSERT(file != HGFS_INVALID_HANDLE); status = HgfsPlatformGetFd(file, session, FALSE, &fd); if (status != 0) { LOG(4, ("%s: Could not get file descriptor\n", __FUNCTION__)); goto exit; } /* We need the old stats so that we can preserve times. */ if (fstat(fd, &statBuf) == -1) { error = errno; LOG(4, ("%s: error stating file %u: %s\n", __FUNCTION__, fd, strerror(error))); status = error; goto exit; } /* * Try to make each requested attribute change. In the event that * one operation fails, we still attempt to perform any other * operations that the driver requested. We return success only * if all operations succeeded. */ idChanged = HgfsSetattrOwnership(attr, &newUid, &newGid); if (idChanged) { LOG(4, ("%s: set uid %"FMTUID" and gid %"FMTUID"\n", __FUNCTION__, newUid, newGid)); if (fchown(fd, newUid, newGid) < 0) { error = errno; LOG(4, ("%s: error chowning file %u: %s\n", __FUNCTION__, fd, strerror(error))); status = error; } } /* * Set permissions based on what we got in the packet. If we didn't get * a particular bit, use the existing permissions. In that case we don't * toggle permsChanged since it should not influence our decision of * whether to actually call chmod or not. * * NOTE: Setting ownership clears SUID and SGID bits, therefore set the * file permissions after setting ownership. */ permsChanged = HgfsSetattrMode(&statBuf, attr, &newPermissions); if (permsChanged) { LOG(4, ("%s: set mode %o\n", __FUNCTION__, (unsigned)newPermissions)); if (fchmod(fd, newPermissions) < 0) { error = errno; LOG(4, ("%s: error chmoding file %u: %s\n", __FUNCTION__, fd, strerror(error))); status = error; } } if (attr->mask & HGFS_ATTR_VALID_SIZE) { /* * XXX: Truncating the file will trigger an oplock break. The client * should have predicted this and removed the oplock prior to sending * the truncate request. At this point, the server must safeguard itself * against deadlock. */ if (!HgfsHandle2ServerLock(file, session, &serverLock)) { LOG(4, ("%s: File handle is no longer valid.\n", __FUNCTION__)); status = EBADF; } else if (serverLock != HGFS_LOCK_NONE) { LOG(4, ("%s: Client attempted to truncate an oplocked file\n", __FUNCTION__)); status = EBUSY; } else if (ftruncate(fd, attr->size) < 0) { error = errno; LOG(4, ("%s: error truncating file %u: %s\n", __FUNCTION__, fd, strerror(error))); status = error; } else { LOG(4, ("%s: set size %"FMT64"u\n", __FUNCTION__, attr->size)); } } /* Setting hidden attribute for symlink itself is not supported. */ if ((attr->mask & HGFS_ATTR_VALID_FLAGS) && !S_ISLNK(statBuf.st_mode)) { char *localName; size_t localNameSize; if (HgfsHandle2FileName(file, session, &localName, &localNameSize)) { status = HgfsSetHiddenXAttr(localName, (attr->flags & HGFS_ATTR_HIDDEN) != 0, newPermissions); free(localName); } } timesStatus = HgfsSetattrTimes(&statBuf, attr, hints, useHostTime, ×[0], ×[1], ×Changed); if (timesStatus == 0 && timesChanged) { uid_t uid = (uid_t)-1; Bool switchToSuperUser = FALSE; LOG(4, ("%s: setting new times\n", __FUNCTION__)); /* * If the VMX is neither the file owner nor running as root, return an error. * Otherwise if we are not the file owner switch to superuser briefly * to set the files times using futimes. */ if (geteuid() != statBuf.st_uid) { /* We are not the file owner. Check if we are running as root. */ if (!Id_IsSuperUser()) { LOG(4, ("%s: only owner of file %u or root can call futimes\n", __FUNCTION__, fd)); /* XXX: Linux kernel says both EPERM and EACCES are valid here. */ status = EPERM; goto exit; } uid = Id_BeginSuperUser(); switchToSuperUser = TRUE; } /* * XXX Newer glibc provide also lutimes() and futimes() * when we politely ask with -D_GNU_SOURCE -D_BSD_SOURCE */ if (futimes(fd, times) < 0) { if (!switchToSuperUser) { /* * Check bug 718252. If futimes() fails, switch to * superuser briefly and try futimes() one more time. */ uid = Id_BeginSuperUser(); switchToSuperUser = TRUE; if (futimes(fd, times) < 0) { error = errno; LOG(4, ("%s: Executing futimes as owner on file: %u " "failed with error: %s\n", __FUNCTION__, fd, strerror(error))); status = error; } } else { error = errno; LOG(4, ("%s: Executing futimes as superuser on file: %u " "failed with error: %s\n", __FUNCTION__, fd, strerror(error))); status = error; } } if (switchToSuperUser) { Id_EndSuperUser(uid); } } else if (timesStatus != 0) { status = timesStatus; } exit: return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformSetattrFromName -- * * Handle a Setattr request by name. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformSetattrFromName(char *localName, // IN: Name HgfsFileAttrInfo *attr, // IN: attrs to set HgfsShareOptions configOptions, // IN: share options HgfsAttrHint hints, // IN: attr hints Bool useHostTime) // IN: use current host time { HgfsInternalStatus status = 0, timesStatus; struct stat statBuf; struct timeval times[2]; mode_t newPermissions; uid_t newUid = -1; gid_t newGid = -1; Bool permsChanged = FALSE; Bool timesChanged = FALSE; Bool idChanged = FALSE; int error; ASSERT(localName); if (!HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS)) { /* * If followSymlink option is not set, verify that the pathname isn't a * symlink. Some of the following syscalls (chmod, for example) will * follow a link. So we need to verify the final component too. The * parent has already been verified in HgfsServerGetAccess. * * XXX: This is racy. But clients interested in preventing a race should * have sent us a Setattr packet with a valid HGFS handle. */ if (File_IsSymLink(localName)) { LOG(4, ("%s: pathname contains a symlink\n", __FUNCTION__)); status = EINVAL; goto exit; } } LOG(4, ("%s: setting attrs for \"%s\"\n", __FUNCTION__, localName)); /* We need the old stats so that we can preserve times. */ if (Posix_Lstat(localName, &statBuf) == -1) { error = errno; LOG(4, ("%s: error stating file \"%s\": %s\n", __FUNCTION__, localName, strerror(error))); status = error; goto exit; } /* * Try to make each requested attribute change. In the event that * one operation fails, we still attempt to perform any other * operations that the driver requested. We return success only * if all operations succeeded. */ idChanged = HgfsSetattrOwnership(attr, &newUid, &newGid); /* * Chown changes the uid and gid together. If one of them should * not be changed, we pass in -1. */ if (idChanged) { if (Posix_Lchown(localName, newUid, newGid) < 0) { error = errno; LOG(4, ("%s: error chowning file \"%s\": %s\n", __FUNCTION__, localName, strerror(error))); status = error; } } /* * Set permissions based on what we got in the packet. If we didn't get * a particular bit, use the existing permissions. In that case we don't * toggle permsChanged since it should not influence our decision of * whether to actually call chmod or not. * * NOTE: Setting ownership clears SUID and SGID bits, therefore set the * file permissions after setting ownership. */ permsChanged = HgfsSetattrMode(&statBuf, attr, &newPermissions); if (permsChanged) { LOG(4, ("%s: set mode %o\n", __FUNCTION__, (unsigned)newPermissions)); if (Posix_Chmod(localName, newPermissions) < 0) { error = errno; LOG(4, ("%s: error chmoding file \"%s\": %s\n", __FUNCTION__, localName, strerror(error))); status = error; } } if (attr->mask & HGFS_ATTR_VALID_SIZE) { if (Posix_Truncate(localName, attr->size) < 0) { error = errno; LOG(4, ("%s: error truncating file \"%s\": %s\n", __FUNCTION__, localName, strerror(error))); status = error; } else { LOG(4, ("%s: set size %"FMT64"u\n", __FUNCTION__, attr->size)); } } if (attr->mask & HGFS_ATTR_VALID_FLAGS) { status = HgfsSetHiddenXAttr(localName, (attr->flags & HGFS_ATTR_HIDDEN) != 0, newPermissions); } timesStatus = HgfsSetattrTimes(&statBuf, attr, hints, useHostTime, ×[0], ×[1], ×Changed); if (timesStatus == 0 && timesChanged) { /* * XXX Newer glibc provide also lutimes() and futimes() * when we politely ask with -D_GNU_SOURCE -D_BSD_SOURCE */ if (Posix_Utimes(localName, times) < 0) { error = errno; LOG(4, ("%s: utimes error on file \"%s\": %s\n", __FUNCTION__, localName, strerror(error))); status = error; } } else if (timesStatus != 0) { status = timesStatus; } exit: return status; } HgfsInternalStatus HgfsPlatformWriteWin32Stream(HgfsHandle file, // IN: packet header char *dataToWrite, // IN: request type size_t requiredSize, Bool doSecurity, uint32 *actualSize, HgfsSessionInfo *session) { return EPROTO; } /* *----------------------------------------------------------------------------- * * HgfsPlatformVDirStatsFs -- * * Handle a statfs (query volume information) request for a virtual folder. * * Results: * HGFS_ERROR_SUCCESS or an appropriate error code. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformVDirStatsFs(HgfsSessionInfo *session, // IN: session info HgfsNameStatus nameStatus, // IN: VolumeInfoType infoType, // IN: uint64 *outFreeBytes, // OUT: uint64 *outTotalBytes) // OUT: { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; HgfsInternalStatus firstErr = HGFS_ERROR_SUCCESS; Bool firstShare = TRUE; size_t failed = 0; size_t shares = 0; DirectoryEntry *dent; HgfsHandle handle; ASSERT(nameStatus != HGFS_NAME_STATUS_COMPLETE); switch (nameStatus) { case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* * This is the base of our namespace. Clients can request a * QueryVolumeInfo on it, on individual shares, or on just about * any pathname. */ LOG(4,("%s: opened search on base\n", __FUNCTION__)); status = HgfsServerSearchVirtualDir(HgfsServerResEnumGet, HgfsServerResEnumInit, HgfsServerResEnumExit, DIRECTORY_SEARCH_TYPE_BASE, session, &handle); if (status != HGFS_ERROR_SUCCESS) { break; } /* * Now go through all shares and get share paths on the server. * Then retrieve space info for each share's volume. */ while ((status = HgfsServerGetDirEntry(handle, session, HGFS_SEARCH_LAST_ENTRY_INDEX, TRUE, &dent)) == HGFS_ERROR_SUCCESS) { char const *sharePath; size_t sharePathLen; uint64 currentFreeBytes = 0; uint64 currentTotalBytes = 0; size_t length; if (NULL == dent) { break; } length = strlen(dent->d_name); /* * Now that the server is passing '.' and ".." around as dents, we * need to make sure to handle them properly. In particular, they * should be ignored within QueryVolume, as they're not real shares. */ if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) { LOG(4, ("%s: Skipping fake share %s\n", __FUNCTION__, dent->d_name)); free(dent); continue; } /* * The above check ignores '.' and '..' so we do not include them in * the share count here. */ shares++; /* * Check permission on the share and get the share path. It is not * fatal if these do not succeed. Instead we ignore the failures * (apart from logging them) until we have processed all shares. Only * then do we check if there were any failures; if all shares failed * to process then we bail out with an error code. */ nameStatus = HgfsServerPolicy_GetSharePath(dent->d_name, length, HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, &sharePath); free(dent); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("%s: No such share or access denied\n", __FUNCTION__)); if (0 == firstErr) { firstErr = HgfsPlatformConvertFromNameStatus(nameStatus); } failed++; continue; } /* * Pick the drive with amount of space available and return that * according to different volume info type. */ if (!HgfsServerStatFs(sharePath, sharePathLen, ¤tFreeBytes, ¤tTotalBytes)) { LOG(4, ("%s: error getting volume information\n", __FUNCTION__)); if (0 == firstErr) { firstErr = HGFS_ERROR_IO; } failed++; continue; } /* * Pick the drive with amount of space available and return that * according to different volume info type. */ switch (infoType) { case VOLUME_INFO_TYPE_MIN: if ((*outFreeBytes > currentFreeBytes) || firstShare) { firstShare = FALSE; *outFreeBytes = currentFreeBytes; *outTotalBytes = currentTotalBytes; } break; case VOLUME_INFO_TYPE_MAX: if ((*outFreeBytes < currentFreeBytes)) { *outFreeBytes = currentFreeBytes; *outTotalBytes = currentTotalBytes; } break; default: NOT_IMPLEMENTED(); } } if (!HgfsRemoveSearch(handle, session)) { LOG(4, ("%s: could not close search on base\n", __FUNCTION__)); } if (shares == failed) { if (firstErr != 0) { /* * We failed to query any of the shares. We return the error] * from the first share failure. */ status = firstErr; } /* No shares but no error, return zero for sizes and success. */ } break; default: LOG(4,("%s: file access check failed\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } return status; } #ifdef VMX86_LOG /* *----------------------------------------------------------------------------- * * HgfsPlatformDirDumpDents -- * * Dump a set of directory entries (debugging code). * Note: this must be called with the session search lock acquired. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsPlatformDirDumpDents(HgfsSearch *search) // IN: search { unsigned int i; ASSERT(search != NULL); Log("%s: %u dents in \"%s\"\n", __FUNCTION__, search->numDents, search->utf8Dir); for (i = 0; i < search->numDents; i++) { Log("\"%s\"\n", search->dents[i]->d_name); } } #endif /* *----------------------------------------------------------------------------- * * HgfsConvertToUtf8FormC -- * * Converts file name coming from OS to Utf8 form C. * The function NOOP on Linux where the name is already in correct * encoding. * On Mac OS the default encoding is Utf8 form D thus a convertion to * Utf8 for C is required. * * Results: * TRUE on success. Buffer has name in Utf8 form C encoding. * FALSE on error. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsConvertToUtf8FormC(char *buffer, // IN/OUT: name to normalize size_t bufferSize) // IN: size of the name buffer { #if defined(__APPLE__) size_t entryNameLen; char *entryName = NULL; Bool result; /* * HGFS clients receive names in unicode normal form C, * (precomposed) so Mac hosts must convert from normal form D * (decomposed). */ if (CodeSet_Utf8FormDToUtf8FormC(buffer, bufferSize, &entryName, &entryNameLen)) { result = entryNameLen < bufferSize; if (result) { memcpy(buffer, entryName, entryNameLen + 1); } free(entryName); } else { LOG(4, ("%s: Unable to normalize form C \"%s\"\n", __FUNCTION__, buffer)); result = FALSE; } return result; #else size_t size; /* * Buffer may contain invalid data after the null terminating character. * We need to check the validity of the buffer only till the null * terminating character (if any). Calculate the real size of the * string before calling Unicode_IsBufferValid(). */ for (size = 0; size < bufferSize ; size++) { if ('\0' == buffer[size]) { break; } } return Unicode_IsBufferValid(buffer, size, STRING_ENCODING_UTF8); #endif /* defined(__APPLE__) */ } /* *----------------------------------------------------------------------------- * * HgfsPlatformGetDirEntry -- * * Returns the directory entry (or a copy) at the given index. If remove is set * to TRUE, the existing result is also pruned and the remaining results * are shifted up in the result array. * * Results: * HGFS_ERROR_SUCCESS or an appropriate error code. * * Side effects: * None. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformGetDirEntry(HgfsSearch *search, // IN: search HgfsSessionInfo *session, // IN: Session info uint32 index, // IN: Offset to retrieve at Bool remove, // IN: If true, removes the result struct DirectoryEntry **dirEntry) // OUT: dirent { DirectoryEntry *dent = NULL; HgfsInternalStatus status = HGFS_ERROR_SUCCESS; if (index >= search->numDents) { goto out; } /* If we're not removing the result, we need to make a copy of it. */ if (remove) { /* * We're going to shift the dents array, overwriting the dent pointer at * offset, so first we need to save said pointer so that we can return it * later to the caller. */ dent = search->dents[index]; if (index < search->numDents - 1) { /* Shift up the remaining results */ memmove(&search->dents[index], &search->dents[index + 1], (search->numDents - (index + 1)) * sizeof search->dents[0]); } /* Decrement the number of results */ search->numDents--; } else { DirectoryEntry *originalDent; size_t nameLen; originalDent = search->dents[index]; ASSERT(originalDent); nameLen = strlen(originalDent->d_name); /* * Make sure the name will not overrun the d_name buffer, the end of * which is also the end of the DirectoryEntry. */ ASSERT(offsetof(DirectoryEntry, d_name) + nameLen < originalDent->d_reclen); dent = malloc(originalDent->d_reclen); if (dent == NULL) { status = HGFS_ERROR_NOT_ENOUGH_MEMORY; goto out; } /* * Yes, there are more members than this in a dirent. But if you look * at the top of hgfsServerInt.h, you'll see that on Windows we only * define d_reclen and d_name, as those are the only fields we need. */ dent->d_reclen = originalDent->d_reclen; memcpy(dent->d_name, originalDent->d_name, nameLen); dent->d_name[nameLen] = 0; } out: if (status == HGFS_ERROR_SUCCESS) { *dirEntry = dent; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformSetDirEntry -- * * Sets the directory entry into the search read information. * * Results: * HGFS_ERROR_SUCCESS or an appropriate error code. * * Side effects: * None. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformSetDirEntry(HgfsSearch *search, // IN: partially valid search HgfsShareOptions configOptions, // IN: share configuration settings HgfsSessionInfo *session, // IN: session info struct DirectoryEntry *dirEntry, // IN: the indexed dirent Bool getAttr, // IN: get the entry attributes HgfsFileAttrInfo *entryAttr, // OUT: entry attributes, optional char **entryName, // OUT: entry name uint32 *entryNameLength) // OUT: entry name length { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; unsigned int length; char *fullName; char *sharePath; size_t sharePathLen; size_t fullNameLen; HgfsLockType serverLock = HGFS_LOCK_NONE; fileDesc fileDesc; Bool unescapeName = TRUE; length = strlen(dirEntry->d_name); /* Each type of search gets a dent's attributes in a different way. */ switch (search->type) { case DIRECTORY_SEARCH_TYPE_DIR: /* * Construct the UTF8 version of the full path to the file, and call * HgfsGetattrFromName to get the attributes of the file. */ fullNameLen = search->utf8DirLen + 1 + length; fullName = (char *)malloc(fullNameLen + 1); if (fullName) { memcpy(fullName, search->utf8Dir, search->utf8DirLen); fullName[search->utf8DirLen] = DIRSEPC; memcpy(&fullName[search->utf8DirLen + 1], dirEntry->d_name, length + 1); LOG(4, ("%s: about to stat \"%s\"\n", __FUNCTION__, fullName)); /* Do we need to query the attributes information? */ if (getAttr) { /* * XXX: It is unreasonable to make the caller either 1) pass existing * handles for directory objects as part of the SearchRead, or 2) * prior to calling SearchRead on a directory, break all oplocks on * that directory's objects. * * To compensate for that, if we detect that this directory object * has an oplock, we'll quietly reuse the handle. Note that this * requires clients who take out an exclusive oplock to open a * handle with read as well as write access, otherwise we'll fail * further down in HgfsStat. * * XXX: We could open a new handle safely if its a shared oplock. * But isn't this handle sharing always desirable? */ if (HgfsFileHasServerLock(fullName, session, &serverLock, &fileDesc)) { LOG(4, ("%s: Reusing existing oplocked handle " "to avoid oplock break deadlock\n", __FUNCTION__)); status = HgfsPlatformGetattrFromFd(fileDesc, session, entryAttr); } else { status = HgfsPlatformGetattrFromName(fullName, configOptions, search->utf8ShareName, entryAttr, NULL); } if (HGFS_ERROR_SUCCESS != status) { HgfsOp savedOp = entryAttr->requestType; LOG(4, ("%s: stat FAILED %s (%d)\n", __FUNCTION__, fullName, status)); memset(entryAttr, 0, sizeof *entryAttr); entryAttr->requestType = savedOp; entryAttr->type = HGFS_FILE_TYPE_REGULAR; entryAttr->mask = HGFS_ATTR_VALID_TYPE; status = HGFS_ERROR_SUCCESS; } } free(fullName); } else { LOG(4, ("%s: could not allocate space for \"%s\\%s\"\n", __FUNCTION__, search->utf8Dir, dirEntry->d_name)); status = HGFS_ERROR_NOT_ENOUGH_MEMORY; } break; case DIRECTORY_SEARCH_TYPE_BASE: /* * We only want to unescape names that we could have escaped. * This cannot apply to our shares since they are created by the user. * The client will take care of escaping anything it requires. */ unescapeName = FALSE; if (getAttr) { /* * For a search enumerating all shares, give the default attributes * for '.' and ".." (which aren't really shares anyway). Each real * share gets resolved into its full path, and gets its attributes * via HgfsGetattrFromName. */ if (strcmp(dirEntry->d_name, ".") == 0 || strcmp(dirEntry->d_name, "..") == 0) { LOG(4, ("%s: assigning %s default attributes\n", __FUNCTION__, dirEntry->d_name)); HgfsPlatformGetDefaultDirAttrs(entryAttr); } else { HgfsNameStatus nameStatus; /* Check permission on the share and get the share path */ nameStatus = HgfsServerPolicy_GetSharePath(dirEntry->d_name, length, HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, (char const **)&sharePath); if (nameStatus == HGFS_NAME_STATUS_COMPLETE) { /* * Server needs to produce list of shares that is consistent with * the list defined in UI. If a share can't be accessed because of * problems on the host, the server still enumerates it and * returns to the client. * XXX: We will open a new handle for this, but it should be safe * from oplock-induced deadlock because these are all directories, * and thus cannot have oplocks placed on them. */ status = HgfsPlatformGetattrFromName(sharePath, configOptions, dirEntry->d_name, entryAttr, NULL); if (HGFS_ERROR_SUCCESS != status) { /* * The dent no longer exists. Log the event. */ LOG(4, ("%s: stat FAILED\n", __FUNCTION__)); status = HGFS_ERROR_SUCCESS; } } else { LOG(4, ("%s: No such share or access denied\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } } } break; case DIRECTORY_SEARCH_TYPE_OTHER: default: NOT_IMPLEMENTED(); break; } /* * We need to unescape the name before sending it back to the client */ if (HGFS_ERROR_SUCCESS == status) { *entryName = Util_SafeStrdup(dirEntry->d_name); if (unescapeName) { *entryNameLength = HgfsEscape_Undo(*entryName, length + 1); } else { *entryNameLength = length; } LOG(4, ("%s: dent name is \"%s\" len = %u\n", __FUNCTION__, *entryName, *entryNameLength)); } else { *entryName = NULL; *entryNameLength = 0; LOG(4, ("%s: error %d getting dent\n", __FUNCTION__, status)); } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformScandir -- * * The cross-platform HGFS server code will call into this function * in order to populate a list of dents. In the Linux case, we want to avoid * using scandir(3) because it makes no provisions for not following * symlinks. Instead, we'll open(2) the directory with O_DIRECTORY and * O_NOFOLLOW, call getdents(2) directly, then close(2) the directory. * * On Mac OS getdirentries became deprecated starting from 10.6 and * there is no similar API available. Thus on Mac OS readdir is used that * returns one directory entry at a time. * * Results: * Zero on success. numDents contains the number of directory entries found. * Non-zero on error. * * Side effects: * Memory allocation. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformScandir(char const *baseDir, // IN: Directory to search in size_t baseDirLen, // IN: Ignored Bool followSymlinks, // IN: followSymlinks config option struct DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys int *numDents) // OUT: Number of DirectoryEntrys { #if defined(__APPLE__) DIR *fd = NULL; #else int fd = -1; int openFlags = O_NONBLOCK | O_RDONLY | O_DIRECTORY | O_NOFOLLOW; #endif int result; DirectoryEntry **myDents = NULL; int myNumDents = 0; HgfsInternalStatus status = 0; /* * XXX: glibc uses 8192 (BUFSIZ) when it can't get st_blksize from a stat. * Should we follow its lead and use stat to get st_blksize? */ char buffer[8192]; #if defined(__APPLE__) /* * Since opendir does not support O_NOFOLLOW flag need to explicitly verify * that we are not dealing with symlink if follow symlinks is * not allowed. */ if (!followSymlinks) { struct stat st; if (lstat(baseDir, &st) == -1) { status = errno; LOG(4, ("%s: error in lstat: %d (%s)\n", __FUNCTION__, status, strerror(status))); goto exit; } if (S_ISLNK(st.st_mode)) { status = EACCES; LOG(4, ("%s: do not follow symlink\n", __FUNCTION__)); goto exit; } } fd = Posix_OpenDir(baseDir); if (NULL == fd) { status = errno; LOG(4, ("%s: error in opendir: %d (%s)\n", __FUNCTION__, status, strerror(status))); goto exit; } #else /* Follow symlinks if config option is set. */ if (followSymlinks) { openFlags &= ~O_NOFOLLOW; } /* We want a directory. No FIFOs. Symlinks only if config option is set. */ result = Posix_Open(baseDir, openFlags); if (result < 0) { status = errno; LOG(4, ("%s: error in open: %d (%s)\n", __FUNCTION__, status, strerror(status))); goto exit; } fd = result; #endif /* * Rather than read a single dent at a time, batch up multiple dents * in each call by using a buffer substantially larger than one dent. */ while ((result = getdents(fd, (void *)buffer, sizeof buffer)) > 0) { size_t offset = 0; while (offset < result) { DirectoryEntry *newDent, **newDents; newDent = (DirectoryEntry *)(buffer + offset); /* This dent had better fit in the actual space we've got left. */ ASSERT(newDent->d_reclen <= result - offset); /* Add another dent pointer to the dents array. */ newDents = realloc(myDents, sizeof *myDents * (myNumDents + 1)); if (newDents == NULL) { status = ENOMEM; goto exit; } myDents = newDents; /* * Allocate the new dent and set it up. We do a straight memcpy of * the entire record to avoid dealing with platform-specific fields. */ myDents[myNumDents] = malloc(newDent->d_reclen); if (myDents[myNumDents] == NULL) { status = ENOMEM; goto exit; } if (HgfsConvertToUtf8FormC(newDent->d_name, newDent->d_reclen - offsetof(DirectoryEntry, d_name))) { memcpy(myDents[myNumDents], newDent, newDent->d_reclen); /* * Dent is done. Bump the offset to the batched buffer to process the * next dent within it. */ myNumDents++; } else { /* * XXX: * HGFS discards all file names that can't be converted to utf8. * It is not desirable since it causes many problems like * failure to delete directories which contain such files. * Need to change this to a more reasonable behavior, similar * to name escaping which is used to deal with illegal file names. */ free(myDents[myNumDents]); } offset += newDent->d_reclen; } } if (result == -1) { status = errno; LOG(4, ("%s: error in getdents: %d (%s)\n", __FUNCTION__, status, strerror(status))); goto exit; } exit: #if defined(__APPLE__) if (NULL != fd && closedir(fd) < 0) { #else if (fd != -1 && close(fd) < 0) { #endif status = errno; LOG(4, ("%s: error in close: %d (%s)\n", __FUNCTION__, status, strerror(status))); } /* * On error, free all allocated dents. On success, set the dents pointer * given to us by the client. */ if (status != 0) { size_t i; for (i = 0; i < myNumDents; i++) { free(myDents[i]); } free(myDents); } else { *dents = myDents; *numDents = myNumDents; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformScanvdir -- * * Perform a scandir on our virtual directory. * * Get directory entry names from the given callback function, and * build an array of DirectoryEntrys of all the names. Somewhat similar to * scandir(3) on linux, but more general. * * Results: * On success, the number of directory entries found. * On failure, negative error. * * Side effects: * Memory allocation. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformScanvdir(HgfsServerResEnumGetFunc enumNamesGet, // IN: Function to get name HgfsServerResEnumInitFunc enumNamesInit, // IN: Setup function HgfsServerResEnumExitFunc enumNamesExit, // IN: Cleanup function DirectorySearchType type, // IN: Kind of search - unused struct DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys uint32 *numDents) // OUT: total number of directory entrys { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; uint32 totalDents = 0; // Number of allocated dents uint32 myNumDents = 0; // Current actual number of dents DirectoryEntry **myDents = NULL; // So realloc is happy w/ zero myNumDents void *enumNamesHandle; ASSERT(NULL != enumNamesInit); ASSERT(NULL != enumNamesGet); ASSERT(NULL != enumNamesExit); enumNamesHandle = enumNamesInit(); if (NULL == enumNamesHandle) { status = HGFS_ERROR_NOT_ENOUGH_MEMORY; LOG(4, ("%s: Error: init state ret %u\n", __FUNCTION__, status)); goto exit; } for (;;) { DirectoryEntry *currentEntry; char const *currentEntryName; size_t currentEntryNameLen; size_t currentEntryLen; size_t maxNameLen; Bool done = FALSE; /* Add '.' and ".." as the first dents. */ if (myNumDents == 0) { currentEntryName = "."; currentEntryNameLen = 1; } else if (myNumDents == 1) { currentEntryName = ".."; currentEntryNameLen = 2; } else { if (!enumNamesGet(enumNamesHandle, ¤tEntryName, ¤tEntryNameLen, &done)) { status = HGFS_ERROR_INVALID_PARAMETER; LOG(4, ("%s: Error: get next entry name ret %u\n", __FUNCTION__, status)); goto exit; } } if (done) { LOG(4, ("%s: No more names\n", __FUNCTION__)); break; } #if defined(sun) /* * Solaris lacks a single definition of NAME_MAX and using pathconf(), to * determine NAME_MAX for the current directory, is too cumbersome for * our purposes, so we use PATH_MAX as a reasonable upper bound on the * length of the name. */ maxNameLen = PATH_MAX; #else maxNameLen = sizeof currentEntry->d_name; #endif if (currentEntryNameLen >= maxNameLen) { Log("%s: Error: Name \"%s\" is too long.\n", __FUNCTION__, currentEntryName); continue; } /* See if we need to allocate more memory */ if (myNumDents == totalDents) { void *p; if (totalDents != 0) { totalDents *= 2; } else { totalDents = 100; } p = realloc(myDents, totalDents * sizeof *myDents); if (NULL == p) { status = HGFS_ERROR_NOT_ENOUGH_MEMORY; LOG(4, ("%s: Error: realloc growing array memory ret %u\n", __FUNCTION__, status)); goto exit; } myDents = p; } /* This file/directory can be added to the list. */ LOG(4, ("%s: Nextfilename = \"%s\"\n", __FUNCTION__, currentEntryName)); /* * Start with the size of the DirectoryEntry struct, subtract the static * length of the d_name buffer (256 in Linux, 1 in Solaris, etc) and add * back just enough space for the UTF-8 name and nul terminator. */ currentEntryLen = offsetof(DirectoryEntry, d_name) + currentEntryNameLen + 1; currentEntry = malloc(currentEntryLen); if (NULL == currentEntry) { status = HGFS_ERROR_NOT_ENOUGH_MEMORY; LOG(4, ("%s: Error: allocate dentry memory ret %u\n", __FUNCTION__, status)); goto exit; } currentEntry->d_reclen = (unsigned short)currentEntryLen; memcpy(currentEntry->d_name, currentEntryName, currentEntryNameLen); currentEntry->d_name[currentEntryNameLen] = 0; myDents[myNumDents] = currentEntry; myNumDents++; } /* Trim extra memory off of dents */ { void *p; p = realloc(myDents, myNumDents * sizeof *myDents); if (NULL != p) { myDents = p; } else { LOG(4, ("%s: Error: realloc trimming array memory\n", __FUNCTION__)); } } *dents = myDents; *numDents = myNumDents; exit: if (NULL != enumNamesHandle) { /* Call the exit callback to teardown any state. */ if (!enumNamesExit(enumNamesHandle)) { LOG(4, ("%s: Error cleanup failed\n", __FUNCTION__)); } } if (HGFS_ERROR_SUCCESS != status) { unsigned int i; /* Free whatever has been allocated so far */ for (i = 0; i < myNumDents; i++) { free(myDents[i]); } free(myDents); } return status; } /* *---------------------------------------------------------------------- * * Request Handler Functions * ------------------------- * * The functions that follow are all of the same type: they take a * request packet which came from the driver, process it, and fill out * a reply packet which is then sent back to the driver. They are * called by DispatchPacket, which dispatches an incoming packet to * the correct handler function based on the packet's opcode. * * These functions all take the following as input: * * - A pointer to a buffer containing the incoming request packet, * - A pointer to a buffer big enough to hold the outgoing reply packet, * - A pointer to the size of the incoming packet, packetSize. * * After processing the request, the handler functions write the reply * packet into the output buffer and set the packetSize to be the size * of the OUTGOING reply packet. The ServerLoop function uses the size * to send the reply back to the driver. * * Note that it is potentially okay for the caller to use the same * buffer for both input and output; handler functions should make * sure they are safe w.r.t. this possibility by storing any state * from the input buffer before they clobber it by potentially writing * output into the same buffer. * * Handler functions should return zero if they successfully processed * the request, or a negative error if an unrecoverable error * occurred. Normal errors (e.g. a poorly formed request packet) * should be handled by sending an error packet back to the driver, * NOT by returning an error code to the caller, because errors * returned by handler functions cause the server to terminate. * * [bac] * *---------------------------------------------------------------------- */ /* *----------------------------------------------------------------------------- * * HgfsPlatformReadFile -- * * Reads data from a file. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformReadFile(fileDesc file, // IN: file descriptor HgfsSessionInfo *session, // IN: session info uint64 offset, // IN: file offset to read from uint32 requiredSize, // IN: length of data to read void* payload, // OUT: buffer for the read data uint32 *actualSize) // OUT: actual length read { int error; HgfsInternalStatus status = 0; HgfsHandle handle; Bool sequentialOpen; ASSERT(session); LOG(4, ("%s: read fh %u, offset %"FMT64"u, count %u\n", __FUNCTION__, file, offset, requiredSize)); if (!HgfsFileDesc2Handle(file, session, &handle)) { LOG(4, ("%s: Could not get file handle\n", __FUNCTION__)); return EBADF; } if (!HgfsHandleIsSequentialOpen(handle, session, &sequentialOpen)) { LOG(4, ("%s: Could not get sequenial open status\n", __FUNCTION__)); return EBADF; } #if defined(__linux__) || defined(__APPLE__) /* Read from the file. */ if (sequentialOpen) { error = read(file, payload, requiredSize); } else { error = pread(file, payload, requiredSize, offset); } #else /* * Seek to the offset and read from the file. Grab the IO lock to make * this and the subsequent read atomic. */ MXUser_AcquireExclLock(session->fileIOLock); if (sequentialOpen) { error = 0; // No error from seek } else { # ifdef linux { uint64 res; # if !defined(VM_X86_64) error = _llseek(file, offset >> 32, offset & 0xFFFFFFFF, &res, 0); # else error = llseek(file, offset >> 32, offset & 0xFFFFFFFF, &res, 0); # endif } # else error = lseek(file, offset, 0); # endif } if (error >= 0) { error = read(file, payload, requiredSize); } else { LOG(4, ("%s: could not seek to %"FMT64"u: %s\n", __FUNCTION__, offset, strerror(status))); } MXUser_ReleaseExclLock(session->fileIOLock); #endif if (error < 0) { status = errno; LOG(4, ("%s: error reading from file: %s\n", __FUNCTION__, strerror(status))); } else { LOG(4, ("%s: read %d bytes\n", __FUNCTION__, error)); *actualSize = error; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformWriteFile -- * * Performs actual writing data to a file. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformWriteFile(HgfsHandle file, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info uint64 offset, // IN: file offset to write to uint32 requiredSize, // IN: length of data to write HgfsWriteFlags flags, // IN: write flags const void *payload, // IN: data to be written uint32 *actualSize) // OUT: actual length written { HgfsInternalStatus status; int fd; int error = 0; Bool sequentialOpen; LOG(4, ("%s: write fh %u, offset %"FMT64"u, count %u\n", __FUNCTION__, file, offset, requiredSize)); /* Get the file desriptor from the cache */ status = HgfsPlatformGetFd(file, session, ((flags & HGFS_WRITE_APPEND) ? TRUE : FALSE), &fd); if (status != 0) { LOG(4, ("%s: Could not get file descriptor\n", __FUNCTION__)); return status; } if (!HgfsHandleIsSequentialOpen(file, session, &sequentialOpen)) { LOG(4, ("%s: Could not get sequential open status\n", __FUNCTION__)); return EBADF; } #if !defined(sun) if (!sequentialOpen) { status = HgfsWriteCheckIORange(offset, requiredSize); if (status != 0) { return status; } } #endif #if defined(__linux__) /* Write to the file. */ if (sequentialOpen) { error = write(fd, payload, requiredSize); } else { error = pwrite(fd, payload, requiredSize, offset); } #elif defined(__APPLE__) { Bool appendMode; if (!HgfsHandle2AppendFlag(file, session, &appendMode)) { LOG(4, ("%s: Could not get append mode\n", __FUNCTION__)); return EBADF; } /* Write to the file. */ if (sequentialOpen || appendMode) { error = write(fd, payload, requiredSize); } else { error = pwrite(fd, payload, requiredSize, offset); } } #else /* * Seek to the offset and write from the file. Grab the IO lock to make * this and the subsequent write atomic. */ MXUser_AcquireExclLock(session->fileIOLock); if (!sequentialOpen) { # ifdef linux { uint64 res; # if !defined(VM_X86_64) error = _llseek(fd, offset >> 32, offset & 0xFFFFFFFF, &res, 0); # else error = llseek(fd, offset >> 32, offset & 0xFFFFFFFF, &res, 0); # endif } # else error = lseek(fd, offset, 0); # endif } if (error < 0) { LOG(4, ("%s: could not seek to %"FMT64"u: %s\n", __FUNCTION__, offset, strerror(errno))); } else { error = write(fd, payload, requiredSize); } { int savedErr = errno; MXUser_ReleaseExclLock(session->fileIOLock); errno = savedErr; } #endif if (error < 0) { status = errno; LOG(4, ("%s: error writing to file: %s\n", __FUNCTION__, strerror(status))); } else { LOG(4, ("%s: wrote %d bytes\n", __FUNCTION__, error)); *actualSize = error; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformSearchDir -- * * Handle platform specific logic needed to perform search open request. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformSearchDir(HgfsNameStatus nameStatus, // IN: name status const char *dirName, // IN: relative directory name size_t dirNameLength, // IN: length of dirName uint32 caseFlags, // IN: case flags HgfsShareInfo *shareInfo, // IN: sharfed folder information char *baseDir, // IN: name of the shared directory uint32 baseDirLen, // IN: length of the baseDir HgfsSessionInfo *session, // IN: session info HgfsHandle *handle) // OUT: search handle { HgfsInternalStatus status = 0; switch (nameStatus) { case HGFS_NAME_STATUS_COMPLETE: { const char *inEnd; const char *next; int len; ASSERT(baseDir); LOG(4, ("%s: searching in \"%s\", %s.\n", __FUNCTION__, baseDir, dirName)); inEnd = dirName + dirNameLength; /* Get the first component. */ len = CPName_GetComponent(dirName, inEnd, &next); if (len >= 0) { if (*inEnd != '\0') { LOG(4, ("%s: dir name not nul-terminated!\n", __FUNCTION__)); /* * NT4 clients can send the name without a nul-terminator. * The space for the nul is included and tested for in the size * calculations above. Size of structure (includes a single * character of the name) and the full dirname length. */ *(char *)inEnd = '\0'; } LOG(4, ("%s: dirName: %s.\n", __FUNCTION__, dirName)); status = HgfsServerSearchRealDir(baseDir, baseDirLen, dirName, shareInfo->rootDir, session, handle); } else { LOG(4, ("%s: get first component failed\n", __FUNCTION__)); status = ENOENT; } /* * If the directory exists but shared folder is write only * then return access denied, otherwise preserve the original * error code. */ if (!shareInfo->readPermissions && HGFS_NAME_STATUS_COMPLETE == status) { status = HGFS_NAME_STATUS_ACCESS_DENIED; } if (status != 0) { LOG(4, ("%s: couldn't scandir\n", __FUNCTION__)); } break; } case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* * This is the base of our namespace, so enumerate all * shares. [bac] */ LOG(4, ("%s: opened search on base\n", __FUNCTION__)); status = HgfsServerSearchVirtualDir(HgfsServerResEnumGet, HgfsServerResEnumInit, HgfsServerResEnumExit, DIRECTORY_SEARCH_TYPE_BASE, session, handle); if (status != 0) { LOG(4, ("%s: couldn't enumerate shares\n", __FUNCTION__)); } break; default: LOG(4, ("%s: access check failed\n", __FUNCTION__)); status = HgfsPlatformConvertFromNameStatus(nameStatus); } if (status == 0) { HGFS_SERVER_DIR_DUMP_DENTS(*handle, session); } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformRestartSearchDir -- * * Handle platform specific restarting of a directory search. * * Results: * HGFS_ERROR_SUCCESS or an appropriate error code. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformRestartSearchDir(HgfsHandle handle, // IN: search handle HgfsSessionInfo *session, // IN: session info DirectorySearchType searchType) // IN: Kind of search { HgfsInternalStatus status; switch (searchType) { case DIRECTORY_SEARCH_TYPE_BASE: /* Entries are shares */ status = HgfsServerRestartSearchVirtualDir(HgfsServerResEnumGet, HgfsServerResEnumInit, HgfsServerResEnumExit, session, handle); break; case DIRECTORY_SEARCH_TYPE_OTHER: /* Entries of this type are unknown and not supported for this platform. */ case DIRECTORY_SEARCH_TYPE_DIR: /* Entries are files and subdirectories: currently not implemented! */ default: status = EINVAL; break; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformHandleIncompleteName -- * * Returns platform error that matches HgfsNameStatus. * * Results: * Non-zero error code. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformHandleIncompleteName(HgfsNameStatus nameStatus, // IN: name status HgfsFileAttrInfo *attr) // OUT: unused { return HgfsPlatformConvertFromNameStatus(nameStatus); } /* *----------------------------------------------------------------------------- * * HgfsPlatformDeleteFileByName -- * * POSIX specific implementation of a delete file request which accepts * utf8 file path as a parameter. * * Simply calls Posix_Unlink. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformDeleteFileByName(char const *utf8Name) // IN: full file path in uf8 encoding { HgfsInternalStatus status; LOG(4, ("%s: unlinking \"%s\"\n", __FUNCTION__, utf8Name)); status = Posix_Unlink(utf8Name); if (status) { status = errno; LOG(4, ("%s: error: %s\n", __FUNCTION__, strerror(status))); } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformDeleteFileByHandle -- * * POSIX specific implementation of a delete file request which accepts * HgfsHandle as a parameter. * * File handle must have appropriate access mode to allow file deletion. * Shared folder restrictions are enforced here as well. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformDeleteFileByHandle(HgfsHandle file, // IN: File being deleted HgfsSessionInfo *session) // IN: session info { HgfsInternalStatus status; Bool readPermissions; Bool writePermissions; char *localName; size_t localNameSize; if (HgfsHandle2FileNameMode(file, session, &writePermissions, &readPermissions, &localName, &localNameSize)) { if (writePermissions && readPermissions) { status = HgfsPlatformDeleteFileByName(localName); } else { status = EPERM; } free(localName); } else { LOG(4, ("%s: could not map cached file handle %u\n", __FUNCTION__, file)); status = EBADF; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformDeleteDirByName -- * * POSIX specific implementation of a delete directory request which accepts * utf8 file path as a parameter. * * Simply calls Posix_Rmdir. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformDeleteDirByName(char const *utf8Name) // IN: full file path in uf8 encoding { HgfsInternalStatus status; LOG(4, ("%s: removing \"%s\"\n", __FUNCTION__, utf8Name)); status = Posix_Rmdir(utf8Name); if (status) { status = errno; LOG(4, ("%s: error: %s\n", __FUNCTION__, strerror(status))); } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformDeleteDirByHandle -- * * POSIX specific implementation of a Delete directory request which accepts * HgfsHandle as a parameter. * * File handle must have appropriate access mode to allow file deletion. * Shared folder restrictions are enforced here as well. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformDeleteDirByHandle(HgfsHandle file, // IN: File being deleted HgfsSessionInfo *session) // IN: session info { HgfsInternalStatus status; Bool readPermissions; Bool writePermissions; char *localName; size_t localNameSize; if (HgfsHandle2FileNameMode(file, session, &writePermissions, &readPermissions, &localName, &localNameSize)) { if (writePermissions && readPermissions) { status = HgfsPlatformDeleteDirByName(localName); } else { status = EPERM; } free(localName); } else { LOG(4, ("%s: could not map cached file handle %u\n", __FUNCTION__, file)); status = EBADF; } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformFileExists -- * * Platform specific function that that verifies if a file or directory exists. * * Results: * 0 if user has permissions to traverse the parent directory and * the file exists, POSIX error code otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformFileExists(char *localTargetName) // IN: Full file path utf8 encoding { int err; err = Posix_Access(localTargetName, F_OK); if (-1 == err) { err = errno; } return err; } /* *----------------------------------------------------------------------------- * * HgfsPlatformRename -- * * POSIX version of the function that renames a file or directory. * * Results: * 0 on success, POSIX error code otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformRename(char *localSrcName, // IN: local path to source file fileDesc srcFile, // IN: source file handle char *localTargetName, // IN: local path to target file fileDesc targetFile, // IN: target file handle HgfsRenameHint hints) // IN: rename hints { HgfsInternalStatus status = 0; if (hints & HGFS_RENAME_HINT_NO_REPLACE_EXISTING) { if (0 == HgfsPlatformFileExists(localTargetName)) { status = EEXIST; goto exit; } } LOG(4, ("%s: renaming \"%s\" to \"%s\"\n", __FUNCTION__, localSrcName, localTargetName)); status = Posix_Rename(localSrcName, localTargetName); if (status) { status = errno; LOG(4, ("%s: error: %s\n", __FUNCTION__, strerror(status))); } exit: return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformCreateDir -- * * POSIX specific code that implements create directory request. * * It invokes POSIX to create the directory and then assigns * file attributes to the new directory if attributes are specified * by the guest. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformCreateDir(HgfsCreateDirInfo *info, // IN: direcotry properties char *utf8Name) // IN: full path for the new directory { mode_t permissions; HgfsInternalStatus status; /* * Create mode_t for use in mkdir(). If owner permissions are missing, use * read/write/execute for the owner permissions. If group or other * permissions are missing, use the owner permissions. * * This sort of makes sense. If the Windows driver wants to make a dir * read-only, it probably intended for the dir to be 666. Since creating * a directory requires a valid mode, it's highly unlikely that we'll ever * be creating a directory without owner permissions. */ permissions = 0; permissions |= info->mask & HGFS_CREATE_DIR_VALID_SPECIAL_PERMS ? info->specialPerms << 9 : 0; permissions |= info->mask & HGFS_CREATE_DIR_VALID_OWNER_PERMS ? info->ownerPerms << 6 : S_IRWXU; permissions |= info->mask & HGFS_CREATE_DIR_VALID_GROUP_PERMS ? info->groupPerms << 3 : (permissions & S_IRWXU) >> 3; permissions |= info->mask & HGFS_CREATE_DIR_VALID_OTHER_PERMS ? info->otherPerms : (permissions & S_IRWXU) >> 6; LOG(4, ("%s: making dir \"%s\", mode %"FMTMODE"\n", __FUNCTION__, utf8Name, permissions)); status = Posix_Mkdir(utf8Name, permissions); if ((info->mask & HGFS_CREATE_DIR_VALID_FILE_ATTR) && (info->fileAttr & HGFS_ATTR_HIDDEN) && 0 == status) { /* * Set hidden attribute when requested. * Do not fail directory creation if setting hidden attribute fails. */ HgfsSetHiddenXAttr(utf8Name, TRUE, permissions); } if (status) { status = errno; LOG(4, ("%s: error: %s\n", __FUNCTION__, strerror(status))); } return status; } /* *----------------------------------------------------------------------------- * * HgfsPlatformSymlinkCreate -- * * Platform specific function that actually creates the symbolic link. * * Results: * Zero on success. * Non-zero on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsPlatformSymlinkCreate(char *localSymlinkName, // IN: symbolic link file name char *localTargetName) // IN: symlink target name { HgfsInternalStatus status = 0; int error; LOG(4, ("%s: %s -> %s\n", __FUNCTION__, localSymlinkName, localTargetName)); /* XXX: Should make use of targetNameP->flags? */ error = Posix_Symlink(localTargetName, localSymlinkName); if (error) { status = errno; LOG(4, ("%s: error: %s\n", __FUNCTION__, strerror(errno))); } return status; } /* *---------------------------------------------------------------------- * * HgfsPlatformPathHasSymlink -- * * This function determines if any of the intermediate components of the * fileName makes references outside the actual shared path. We do not * check for the last component as none of the server operations follow * symlinks. Also some ops that call us expect to operate on a symlink * final component. * * We use following algorithm. It takes 2 parameters, sharePath and * fileName, and returns non-zero errno if fileName makes an invalid * reference. The idea is to resolve both the sharePath and parent * directory of the fileName. The sharePath is already resolved * beforehand in HgfsServerPolicyRead. During resolution, we eliminate * all the ".", "..", and symlinks handled by the realpath(3) libc call. * * We use parent because last component could be a symlink or a component * that doesn't exist. After resolving, we determine if sharePath is a * prefix of fileName. * * Note that realpath(3) behaves differently on GNU and BSD systems. * Following table lists the difference: * * GNU realpath BSD realpath * ----------------------- ----------------------- * * "/tmp/existingFile" "/tmp/existingFile" (0) "/tmp/existingFile" (0) * "/tmp/missingFile" NULL (ENOENT) "/tmp/missingFile" (0) * "/missingDir/foo" NULL (ENOENT) NULL (ENOENT) * In /tmp, "" NULL (ENOENT) "/tmp" (0) * In /tmp, "." "/tmp" (0) "/tmp" (0) * * Results: * HGFS_NAME_STATUS_COMPLETE if the given path has a symlink, an appropriate name status error otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ HgfsNameStatus HgfsPlatformPathHasSymlink(const char *fileName, // IN size_t fileNameLength, // IN const char *sharePath, // IN size_t sharePathLength) // IN { char *resolvedFileDirPath = NULL; char *fileDirName = NULL; HgfsInternalStatus status; HgfsNameStatus nameStatus = HGFS_NAME_STATUS_COMPLETE; ASSERT(fileName); ASSERT(sharePath); ASSERT(sharePathLength <= fileNameLength); LOG(4, ("%s: fileName: %s, sharePath: %s#\n", __FUNCTION__, fileName, sharePath)); /* * Return success if: * - empty fileName or * - sharePath is empty (this is for special root share that allows * access to entire host) or * - fileName and sharePath are same. */ if (fileNameLength == 0 || sharePathLength == 0 || Str_Strcmp(sharePath, fileName) == 0) { goto exit; } /* Separate out parent directory of the fileName. */ File_GetPathName(fileName, &fileDirName, NULL); /* * File_GetPathName may return an empty string to signify the root of * the filesystem. To simplify subsequent processing, let's convert such * empty strings to "/" when found. See File_GetPathName header comment * for details. */ if (strlen(fileDirName) == 0) { char *p; p = realloc(fileDirName, sizeof (DIRSEPS)); if (p == NULL) { nameStatus = HGFS_NAME_STATUS_OUT_OF_MEMORY; LOG(4, ("%s: failed to realloc fileDirName.\n", __FUNCTION__)); goto exit; } else { fileDirName = p; Str_Strcpy(fileDirName, DIRSEPS, sizeof (DIRSEPS)); } } /* * Resolve parent directory of fileName. * Use realpath(2) to resolve the parent. */ resolvedFileDirPath = Posix_RealPath(fileDirName); if (resolvedFileDirPath == NULL) { /* Let's return some meaningful errors if possible. */ status = errno; switch (status) { case ENOENT: nameStatus = HGFS_NAME_STATUS_DOES_NOT_EXIST; break; case ENOTDIR: nameStatus = HGFS_NAME_STATUS_NOT_A_DIRECTORY; break; default: nameStatus = HGFS_NAME_STATUS_FAILURE; break; } LOG(4, ("%s: realpath failed: fileDirName: %s: %s\n", __FUNCTION__, fileDirName, strerror(errno))); goto exit; } /* Resolved parent should match with the shareName. */ if (Str_Strncmp(sharePath, resolvedFileDirPath, sharePathLength) != 0) { nameStatus = HGFS_NAME_STATUS_ACCESS_DENIED; LOG(4, ("%s: resolved parent do not match, parent: %s, resolved: %s#\n", __FUNCTION__, fileDirName, resolvedFileDirPath)); goto exit; } exit: free(resolvedFileDirPath); free(fileDirName); return nameStatus; } /* *----------------------------------------------------------------------------- * * HgfsServerWriteWin32Stream -- * * Handle a write request in the WIN32_STREAM_ID format. * * Results: * EOPNOTSUPP, because this is unimplemented. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsServerWriteWin32Stream(char const *packetIn, // IN: incoming packet HgfsOp op, // IN: request type const void *payload, // IN: HGFS operational packet (without header) size_t payloadSize, // IN: size of HGFS operational packet HgfsSessionInfo *session) // IN: session info { return EOPNOTSUPP; } #if defined(__APPLE__) /* *----------------------------------------------------------------------------- * * HgfsGetHiddenXattr -- * * For Mac hosts returns true if file has invisible bit set in the FileFinder * extended attributes. * * Results: * 0 if succeeded getting attribute, error code otherwise otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsGetHiddenXAttr(char const *fileName, // IN: File name Bool *attribute) // OUT: Hidden atribute { struct attrlist attrList; struct FInfoAttrBuf attrBuf; HgfsInternalStatus err; ASSERT(fileName); ASSERT(attribute); memset(&attrList, 0, sizeof attrList); attrList.bitmapcount = ATTR_BIT_MAP_COUNT; attrList.commonattr = ATTR_CMN_OBJTYPE | ATTR_CMN_FNDRINFO; err = getattrlist(fileName, &attrList, &attrBuf, sizeof attrBuf, 0); if (err == 0) { switch (attrBuf.objType) { case VREG: { FileInfo *info = (FileInfo*) attrBuf.finderInfo; uint16 finderFlags = CFSwapInt16BigToHost(info->finderFlags); *attribute = (finderFlags & kIsInvisible) != 0; break; } case VDIR: { FolderInfo *info = (FolderInfo*) attrBuf.finderInfo; uint16 finderFlags = CFSwapInt16BigToHost(info->finderFlags); *attribute = (finderFlags & kIsInvisible) != 0; break; } default: LOG(4, ("%s: Unrecognized object type %d\n", __FUNCTION__, attrBuf.objType)); err = EINVAL; } } else { LOG(4, ("%s: Error %d when getting attributes\n", __FUNCTION__, err)); } return err; } /* *----------------------------------------------------------------------------- * * ChangeInvisibleFlag -- * * Changes value of the invisible bit in a flags variable to a value defined * by setHidden parameter. * * Results: * TRUE flag has been changed, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool ChangeInvisibleFlag(uint16 *flags, // IN/OUT: variable that contains flags Bool setHidden) // IN: new value for the invisible flag { Bool changed = FALSE; /* * Finder keeps, reports and expects to set flags in big endian format. * Needs to convert to host endian before using constants * and then convert back to big endian before saving */ uint16 finderFlags = CFSwapInt16BigToHost(*flags); Bool isHidden = (finderFlags & kIsInvisible) != 0; if (setHidden) { if (!isHidden) { finderFlags |= kIsInvisible; changed = TRUE; } } else if (isHidden) { finderFlags &= ~kIsInvisible; changed = TRUE; } if (changed) { *flags = CFSwapInt16HostToBig(finderFlags); } return changed; } /* *----------------------------------------------------------------------------- * * HgfsSetHiddenXAttr -- * * Sets new value for the invisible attribute of a file. * * Results: * 0 if succeeded, error code otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsSetHiddenXAttr(char const *fileName, // IN: path to the file Bool setHidden, // IN: new value to the invisible attribute mode_t permissions) // IN: permissions of the file { HgfsInternalStatus err; Bool changed = FALSE; struct attrlist attrList; struct FInfoAttrBuf attrBuf; ASSERT(fileName); memset(&attrList, 0, sizeof attrList); attrList.bitmapcount = ATTR_BIT_MAP_COUNT; attrList.commonattr = ATTR_CMN_OBJTYPE | ATTR_CMN_FNDRINFO; err = getattrlist(fileName, &attrList, &attrBuf, sizeof attrBuf, 0); if (err == 0) { switch (attrBuf.objType) { case VREG: { FileInfo *info = (FileInfo*) attrBuf.finderInfo; changed = ChangeInvisibleFlag(&info->finderFlags, setHidden); break; } case VDIR: { FolderInfo *info = (FolderInfo*) attrBuf.finderInfo; changed = ChangeInvisibleFlag(&info->finderFlags, setHidden); break; } default: LOG(4, ("%s: Unrecognized object type %d\n", __FUNCTION__, attrBuf.objType)); err = EINVAL; } } else { err = errno; } if (changed) { attrList.commonattr = ATTR_CMN_FNDRINFO; err = setattrlist(fileName, &attrList, attrBuf.finderInfo, sizeof attrBuf.finderInfo, 0); if (0 != err) { err = errno; } if (EACCES == err) { mode_t mode = permissions | S_IWOTH | S_IWGRP | S_IWUSR; if (chmod(fileName, mode) == 0) { err = setattrlist(fileName, &attrList, attrBuf.finderInfo, sizeof attrBuf.finderInfo, 0); if (0 != err) { err = errno; } chmod(fileName, permissions); } else { err = errno; } } } return err; } #else // __APPLE__ /* *----------------------------------------------------------------------------- * * HgfsGetHiddenXAttr -- * * Always returns 0 since there is no support for invisible files in Linux * HGFS server. * * Results: * 0 always. This is required to allow apps that use the hidden feature to * continue to work. attribute value is set to FALSE always. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsGetHiddenXAttr(char const *fileName, // IN: File name Bool *attribute) // OUT: Value of the hidden attribute { *attribute = FALSE; return 0; } /* *----------------------------------------------------------------------------- * * HgfsSetHiddenXAttr -- * * Sets new value for the invisible attribute of a file. * Currently Linux server does not support invisible or hiddden files. * So this is a nop. * * Results: * 0 always. This is required to allow apps that use the hidden feature to * continue to work. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsSetHiddenXAttr(char const *fileName, // IN: File name Bool value, // IN: Value of the attribute to set mode_t permissions) // IN: permissions of the file { return 0; } #endif // __APPLE__ #if !defined(sun) /* *----------------------------------------------------------------------------- * * HgfsWriteCheckIORange -- * * Verifies that the write arguments do not exceed the maxiuum file size. * * Results: * 0 on success, otherwise an appropriate error. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsWriteCheckIORange(off_t offset, // IN: uint32 bytesToWrite) // IN: { HgfsInternalStatus status = 0; struct rlimit fileSize; if (getrlimit(RLIMIT_FSIZE, &fileSize) < 0) { status = errno; LOG(4, ("%s: Could not get file size limit\n", __FUNCTION__)); goto exit; } LOG(6, ("%s: File Size limits: 0x%"FMT64"x 0x%"FMT64"x\n", __FUNCTION__, fileSize.rlim_cur, fileSize.rlim_max)); /* * Check the offset is within the file size range. */ if (fileSize.rlim_cur < offset) { status = EFBIG; LOG(4, ("%s: Write offset exceeds max file size limit - 0x%"FMT64"x\n", __FUNCTION__, offset)); goto exit; } /* * Check the data to write does not exceed the max file size. */ if (fileSize.rlim_cur - offset < bytesToWrite) { status = EFBIG; LOG(4, ("%s: Write data 0x%x bytes @ 0x%"FMT64"x size exceeds max file size\n", __FUNCTION__, bytesToWrite, offset)); goto exit; } exit: LOG(6, ("%s: Write data 0x%x bytes @ 0x%"FMT64"x returns %d\n", __FUNCTION__, bytesToWrite, offset, status)); return status; } #endif open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerParameters.c0000644000000000000000000057251612660700525023065 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include #include #include "vmware.h" #include "str.h" #include "cpName.h" #include "cpNameLite.h" #include "hgfsServerInt.h" #include "hgfsServerPolicy.h" #include "codeset.h" #include "config.h" #include "file.h" #include "util.h" #include "wiper.h" #include "vm_basic_asm.h" #include "hgfsServerParameters.h" #define LOGLEVEL_MODULE hgfs #include "loglevel_user.h" #ifdef _WIN32 #define HGFS_REQUEST_WIN32_SUPPORTED HGFS_REQUEST_SUPPORTED #define HGFS_REQUEST_POSIX_SUPPORTED HGFS_REQUEST_NOT_SUPPORTED #else #define HGFS_REQUEST_WIN32_SUPPORTED HGFS_REQUEST_NOT_SUPPORTED #define HGFS_REQUEST_POSIX_SUPPORTED HGFS_REQUEST_SUPPORTED #endif #define HGFS_ASSERT_PACK_PARAMS \ do { \ ASSERT(packet); \ ASSERT(packetHeader); \ ASSERT(session); \ ASSERT(payloadSize); \ } while(0) /* * This is the default/minimal set of capabilities which is supported by every transport. * Every transport and session may have additional capabilities in addition to these. */ static HgfsCapability hgfsDefaultCapabilityTable[] = { {HGFS_OP_OPEN, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_READ, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_WRITE, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_CLOSE, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_OPEN, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_READ, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_CLOSE, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_GETATTR, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SETATTR, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_CREATE_DIR, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DELETE_FILE, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DELETE_DIR, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_RENAME, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_QUERY_VOLUME_INFO, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_OPEN_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_GETATTR_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SETATTR_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_READ_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_CREATE_SYMLINK, HGFS_REQUEST_POSIX_SUPPORTED}, {HGFS_OP_SERVER_LOCK_CHANGE, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_CREATE_DIR_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DELETE_FILE_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DELETE_DIR_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_RENAME_V2, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_OPEN_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_READ_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_WRITE_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_CLOSE_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_OPEN_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_READ_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SEARCH_CLOSE_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_GETATTR_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_SETATTR_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_CREATE_DIR_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DELETE_FILE_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DELETE_DIR_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_RENAME_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_QUERY_VOLUME_INFO_V3, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_CREATE_SYMLINK_V3, HGFS_REQUEST_POSIX_SUPPORTED}, {HGFS_OP_SERVER_LOCK_CHANGE_V3, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_WRITE_WIN32_STREAM_V3, HGFS_REQUEST_WIN32_SUPPORTED}, {HGFS_OP_CREATE_SESSION_V4, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_DESTROY_SESSION_V4, HGFS_REQUEST_SUPPORTED}, {HGFS_OP_READ_FAST_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_WRITE_FAST_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_SET_WATCH_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_REMOVE_WATCH_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_NOTIFY_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_SEARCH_READ_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_OPEN_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_ENUMERATE_STREAMS_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_GETATTR_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_SETATTR_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_DELETE_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_LINKMOVE_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_FSCTL_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_ACCESS_CHECK_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_FSYNC_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_QUERY_VOLUME_INFO_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_OPLOCK_ACQUIRE_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_OPLOCK_BREAK_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_LOCK_BYTE_RANGE_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_UNLOCK_BYTE_RANGE_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_QUERY_EAS_V4, HGFS_REQUEST_NOT_SUPPORTED}, {HGFS_OP_SET_EAS_V4, HGFS_REQUEST_NOT_SUPPORTED}, }; /* *----------------------------------------------------------------------------- * * HgfsValidateReplySize -- * * Verify if the size of a reply does not exceed maximum supported size. * * Results: * TRUE if the packet size is acceptable, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsValidateReplySize(char const *packetIn, HgfsOp op, size_t packetSize) { Bool result; HgfsRequest *request = (HgfsRequest *)packetIn; if (HGFS_OP_NEW_HEADER != request->op) { if (HGFS_OP_READ_V3 == op) { result = packetSize <= HGFS_LARGE_PACKET_MAX; } else { result = packetSize <= HGFS_PACKET_MAX; } } else { result = TRUE; } if (!result) { LOG(4, ("%s: Reply exceeded maximum support size!\n", __FUNCTION__)); } return result; } /* *----------------------------------------------------------------------------- * * HgfsGetPayloadSize -- * * Returns size of the payload based on incoming packet and total * packet size. * * Results: * Size of the payload in bytes. * * Side effects: * None * *----------------------------------------------------------------------------- */ size_t HgfsGetPayloadSize(char const *packetIn, // IN: request packet size_t packetSize) // IN: request packet size { HgfsRequest *request = (HgfsRequest *)packetIn; size_t result; ASSERT(packetSize >= sizeof *request); if (request->op < HGFS_OP_CREATE_SESSION_V4) { result = packetSize - sizeof *request; } else { HgfsHeader *header = (HgfsHeader *)packetIn; ASSERT(packetSize >= header->packetSize); ASSERT(header->packetSize >= header->headerSize); result = header->packetSize - header->headerSize; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackHeaderV1V2 -- * * Unpack the client request that contains a basic valid HgfsHeader for protocol * versions 1 and 2. * Extract the useful details for the caller. * * Results: * HGFS_ERROR_SUCCESS always. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsUnpackHeaderV1V2(const HgfsRequest *request, // IN: request header size_t requestSize, // IN: request data size uint32 *requestId, // OUT: unique request id HgfsOp *opcode, // OUT: request opcode size_t *payloadSize, // OUT: size of the payload const void **payload) // OUT: pointer to the payload { /* V1 or V2 requests do not have a separate header. */ *requestId = request->id; *opcode = request->op; *payloadSize = requestSize; *payload = request; return HGFS_ERROR_SUCCESS; } /* *----------------------------------------------------------------------------- * * HgfsUnpackHeaderV3 -- * * Unpack the client request that contains a basic valid HgfsHeader for protocol * version 3. * Extract the useful details for the caller. * * Results: * HGFS_ERROR_SUCCESS always. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsUnpackHeaderV3(const HgfsRequest *request, // IN: request header size_t requestSize, // IN: request data size uint32 *requestId, // OUT: unique request id HgfsOp *opcode, // OUT: request opcode size_t *payloadSize, // OUT: size of the payload const void **payload) // OUT: pointer to the payload { /* Old header with V3 request. */ *requestId = request->id; *opcode = request->op; if (requestSize > sizeof *request) { *payload = HGFS_REQ_GET_PAYLOAD_V3(request); *payloadSize = requestSize - ((char *)*payload - (char *)request); } else { *payload = NULL; *payloadSize = 0; } return HGFS_ERROR_SUCCESS; } /* *----------------------------------------------------------------------------- * * HgfsUnpackHeaderV4 -- * * Unpack the client request that contains a basic valid HgfsHeader for protocol * version 4 and newer. * Extract the useful details for the caller. * * Results: * HGFS_ERROR_SUCCESS if successful or * HGFS_ERROR_PROTOCOL for a malformed request, and we cannot trust the data. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static HgfsInternalStatus HgfsUnpackHeaderV4(const HgfsHeader *requestHeader, // IN: request header size_t requestSize, // IN: request data size uint64 *sessionId, // OUT: session Id uint32 *requestId, // OUT: unique request id uint32 *hdrFlags, // OUT: header flags uint32 *information, // OUT: generic information HgfsOp *opcode, // OUT: request opcode size_t *payloadSize, // OUT: size of the payload const void **payload) // OUT: pointer to the payload { HgfsInternalStatus status = HGFS_ERROR_SUCCESS; if (requestSize < sizeof *requestHeader) { LOG(4, ("%s: Malformed HGFS packet received - header is too small!\n", __FUNCTION__)); status = HGFS_ERROR_PROTOCOL; goto exit; } if (requestSize < requestHeader->packetSize || requestHeader->packetSize < requestHeader->headerSize) { LOG(4, ("%s: Malformed HGFS packet received - inconsistent header" " and packet sizes!\n", __FUNCTION__)); status = HGFS_ERROR_PROTOCOL; goto exit; } if (HGFS_HEADER_VERSION_1 > requestHeader->version) { LOG(4, ("%s: Malformed HGFS packet received - invalid header version!\n", __FUNCTION__)); status = HGFS_ERROR_PROTOCOL; goto exit; } ASSERT(HGFS_OP_NEW_HEADER == requestHeader->dummy); /* The basics of the header are validated, get the remaining parameters. */ *sessionId = requestHeader->sessionId; *requestId = requestHeader->requestId; *opcode = requestHeader->op; /* * For version 1 of the header the file copy client did not ensure * the following fields (and reserved fields) were set and thus can * contain garbage. * For this reason, we just zero out these fields for this header version. */ if (HGFS_HEADER_VERSION_1 == requestHeader->version) { *hdrFlags = 0; *information = 0; } else { *hdrFlags = requestHeader->flags; *information = requestHeader->information; } *payloadSize = requestHeader->packetSize - requestHeader->headerSize; if (0 < *payloadSize) { *payload = (char *)requestHeader + requestHeader->headerSize; } else { *payload = NULL; Log("%s: HGFS packet with header and no payload!\n", __FUNCTION__); } exit: return status; } /* *----------------------------------------------------------------------------- * * HgfsUnpackPacketParams -- * * Takes the Hgfs packet and extracts the operation parameters. * This validates the incoming packet as part of the processing. * * Results: * HGFS_ERROR_SUCCESS if all the request parameters are successfully extracted. * HGFS_ERROR_INTERNAL if an error occurs without sufficient request data to be * able to send a reply to the client. * Any other appropriate error if the incoming packet has errors and there is * sufficient information to send a response. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsUnpackPacketParams(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size Bool *sessionEnabled, // OUT: session enabled request uint64 *sessionId, // OUT: session Id uint32 *requestId, // OUT: unique request id HgfsOp *opcode, // OUT: request opcode size_t *payloadSize, // OUT: size of the opcode request const void **payload) // OUT: pointer to the opcode request { const HgfsRequest *request; HgfsInternalStatus unpackStatus = HGFS_ERROR_SUCCESS; ASSERT(NULL != packet); request = packet; LOG(4, ("%s: Received a request with opcode %d.\n", __FUNCTION__, request->op)); /* * Error out if less than HgfsRequest size. * We cannot continue any further with this packet. */ if (packetSize < sizeof *request) { LOG(4, ("%s: Received a request with opcode %"FMTSZ"u.\n", __FUNCTION__, packetSize)); unpackStatus = HGFS_ERROR_INTERNAL; goto exit; } *sessionEnabled = FALSE; if (request->op < HGFS_OP_OPEN_V3) { unpackStatus = HgfsUnpackHeaderV1V2(request, packetSize, requestId, opcode, payloadSize, payload); } else if (request->op < HGFS_OP_CREATE_SESSION_V4) { unpackStatus = HgfsUnpackHeaderV3(request, packetSize, requestId, opcode, payloadSize, payload); } else if (HGFS_OP_NEW_HEADER == request->op) { /* The legacy op means a new header but we can have V3 and newer opcodes. */ const HgfsHeader *requestHdr = packet; uint32 hdrFlags = 0; uint32 information; *sessionEnabled = TRUE; unpackStatus = HgfsUnpackHeaderV4(requestHdr, packetSize, sessionId, requestId, &hdrFlags, &information, opcode, payloadSize, payload); /* * Test if the client sent invalid flags (and information in future cases). * Note, a basic sanitation was done in the unpack header itself, only V2 * or newer allowed to pass meaningful values through. */ if (0 != hdrFlags && 0 == (hdrFlags & (HGFS_PACKET_FLAG_REQUEST | HGFS_PACKET_FLAG_REPLY))) { unpackStatus = HGFS_ERROR_PROTOCOL; } } else { LOG(4, ("%s: HGFS packet - unknown opcode == newer client or malformed!\n", __FUNCTION__)); unpackStatus = HGFS_ERROR_INTERNAL; } exit: LOG(4, ("%s: unpacked request(op %d, id %u) -> %u.\n", __FUNCTION__, request->op, *requestId, unpackStatus)); return unpackStatus; } /* *----------------------------------------------------------------------------- * * HgfsUnpackOpenPayloadV1 -- * * Unpack and validate payload for hgfs open request V1 to the HgfsFileOpenInfo * structure that is used to pass around open request information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackOpenPayloadV1(const HgfsRequestOpen *requestV1, // IN: request payload size_t payloadSize, // IN: request payload size HgfsFileOpenInfo *openInfo) // IN/OUT: open info struct { size_t extra; /* Enforced by the dispatch function. */ if (payloadSize < sizeof *requestV1) { LOG(4, ("%s: Malformed HGFS packet received - payload too small\n", __FUNCTION__)); return FALSE; } extra = payloadSize - sizeof *requestV1; /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV1->fileName.length > extra) { /* The input packet is smaller than the request. */ LOG(4, ("%s: Malformed HGFS packet received - payload too small to hold file name\n", __FUNCTION__)); return FALSE; } /* For OpenV1 requests, we know exactly what fields we expect. */ openInfo->mask = HGFS_OPEN_VALID_MODE | HGFS_OPEN_VALID_FLAGS | HGFS_OPEN_VALID_OWNER_PERMS | HGFS_OPEN_VALID_FILE_NAME; openInfo->mode = requestV1->mode; openInfo->cpName = requestV1->fileName.name; openInfo->cpNameSize = requestV1->fileName.length; openInfo->flags = requestV1->flags; openInfo->ownerPerms = requestV1->permissions; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackOpenPayloadV2 -- * * Unpack and validate payload for hgfs open request V2 to the HgfsFileOpenInfo * structure that is used to pass around open request information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackOpenPayloadV2(const HgfsRequestOpenV2 *requestV2, // IN: request payload size_t payloadSize, // IN: request payload size HgfsFileOpenInfo *openInfo) // IN/OUT: open info struct { size_t extra; /* Enforced by the dispatch function. */ if (payloadSize < sizeof *requestV2) { LOG(4, ("%s: Malformed HGFS packet received - payload too small\n", __FUNCTION__)); return FALSE; } extra = payloadSize - sizeof *requestV2; if (!(requestV2->mask & HGFS_OPEN_VALID_FILE_NAME)) { /* We do not support open requests without a valid file name. */ LOG(4, ("%s: Malformed HGFS packet received - invalid mask\n", __FUNCTION__)); return FALSE; } /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV2->fileName.length > extra) { /* The input packet is smaller than the request. */ LOG(4, ("%s: Malformed HGFS packet received - payload too small to hold file name\n", __FUNCTION__)); return FALSE; } /* * Copy all the fields into our carrier struct. Some will probably be * garbage, but it's simpler to copy everything now and check the * valid bits before reading later. */ openInfo->mask = requestV2->mask; openInfo->mode = requestV2->mode; openInfo->cpName = requestV2->fileName.name; openInfo->cpNameSize = requestV2->fileName.length; openInfo->flags = requestV2->flags; openInfo->specialPerms = requestV2->specialPerms; openInfo->ownerPerms = requestV2->ownerPerms; openInfo->groupPerms = requestV2->groupPerms; openInfo->otherPerms = requestV2->otherPerms; openInfo->attr = requestV2->attr; openInfo->allocationSize = requestV2->allocationSize; openInfo->desiredAccess = requestV2->desiredAccess; openInfo->shareAccess = requestV2->shareAccess; openInfo->desiredLock = requestV2->desiredLock; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackOpenPayloadV3 -- * * Unpack and validate payload for hgfs open request V3 to the HgfsFileOpenInfo * structure that is used to pass around open request information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackOpenPayloadV3(const HgfsRequestOpenV3 *requestV3, // IN: request payload size_t payloadSize, // IN: request payload size HgfsFileOpenInfo *openInfo) // IN/OUT: open info struct { size_t extra; /* Enforced by the dispatch function. */ if (payloadSize < sizeof *requestV3) { LOG(4, ("%s: Malformed HGFS packet received - payload too small\n", __FUNCTION__)); return FALSE; } extra = payloadSize - sizeof *requestV3; if (!(requestV3->mask & HGFS_OPEN_VALID_FILE_NAME)) { /* We do not support open requests without a valid file name. */ LOG(4, ("%s: Malformed HGFS packet received - incorrect mask\n", __FUNCTION__)); return FALSE; } /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV3->fileName.length > extra) { /* The input packet is smaller than the request. */ LOG(4, ("%s: Malformed HGFS packet received - payload too small to hold file name\n", __FUNCTION__)); return FALSE; } /* * Copy all the fields into our carrier struct. Some will probably be * garbage, but it's simpler to copy everything now and check the * valid bits before reading later. */ openInfo->mask = requestV3->mask; openInfo->mode = requestV3->mode; openInfo->cpName = requestV3->fileName.name; openInfo->cpNameSize = requestV3->fileName.length; openInfo->caseFlags = requestV3->fileName.caseType; openInfo->flags = requestV3->flags; openInfo->specialPerms = requestV3->specialPerms; openInfo->ownerPerms = requestV3->ownerPerms; openInfo->groupPerms = requestV3->groupPerms; openInfo->otherPerms = requestV3->otherPerms; openInfo->attr = requestV3->attr; openInfo->allocationSize = requestV3->allocationSize; openInfo->desiredAccess = requestV3->desiredAccess; openInfo->shareAccess = requestV3->shareAccess; openInfo->desiredLock = requestV3->desiredLock; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackOpenRequest -- * * Unpack hgfs open request to the HgfsFileOpenInfo structure that is used * to pass around open request information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackOpenRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: packet size HgfsOp op, // IN: requested operation HgfsFileOpenInfo *openInfo) // IN/OUT: open info structure { Bool result; ASSERT(packet); ASSERT(openInfo); openInfo->requestType = op; openInfo->caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (op) { case HGFS_OP_OPEN_V3: { const HgfsRequestOpenV3 *requestV3 = packet; LOG(4, ("%s: HGFS_OP_OPEN_V3\n", __FUNCTION__)); result = HgfsUnpackOpenPayloadV3(requestV3, packetSize, openInfo); break; } case HGFS_OP_OPEN_V2: { const HgfsRequestOpenV2 *requestV2 = packet; LOG(4, ("%s: HGFS_OP_OPEN_V2\n", __FUNCTION__)); result = HgfsUnpackOpenPayloadV2(requestV2, packetSize, openInfo); break; } case HGFS_OP_OPEN: { const HgfsRequestOpen *requestV1 = packet; LOG(4, ("%s: HGFS_OP_OPEN\n", __FUNCTION__)); result = HgfsUnpackOpenPayloadV1(requestV1, packetSize, openInfo); break; } default: NOT_REACHED(); result = FALSE; } if (!result) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackReplyHeaderV4 -- * * Pack hgfs header that corresponds to an HGFS protocol packet. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsPackReplyHeaderV4(HgfsStatus status, // IN: reply status uint32 payloadSize, // IN: size of the reply payload HgfsOp opcode, // IN: request type uint64 sessionId, // IN: session id uint32 requestId, // IN: request id uint32 hdrFlags, // IN: header flags size_t hdrPacketSize, // IN: header packet size HgfsHeader *hdrPacket) // OUT: outgoing packet header { Bool result = FALSE; if (hdrPacketSize >= sizeof *hdrPacket) { memset(hdrPacket, 0, sizeof *hdrPacket); hdrPacket->version = HGFS_HEADER_VERSION; hdrPacket->dummy = HGFS_OP_NEW_HEADER; hdrPacket->packetSize = payloadSize + sizeof *hdrPacket; hdrPacket->headerSize = sizeof *hdrPacket; hdrPacket->requestId = requestId; hdrPacket->op = opcode; hdrPacket->status = status; hdrPacket->flags = hdrFlags; hdrPacket->information = status; hdrPacket->sessionId = sessionId; result = TRUE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackLegacyReplyHeader -- * * Pack pre-V4 reply header. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsPackLegacyReplyHeader(HgfsStatus status, // IN: reply status HgfsHandle id, // IN: original packet id size_t hdrPacketSize, // IN: header packet size HgfsReply *hdrPacket) // OUT: outgoing packet header { Bool result = FALSE; if (hdrPacketSize >= sizeof *hdrPacket) { memset(hdrPacket, 0, sizeof *hdrPacket); hdrPacket->status = status; hdrPacket->id = id; result = TRUE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackReplyHeader -- * * Pack hgfs header that corresponds to an HGFS protocol packet. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackReplyHeader(HgfsInternalStatus status, // IN: reply status uint32 payloadSize, // IN: size of the reply payload Bool sessionEnabledHeader, // IN: session enabled header uint64 sessionId, // IN: session id uint32 requestId, // IN: request id HgfsOp opcode, // IN: request operation uint32 hdrFlags, // IN: header flags size_t hdrPacketSize, // IN: header packet size void *hdrPacket) // OUT: outgoing packet header { HgfsStatus replyStatus; Bool result; if (NULL == hdrPacket) { result = FALSE; goto exit; } replyStatus = HgfsConvertFromInternalStatus(status); if (sessionEnabledHeader) { result = HgfsPackReplyHeaderV4(replyStatus, payloadSize, opcode, sessionId, requestId, HGFS_PACKET_FLAG_REPLY, hdrPacketSize, hdrPacket); } else { result = HgfsPackLegacyReplyHeader(replyStatus, requestId, hdrPacketSize, hdrPacket); } exit: return result; } /* *----------------------------------------------------------------------------- * * HgfsPackOpenReplyV3 -- * * Pack hgfs open V3 reply payload to the HgfsReplyOpenV3 structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackOpenReplyV3(HgfsFileOpenInfo *openInfo, // IN: open info struct HgfsReplyOpenV3 *reply) // OUT: size of packet { reply->file = openInfo->file; reply->reserved = 0; reply->flags = 0; if (openInfo->mask & HGFS_OPEN_VALID_SERVER_LOCK) { reply->acquiredLock = openInfo->acquiredLock; } else { reply->acquiredLock = HGFS_LOCK_NONE; } } /* *----------------------------------------------------------------------------- * * HgfsPackOpenV2Reply -- * * Pack hgfs open V2 reply payload to the HgfsReplyOpenV3 structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackOpenV2Reply(HgfsFileOpenInfo *openInfo, // IN: open info struct HgfsReplyOpenV2 *reply) // OUT: reply payload { reply->file = openInfo->file; if (openInfo->mask & HGFS_OPEN_VALID_SERVER_LOCK) { reply->acquiredLock = openInfo->acquiredLock; } else { reply->acquiredLock = HGFS_LOCK_NONE; } } /* *----------------------------------------------------------------------------- * * HgfsPackOpenV1Reply -- * * Pack hgfs open V1 reply payload to the HgfsReplyOpenV3 structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackOpenV1Reply(HgfsFileOpenInfo *openInfo, // IN: open info struct HgfsReplyOpen *reply) // OUT: reply payload { reply->file = openInfo->file; } /* *----------------------------------------------------------------------------- * * HgfsPackOpenReply -- * * Pack hgfs open reply to the HgfsReplyOpen{V2} structure. * * Results: * Always TRUE, FALSE if bad opcode. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackOpenReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsFileOpenInfo *openInfo, // IN: open info struct size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; ASSERT(openInfo); HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (openInfo->requestType) { case HGFS_OP_OPEN_V3: { HgfsReplyOpenV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); HgfsPackOpenReplyV3(openInfo, reply); *payloadSize = sizeof *reply; break; } case HGFS_OP_OPEN_V2: { HgfsReplyOpenV2 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); HgfsPackOpenV2Reply(openInfo, reply); *payloadSize = sizeof *reply; break; } case HGFS_OP_OPEN: { HgfsReplyOpen *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); HgfsPackOpenV1Reply(openInfo, reply); *payloadSize = sizeof *reply; break; } default: NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackClosePayload -- * * Unpack hgfs close payload to get the handle which need to be closed. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackClosePayload(const HgfsRequestClose *request, // IN: payload size_t payloadSize, // IN: payload size HgfsHandle* file) // OUT: HGFS handle to close { LOG(4, ("%s: HGFS_OP_CLOSE\n", __FUNCTION__)); if (payloadSize >= sizeof *request) { *file = request->file; return TRUE; } return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackClosePayloadV3 -- * * Unpack hgfs close payload V3 to get the handle which need to be closed. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackClosePayloadV3(const HgfsRequestCloseV3 *requestV3, // IN: payload size_t payloadSize, // IN: payload size HgfsHandle* file) // OUT: HGFS handle to close { LOG(4, ("%s: HGFS_OP_CLOSE_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { *file = requestV3->file; return TRUE; } LOG(4, ("%s: Too small HGFS packet\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCloseRequest -- * * Unpack hgfs close request to get the handle to close. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackCloseRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsHandle *file) // OUT: Handle to close { ASSERT(packet); switch (op) { case HGFS_OP_CLOSE_V3: { const HgfsRequestCloseV3 *requestV3 = packet; if (!HgfsUnpackClosePayloadV3(requestV3, packetSize, file)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_CLOSE: { const HgfsRequestClose *requestV1 = packet; if (!HgfsUnpackClosePayload(requestV1, packetSize, file)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackCloseReply -- * * Pack hgfs close reply to the HgfsReplyClose(V3) structure. * * Results: * Always TRUE, FALSE if bad opcode. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackCloseReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet excluding header HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (op) { case HGFS_OP_CLOSE_V3: { HgfsReplyCloseV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply consists of a reserved field only. */ reply->reserved = 0; *payloadSize = sizeof *reply; break; } case HGFS_OP_CLOSE: { HgfsReplyClose *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchClosePayload -- * * Unpack hgfs search close payload to get the search handle which need to be closed. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSearchClosePayload(const HgfsRequestSearchClose *request, // IN: payload size_t payloadSize, // IN: payload size HgfsHandle* search) // OUT: search to close { LOG(4, ("%s: HGFS_OP_SEARCH_CLOSE\n", __FUNCTION__)); if (payloadSize >= sizeof *request) { *search = request->search; return TRUE; } LOG(4, ("%s: Too small HGFS packet\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchClosePayloadV3 -- * * Unpack hgfs search close payload V3 to get the search handle which need to * be closed. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSearchClosePayloadV3(const HgfsRequestSearchCloseV3 *requestV3, // IN: payload size_t payloadSize, // IN: payload size HgfsHandle* search) // OUT: search { LOG(4, ("%s: HGFS_OP_SEARCH_CLOSE_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { *search = requestV3->search; return TRUE; } LOG(4, ("%s: Too small HGFS packet\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchCloseRequest -- * * Unpack hgfs search close request to get the search handle. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackSearchCloseRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsHandle *search) // OUT: search to close { ASSERT(packet); switch (op) { case HGFS_OP_SEARCH_CLOSE_V3: { const HgfsRequestSearchCloseV3 *requestV3 = packet; if (!HgfsUnpackSearchClosePayloadV3(requestV3, packetSize, search)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_SEARCH_CLOSE: { const HgfsRequestSearchClose *requestV1 = packet; if (!HgfsUnpackSearchClosePayload(requestV1, packetSize, search)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchCloseReply -- * * Pack hgfs SearchClose reply into a HgfsReplySearchClose(V3) structure. * * Results: * Always TRUE, except when it is called with a * wrong op or insufficient output buffer (which is a programming error). * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSearchCloseReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (op) { case HGFS_OP_SEARCH_CLOSE_V3: { HgfsReplyCloseV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply consists of only a reserved field. */ reply->reserved = 0; *payloadSize = sizeof *reply; break; } case HGFS_OP_SEARCH_CLOSE: { HgfsReplyClose *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackFileName -- * * Unpack HgfsFileName into a pointer to a CPName and size of the name. * Verifies that input buffer has enough space to hold the name. * * Results: * TRUE on success, FALSE on failure (buffer too small). * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackFileName(const HgfsFileName *name, // IN: file name size_t maxNameSize, // IN: space allocated for the name const char **cpName, // OUT: CP name size_t *cpNameSize) // OUT: CP name size { /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (name->length > maxNameSize) { /* The input packet is smaller than the request. */ return FALSE; } *cpName = name->name; *cpNameSize = name->length; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackFileNameV3 -- * * Unpack HgfsFileNameV3 into a pointer to a CPName and size of the name * or into file handle. * Verifies that input buffer has enough space to hold the name. * * Results: * TRUE on success, FALSE on failure (buffer too small). * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackFileNameV3(const HgfsFileNameV3 *name, // IN: file name size_t maxNameSize, // IN: space allocated for the name Bool *useHandle, // OUT: file name or handle returned? const char **cpName, // OUT: CP name size_t *cpNameSize, // OUT: CP name size HgfsHandle *file, // OUT: HGFS file handle uint32 *caseFlags) // OUT: case-sensitivity flags { *useHandle = FALSE; *file = HGFS_INVALID_HANDLE; *cpName = NULL; *cpNameSize = 0; /* * If we've been asked to reuse a handle, we don't need to look at, let * alone test the filename or its length. */ if (name->flags & HGFS_FILE_NAME_USE_FILE_DESC) { *file = name->fid; *caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *useHandle = TRUE; } else { /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (name->length > maxNameSize) { /* The input packet is smaller than the request */ LOG(4, ("%s: Error unpacking file name - buffer too small\n", __FUNCTION__)); return FALSE; } *cpName = name->name; *cpNameSize = name->length; *caseFlags = name->caseType; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackDeletePayloadV3 -- * * Unpack hgfs delete request V3 payload and initialize a corresponding * HgfsHandle or file name to tell us which to delete. Hints * holds flags to specify a handle or name for the file or * directory to delete. * * Since the structure of the get delete request packet is the same * for Delete File or Directory of the protocol, code is identical for * both operations. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackDeletePayloadV3(const HgfsRequestDeleteV3 *requestV3, // IN: request payload size_t payloadSize, // IN: payload size const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints HgfsHandle *file, // OUT: file handle uint32 *caseFlags) // OUT: case-sensitivity flags { Bool result = TRUE; Bool useHandle; if (payloadSize < sizeof *requestV3) { result = FALSE; goto exit; } *hints = requestV3->hints; if (!HgfsUnpackFileNameV3(&requestV3->fileName, payloadSize - sizeof *requestV3, &useHandle, cpName, cpNameSize, file, caseFlags)) { result = FALSE; goto exit; } if (useHandle) { *hints |= HGFS_DELETE_HINT_USE_FILE_DESC; } exit: LOG(8, ("%s: unpacking HGFS_OP_DELETE_DIR/FILE_V3 -> %d\n", __FUNCTION__, result)); return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackDeletePayloadV2 -- * * Unpack hgfs delete request V2 payload and initialize a corresponding * HgfsHandle or file name to tell us which to delete. Hints * holds flags to specify a handle or name for the file or * directory to delete. * * Since the structure of the get delete request packet is the same * for Delete File or Directory of the protocol, code is identical for * both operations. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackDeletePayloadV2(const HgfsRequestDeleteV2 *requestV2, // IN: request payload size_t payloadSize, // IN: payload size const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints HgfsHandle *file) // OUT: file handle { Bool result = TRUE; /* Enforced by the dispatch function. */ ASSERT(payloadSize >= sizeof *requestV2); *file = HGFS_INVALID_HANDLE; *hints = requestV2->hints; /* * If we've been asked to reuse a handle, we don't need to look at, let * alone test the filename or its length. */ if (requestV2->hints & HGFS_DELETE_HINT_USE_FILE_DESC) { *file = requestV2->file; *cpName = NULL; *cpNameSize = 0; } else { result = HgfsUnpackFileName(&requestV2->fileName, payloadSize - sizeof *requestV2, cpName, cpNameSize); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackDeletePayloadV1 -- * * Unpack hgfs delete request V1 payload and initialize a corresponding * file name to tell us which to delete. * * Since the structure of the get delete request packet is the same * for Delete File or Directory of the protocol, code is identical for * both operations. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackDeletePayloadV1(const HgfsRequestDelete *requestV1, // IN: request payload size_t payloadSize, // IN: payload size const char **cpName, // OUT: cpName size_t *cpNameSize) // OUT: cpName size { return HgfsUnpackFileName(&requestV1->fileName, payloadSize - sizeof *requestV1, cpName, cpNameSize); } /* *----------------------------------------------------------------------------- * * HgfsUnpackDeleteRequest -- * * Unpack hgfs delete request and initialize a corresponding * HgfsHandle or file name to tell us which to delete. Hints * holds flags to specify a handle or name for the file or * directory to delete. * * Since the structure of the get delete request packet is the same * for Delete File or Directory of the protocol, code is identical for * both operations. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackDeleteRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints HgfsHandle *file, // OUT: file handle uint32 *caseFlags) // OUT: case-sensitivity flags { ASSERT(packet); ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); ASSERT(hints); ASSERT(caseFlags); *caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *hints = 0; *file = HGFS_INVALID_HANDLE; switch (op) { case HGFS_OP_DELETE_FILE_V3: case HGFS_OP_DELETE_DIR_V3: { const HgfsRequestDeleteV3 *requestV3 = packet; if (!HgfsUnpackDeletePayloadV3(requestV3, packetSize, cpName, cpNameSize, hints, file, caseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_DELETE_FILE_V2: case HGFS_OP_DELETE_DIR_V2: { const HgfsRequestDeleteV2 *requestV2 = packet; if (!HgfsUnpackDeletePayloadV2(requestV2, packetSize, cpName, cpNameSize, hints, file)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_DELETE_FILE: case HGFS_OP_DELETE_DIR: { const HgfsRequestDelete *requestV1 = packet; if (!HgfsUnpackDeletePayloadV1(requestV1, packetSize, cpName, cpNameSize)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: NOT_REACHED(); LOG(4, ("%s: Invalid opcode\n", __FUNCTION__)); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackDeleteReply -- * * Pack hgfs delete reply. * Since the structure of the delete reply packet hasn't changed in * version 2 of the protocol, HgfsReplyDeleteV2 is identical to * HgfsReplyDelete. So use HgfsReplyDelete type to access packetIn to * keep the code simple. * * Results: * TRUE if valid op version reply filled, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackDeleteReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: requested operation size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; /* No reply payload, just header. */ switch (op) { case HGFS_OP_DELETE_FILE_V3: case HGFS_OP_DELETE_DIR_V3: { HgfsReplyDeleteV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } case HGFS_OP_DELETE_FILE_V2: case HGFS_OP_DELETE_FILE: case HGFS_OP_DELETE_DIR_V2: case HGFS_OP_DELETE_DIR: { HgfsReplyDelete *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: LOG(4, ("%s: invalid op code %d\n", __FUNCTION__, op)); result = FALSE; NOT_REACHED(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackRenamePayloadV3 -- * * Unpack hgfs rename request V3 payload and initialize a corresponding * HgfsHandles or file names to tell us old and new names/handles. Hints * holds flags to specify a handle or name for the file or * directory to rename. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackRenamePayloadV3(const HgfsRequestRenameV3 *requestV3, // IN: request payload size_t payloadSize, // IN: payload size const char **cpOldName, // OUT: rename src size_t *cpOldNameLen, // OUT: rename src size const char **cpNewName, // OUT: rename dst size_t *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle HgfsHandle *targetFile, // OUT: target file handle uint32 *oldCaseFlags, // OUT: source case flags uint32 *newCaseFlags) // OUT: dest. case flags { size_t extra; const HgfsFileNameV3 *newName; Bool useHandle; LOG(4, ("%s: HGFS_OP_RENAME_V3\n", __FUNCTION__)); if (payloadSize < sizeof *requestV3) { return FALSE; } extra = payloadSize - sizeof *requestV3; *hints = requestV3->hints; /* * Get the old and new filenames from the request. * * Getting the new filename is somewhat inconvenient, because we * don't know where request->newName actually starts, thanks to the * fact that request->oldName is of variable length. We get around * this by using an HgfsFileName*, assigning it to the correct address * just after request->oldName ends, and using that to access the * new name. */ /* * If we've been asked to reuse a handle, we don't need to look at, let * alone test the filename or its length. This applies to the source * and the target. */ if (!HgfsUnpackFileNameV3(&requestV3->oldName, extra, &useHandle, cpOldName, cpOldNameLen, srcFile, oldCaseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } if (useHandle) { *hints |= HGFS_RENAME_HINT_USE_SRCFILE_DESC; newName = &requestV3->newName; } else { newName = (const HgfsFileNameV3 *)(requestV3->oldName.name + 1 + *cpOldNameLen); extra -= *cpOldNameLen; } if (!HgfsUnpackFileNameV3(newName, extra, &useHandle, cpNewName, cpNewNameLen, targetFile, newCaseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } if (useHandle) { *hints |= HGFS_RENAME_HINT_USE_TARGETFILE_DESC; } LOG(8, ("%s: unpacking HGFS_OP_RENAME_V3 -> success\n", __FUNCTION__)); return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackRenamePayloadV2 -- * * Unpack hgfs rename request V2 payload and initialize a corresponding * HgfsHandle or file name to tell us which to delete. Hints * holds flags to specify a handle or name for the file or * directory to rename. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackRenamePayloadV2(const HgfsRequestRenameV2 *requestV2, // IN: request payload size_t payloadSize, // IN: payload size const char **cpOldName, // OUT: rename src size_t *cpOldNameLen, // OUT: rename src size const char **cpNewName, // OUT: rename dst size_t *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle HgfsHandle *targetFile) // OUT: target file handle { const HgfsFileName *newName; size_t extra; /* Enforced by the dispatch function. */ if (payloadSize < sizeof *requestV2) { LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } extra = payloadSize - sizeof *requestV2; *hints = requestV2->hints; /* * If we've been asked to reuse a handle, we don't need to look at, let * alone test the filename or its length. This applies to the source * and the target. */ if (*hints & HGFS_RENAME_HINT_USE_SRCFILE_DESC) { *srcFile = requestV2->srcFile; *cpOldName = NULL; *cpOldNameLen = 0; } else { if (!HgfsUnpackFileName(&requestV2->oldName, extra, cpOldName, cpOldNameLen)) { LOG(4, ("%s: Error decoding HGFS packet - not enough room for file name\n", __FUNCTION__)); return FALSE; } extra -= *cpOldNameLen; } if (*hints & HGFS_RENAME_HINT_USE_TARGETFILE_DESC) { *targetFile = requestV2->targetFile; *cpNewName = NULL; *cpNewNameLen = 0; } else { newName = (const HgfsFileName *)((char *)(&requestV2->oldName + 1) + *cpOldNameLen); if (!HgfsUnpackFileName(newName, extra, cpNewName, cpNewNameLen)) { LOG(4, ("%s: Error decoding HGFS packet - not enough room for file name\n", __FUNCTION__)); return FALSE; } } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackRenamePayloadV1 -- * * Unpack hgfs rename request V1 payload and initialize a corresponding * old and new file names. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackRenamePayloadV1(const HgfsRequestRename *requestV1, // IN: request payload size_t payloadSize, // IN: payload size const char **cpOldName, // OUT: rename src size_t *cpOldNameLen, // OUT: rename src size const char **cpNewName, // OUT: rename dst size_t *cpNewNameLen) // OUT: rename dst size { const HgfsFileName *newName; uint32 extra; if (payloadSize < sizeof *requestV1) { return FALSE; } extra = payloadSize - sizeof *requestV1; if (!HgfsUnpackFileName(&requestV1->oldName, extra, cpOldName, cpOldNameLen)) { LOG(4, ("%s: Error decoding HGFS packet - not enough room for file name\n", __FUNCTION__)); return FALSE; } extra -= requestV1->oldName.length; newName = (const HgfsFileName *)((char *)(&requestV1->oldName + 1) + requestV1->oldName.length); return HgfsUnpackFileName(newName, extra, cpNewName, cpNewNameLen); } /* *----------------------------------------------------------------------------- * * HgfsUnpackRenameRequest -- * * Unpack hgfs rename request and initialize a corresponding * HgfsHandle or file name to tell us which to rename. Hints * holds flags to specify a handle or name for the file or * directory to rename. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackRenameRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation const char **cpOldName, // OUT: rename src size_t *cpOldNameLen, // OUT: rename src size const char **cpNewName, // OUT: rename dst size_t *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle HgfsHandle *targetFile, // OUT: target file handle uint32 *oldCaseFlags, // OUT: source case-sensitivity flags uint32 *newCaseFlags) // OUT: dest. case-sensitivity flags { ASSERT(packet); ASSERT(cpOldName); ASSERT(cpOldNameLen); ASSERT(cpNewName); ASSERT(cpNewNameLen); ASSERT(srcFile); ASSERT(targetFile); ASSERT(hints); ASSERT(oldCaseFlags); ASSERT(newCaseFlags); /* Default values for legacy requests. */ *oldCaseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *newCaseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *hints = 0; switch (op) { case HGFS_OP_RENAME_V3: { const HgfsRequestRenameV3 *requestV3 = packet; if (!HgfsUnpackRenamePayloadV3(requestV3, packetSize, cpOldName, cpOldNameLen, cpNewName, cpNewNameLen, hints, srcFile, targetFile, oldCaseFlags, newCaseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_RENAME_V2: { const HgfsRequestRenameV2 *requestV2 = packet; if (!HgfsUnpackRenamePayloadV2(requestV2, packetSize, cpOldName, cpOldNameLen, cpNewName, cpNewNameLen, hints, srcFile, targetFile)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_RENAME: { const HgfsRequestRename *requestV1 = packet; if (!HgfsUnpackRenamePayloadV1(requestV1, packetSize, cpOldName, cpOldNameLen, cpNewName, cpNewNameLen)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: LOG(4, ("%s: Invalid opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackRenameReply -- * * Pack hgfs rename reply. * Since the structure of the rename reply packet hasn't changed in * version 2 of the protocol, HgfsReplyRenameV2 is identical to * HgfsReplyRename. So use HgfsReplyRename type to access packetIn to * keep the code simple. * * Results: * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackRenameReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: requested operation size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (op) { case HGFS_OP_RENAME_V3: { HgfsReplyRenameV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply consists of only a reserved field. */ reply->reserved = 0; *payloadSize = sizeof *reply; break; } case HGFS_OP_RENAME_V2: case HGFS_OP_RENAME: { HgfsReplyRename *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: LOG(4, ("%s: invalid op code %d\n", __FUNCTION__, op)); result = FALSE; NOT_REACHED(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackGetattrPayloadV3 -- * * Unpack hgfs get attr request V3 payload and initialize a corresponding * HgfsHandle or file name to tell us which file to get attributes. Hints * holds flags to specify a handle or name for the file or * directory to get attributes. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackGetattrPayloadV3(const HgfsRequestGetattrV3 *requestV3,// IN: request payload size_t payloadSize, // IN: payload size const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsAttrHint *hints, // OUT: getattr hints HgfsHandle *file, // OUT: file handle uint32 *caseFlags) // OUT: case-sensitivity flags { Bool result = TRUE; Bool useHandle; if (payloadSize < sizeof *requestV3) { result = FALSE; goto exit; } *hints = requestV3->hints; if (!HgfsUnpackFileNameV3(&requestV3->fileName, payloadSize - sizeof *requestV3, &useHandle, cpName, cpNameSize, file, caseFlags)) { result = FALSE; goto exit; } if (useHandle) { *hints |= HGFS_ATTR_HINT_USE_FILE_DESC; } exit: LOG(8, ("%s: unpacking HGFS_OP_GETATTR_V3 -> %d\n", __FUNCTION__, result)); return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackGetattrPayloadV2 -- * * Unpack hgfs Getattr request V2 payload and initialize a corresponding * HgfsHandle or file name to tell us which to get attributes. Hints * holds flags to specify a handle or name for the file or * directory to get attributes. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackGetattrPayloadV2(const HgfsRequestGetattrV2 *requestV2,// IN: request payload size_t payloadSize, // IN: payload size const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsAttrHint *hints, // OUT: delete hints HgfsHandle *file) // OUT: file handle { Bool result = TRUE; if (payloadSize < sizeof *requestV2) { return FALSE; } *file = HGFS_INVALID_HANDLE; *hints = requestV2->hints; /* * If we've been asked to reuse a handle, we don't need to look at, let * alone test the filename or its length. */ if (requestV2->hints & HGFS_ATTR_HINT_USE_FILE_DESC) { *file = requestV2->file; *cpName = NULL; *cpNameSize = 0; } else { result = HgfsUnpackFileName(&requestV2->fileName, payloadSize - sizeof *requestV2, cpName, cpNameSize); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackGetattrPayloadV1 -- * * Unpack hgfs getattr request V1 payload and initialize a corresponding * file name to tell us which to get attributes. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackGetattrPayloadV1(const HgfsRequestGetattr *requestV1, // IN: request payload size_t payloadSize, // IN: payload size const char **cpName, // OUT: cpName size_t *cpNameSize) // OUT: cpName size { return HgfsUnpackFileName(&requestV1->fileName, payloadSize - sizeof *requestV1, cpName, cpNameSize); } /* *----------------------------------------------------------------------------- * * HgfsPackAttrV2 -- * * Packs attr version 2 reply structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackAttrV2(HgfsFileAttrInfo *attr, // IN: attr stucture HgfsAttrV2 *attr2) // OUT: attr in payload { attr2->mask = attr->mask; attr2->type = attr->type; attr2->size = attr->size; attr2->creationTime = attr->creationTime; attr2->accessTime = attr->accessTime; attr2->writeTime = attr->writeTime; attr2->attrChangeTime = attr->attrChangeTime; attr2->specialPerms = attr->specialPerms; attr2->ownerPerms = attr->ownerPerms; attr2->groupPerms = attr->groupPerms; attr2->otherPerms = attr->otherPerms; attr2->flags = attr->flags; attr2->allocationSize = attr->allocationSize; attr2->userId = attr->userId; attr2->groupId = attr->groupId; attr2->hostFileId = attr->hostFileId; attr2->volumeId = attr->volumeId; attr2->effectivePerms = attr->effectivePerms; } /* *----------------------------------------------------------------------------- * * HgfsUnpackAttrV2 -- * * Unpacks attr version 2 reply structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsUnpackAttrV2(const HgfsAttrV2 *attr2, // IN: attr in payload HgfsFileAttrInfo *attr) // OUT: attr stucture { attr->mask = attr2->mask; attr->type = attr2->type; attr->size = attr2->size; attr->creationTime = attr2->creationTime; attr->accessTime = attr2->accessTime; attr->writeTime = attr2->writeTime; attr->attrChangeTime = attr2->attrChangeTime; attr->specialPerms = attr2->specialPerms; attr->ownerPerms = attr2->ownerPerms; attr->groupPerms = attr2->groupPerms; attr->otherPerms = attr2->otherPerms; attr->flags = attr2->flags; attr->allocationSize = attr2->allocationSize; attr->userId = attr2->userId; attr->groupId = attr2->groupId; attr->hostFileId = attr2->hostFileId; attr->volumeId = attr2->volumeId; attr->effectivePerms = attr2->effectivePerms; } /* *----------------------------------------------------------------------------- * * HgfsInitFileAttr -- * * Initializes HgfsFileAttrInfo structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsInitFileAttr(HgfsOp op, // IN: request type HgfsFileAttrInfo *attr) // OUT: attr stucture { /* Initialize all fields with 0. */ memset(attr, 0, sizeof *attr); /* Explicitly initialize fields which need it. */ attr->requestType = op; attr->mask = HGFS_ATTR_VALID_NONE; } /* *----------------------------------------------------------------------------- * * HgfsPackGetattrReplyPayloadV3 -- * * Packs Getattr V3 reply payload. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackGetattrReplyPayloadV3(HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8TargetName, // IN: optional target name uint32 utf8TargetNameLen, // IN: file name length HgfsReplyGetattrV3 *reply) // OUT: payload { LOG(4, ("%s: attr type: %u\n", __FUNCTION__, attr->type)); HgfsPackAttrV2(attr, &reply->attr); reply->reserved = 0; if (utf8TargetName) { memcpy(reply->symlinkTarget.name, utf8TargetName, utf8TargetNameLen); CPNameLite_ConvertTo(reply->symlinkTarget.name, utf8TargetNameLen, DIRSEPC); } else { ASSERT(utf8TargetNameLen == 0); } reply->symlinkTarget.length = utf8TargetNameLen; reply->symlinkTarget.name[utf8TargetNameLen] = '\0'; reply->symlinkTarget.flags = 0; reply->symlinkTarget.fid = 0; reply->symlinkTarget.caseType = HGFS_FILE_NAME_DEFAULT_CASE; } /* *----------------------------------------------------------------------------- * * HgfsPackGetattrReplyPayloadV2 -- * * Packs rename reply payload V2 requests. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackGetattrReplyPayloadV2(HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8TargetName, // IN: optional target name uint32 utf8TargetNameLen, // IN: file name length HgfsReplyGetattrV2 *reply) // OUT: payload { HgfsPackAttrV2(attr, &reply->attr); if (utf8TargetName) { memcpy(reply->symlinkTarget.name, utf8TargetName, utf8TargetNameLen); CPNameLite_ConvertTo(reply->symlinkTarget.name, utf8TargetNameLen, DIRSEPC); } else { ASSERT(utf8TargetNameLen == 0); } reply->symlinkTarget.length = utf8TargetNameLen; reply->symlinkTarget.name[utf8TargetNameLen] = '\0'; } /* *----------------------------------------------------------------------------- * * HgfsPackGetattrReplyPayloadV1 -- * * Packs rename reply payload for V1 requests. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackGetattrReplyPayloadV1(HgfsFileAttrInfo *attr, // IN: attr stucture HgfsReplyGetattr *reply) // OUT: reply info { /* In GetattrV1, symlinks are treated as regular files. */ if (attr->type == HGFS_FILE_TYPE_SYMLINK) { reply->attr.type = HGFS_FILE_TYPE_REGULAR; } else { reply->attr.type = attr->type; } reply->attr.size = attr->size; reply->attr.creationTime = attr->creationTime; reply->attr.accessTime = attr->accessTime; reply->attr.writeTime = attr->writeTime; reply->attr.attrChangeTime = attr->attrChangeTime; reply->attr.permissions = attr->ownerPerms; } /* *----------------------------------------------------------------------------- * * HgfsUnpackGetattrRequest -- * * Unpack hgfs getattr request and initialize a corresponding * HgfsFileAttrInfo structure that is used to pass around getattr request * information. * * Since the structure of the get attributes request packet hasn't changed * in version 2 of the protocol, HgfsRequestGetattrV2 is identical to * HgfsRequestGetattr. So use HgfsRequestGetattr type to access packetIn to * keep the code simple. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackGetattrRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN request type HgfsFileAttrInfo *attrInfo, // IN/OUT: getattr info HgfsAttrHint *hints, // OUT: getattr hints const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsHandle *file, // OUT: file handle uint32 *caseType) // OUT: case-sensitivity flags { ASSERT(packet); ASSERT(attrInfo); ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); ASSERT(caseType); HgfsInitFileAttr(op, attrInfo); /* Default values for legacy requests. */ *caseType = HGFS_FILE_NAME_DEFAULT_CASE; *hints = 0; *file = HGFS_INVALID_HANDLE; switch (op) { case HGFS_OP_GETATTR_V3: { const HgfsRequestGetattrV3 *requestV3 = packet; if (!HgfsUnpackGetattrPayloadV3(requestV3, packetSize, cpName, cpNameSize, hints, file, caseType)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } LOG(4, ("%s: HGFS_OP_GETATTR_V3: %u\n", __FUNCTION__, *caseType)); break; } case HGFS_OP_GETATTR_V2: { const HgfsRequestGetattrV2 *requestV2 = packet; if (!HgfsUnpackGetattrPayloadV2(requestV2, packetSize, cpName, cpNameSize, hints, file)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_GETATTR: { const HgfsRequestGetattr *requestV1 = packet; if (!HgfsUnpackGetattrPayloadV1(requestV1, packetSize, cpName, cpNameSize)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackGetattrReply -- * * Pack hgfs getattr reply to the HgfsReplyGetattr structure. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackGetattrReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8TargetName, // IN: optional target name uint32 utf8TargetNameLen, // IN: file name length size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (attr->requestType) { case HGFS_OP_GETATTR_V3: { HgfsReplyGetattrV3 *reply; *payloadSize = sizeof *reply + utf8TargetNameLen; reply = HgfsAllocInitReply(packet, packetHeader, *payloadSize, session); HgfsPackGetattrReplyPayloadV3(attr, utf8TargetName, utf8TargetNameLen, reply); break; } case HGFS_OP_GETATTR_V2: { HgfsReplyGetattrV2 *reply; *payloadSize = sizeof *reply + utf8TargetNameLen; reply = HgfsAllocInitReply(packet, packetHeader, *payloadSize, session); HgfsPackGetattrReplyPayloadV2(attr, utf8TargetName, utf8TargetNameLen, reply); break; } case HGFS_OP_GETATTR: { HgfsReplyGetattr *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); HgfsPackGetattrReplyPayloadV1(attr, reply); *payloadSize = sizeof *reply; break; } default: LOG(4, ("%s: Invalid GetAttr op.\n", __FUNCTION__)); NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyHeaderV4 -- * * Packs SearchRead V4 reply header part for all entry records returned. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyHeaderV4(HgfsSearchReadInfo *info, // IN: reply info HgfsReplySearchReadV4 *reply, // OUT: payload size_t *headerSize) // OUT: size written { reply->numberEntriesReturned = info->numberRecordsWritten; reply->offsetToContinue = info->currentIndex; reply->flags = info->replyFlags; reply->reserved = 0; *headerSize = offsetof(HgfsReplySearchReadV4, entries); } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyRecordV4 -- * * Packs SearchRead V4 reply record. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyRecordV4(HgfsSearchReadEntry *entry, // IN: entry info HgfsDirEntryV4 *replylastEntry, // IN/OUT: payload HgfsDirEntryV4 *replyCurrentEntry) // OUT: reply buffer for dirent { HgfsFileAttrInfo *attr = &entry->attr; memset(replyCurrentEntry, 0, sizeof *replyCurrentEntry); if (NULL != replylastEntry) { replylastEntry->nextEntryOffset = ((char*)replyCurrentEntry - (char*)replylastEntry); } /* Set the valid data mask for the entry. */ replyCurrentEntry->mask = entry->mask; if (0 != (entry->mask & HGFS_SEARCH_READ_NAME)) { replyCurrentEntry->nextEntryOffset = 0; replyCurrentEntry->fileIndex = entry->fileIndex; if (0 != (replyCurrentEntry->mask & HGFS_SEARCH_READ_FILE_NODE_TYPE)) { replyCurrentEntry->fileType = attr->type; } if (0 != (entry->mask & HGFS_SEARCH_READ_FILE_SIZE)) { replyCurrentEntry->fileSize = attr->size; } if (0 != (entry->mask & HGFS_SEARCH_READ_ALLOCATION_SIZE)) { replyCurrentEntry->allocationSize = attr->allocationSize; } if (0 != (entry->mask & HGFS_SEARCH_READ_TIME_STAMP)) { replyCurrentEntry->creationTime = attr->creationTime; replyCurrentEntry->accessTime = attr->accessTime; replyCurrentEntry->writeTime = attr->writeTime; replyCurrentEntry->attrChangeTime = attr->attrChangeTime; } if (0 != (entry->mask & HGFS_SEARCH_READ_FILE_ATTRIBUTES)) { replyCurrentEntry->attrFlags = attr->flags; } if (0 != (entry->mask & HGFS_SEARCH_READ_FILE_ID)) { replyCurrentEntry->hostFileId = attr->hostFileId; } if (0 != (entry->mask & HGFS_SEARCH_READ_EA_SIZE)) { replyCurrentEntry->eaSize = attr->eaSize; } if (0 != (entry->mask & HGFS_SEARCH_READ_REPARSE_TAG)) { replyCurrentEntry->reparseTag = attr->reparseTag; } if (0 != (entry->mask & HGFS_SEARCH_READ_SHORT_NAME)) { ASSERT(attr->shortName.length > 0); memcpy(replyCurrentEntry->shortName.name, attr->shortName.name, attr->shortName.length); replyCurrentEntry->shortName.length = attr->shortName.length; } memcpy(replyCurrentEntry->fileName.name, entry->name, entry->nameLength); replyCurrentEntry->fileName.name[entry->nameLength] = 0; replyCurrentEntry->fileName.length = entry->nameLength; replyCurrentEntry->reserved = 0; } } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyHeaderV3 -- * * Packs SearchRead V3 reply record. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyHeaderV3(HgfsSearchReadInfo *info, // IN: reply info HgfsReplySearchReadV3 *reply, // OUT: payload size_t *headerSize) // OUT: size written { ASSERT(info->numberRecordsWritten <= 1 && 0 != (info->flags & HGFS_SEARCH_READ_SINGLE_ENTRY)); reply->count = info->numberRecordsWritten; reply->reserved = 0; /* * Previous shipping tools expect to account for a whole reply, * which is not strictly correct, but we are stuck with it. */ *headerSize = sizeof *reply; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyRecordV3 -- * * Packs SearchRead V3 reply record. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyRecordV3(HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8Name, // IN: file name uint32 utf8NameLen, // IN: file name length HgfsDirEntry *replyDirent) // OUT: reply buffer for dirent { replyDirent->fileName.length = (uint32)utf8NameLen; replyDirent->fileName.flags = 0; replyDirent->fileName.fid = 0; replyDirent->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; replyDirent->nextEntry = 0; if (utf8NameLen != 0) { memcpy(replyDirent->fileName.name, utf8Name, utf8NameLen); replyDirent->fileName.name[utf8NameLen] = 0; HgfsPackAttrV2(attr, &replyDirent->attr); } } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyHeaderV2 -- * * Packs SearchRead V2 reply header (common) part for all records. * V2 replies only contain a single record, so there is nothing to do here. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyHeaderV2(HgfsSearchReadInfo *info, // IN: unused HgfsReplySearchReadV2 *reply, // OUT: unused size_t *headerSize) // OUT: size written { /* The header has already been accounted for. */ *headerSize = sizeof *reply; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyRecordV2 -- * * Packs SearchRead V2 reply record. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyRecordV2(HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8Name, // IN: file name uint32 utf8NameLen, // IN: file name length HgfsReplySearchReadV2 *reply) // OUT: reply buffer { reply->fileName.length = (uint32)utf8NameLen; if (utf8NameLen != 0) { memcpy(reply->fileName.name, utf8Name, utf8NameLen); reply->fileName.name[utf8NameLen] = 0; HgfsPackAttrV2(attr, &reply->attr); } } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyHeaderV1 -- * * Packs SearchRead V1 reply header (common) part for all records. * V1 replies only contain a single record, so there is nothing to do here. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyHeaderV1(HgfsSearchReadInfo *info, // IN: unused HgfsReplySearchRead *reply, // OUT: unused size_t *headerSize) // OUT: size written { /* The header has already been accounted for. */ *headerSize = sizeof *reply; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyRecordV1 -- * * Packs SearchRead V1 reply record. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSearchReadReplyRecordV1(HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8Name, // IN: file name uint32 utf8NameLen, // IN: file name length HgfsReplySearchRead *reply) // OUT: reply buffer { reply->fileName.length = (uint32)utf8NameLen; if (utf8NameLen != 0) { memcpy(reply->fileName.name, utf8Name, utf8NameLen); reply->fileName.name[utf8NameLen] = 0; /* In SearchReadV1, symlinks are treated as regular files. */ if (attr->type == HGFS_FILE_TYPE_SYMLINK) { reply->attr.type = HGFS_FILE_TYPE_REGULAR; } else { reply->attr.type = attr->type; } reply->attr.size = attr->size; reply->attr.creationTime = attr->creationTime; reply->attr.accessTime = attr->accessTime; reply->attr.writeTime = attr->writeTime; reply->attr.attrChangeTime = attr->attrChangeTime; reply->attr.permissions = attr->ownerPerms; } } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchReadRequest -- * * Unpack hgfs search read request and initialize a corresponding * HgfsFileAttrInfo structure that is used to pass around attribute * information. * * Since the structure of the search read request packet hasn't changed in * version 2 of the protocol, HgfsRequestSearchReadV2 is identical to * HgfsRequestSearchRead. So use HgfsRequestSearchRead type to access * packetIn to keep the code simple. * * Results: * Always TRUE. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackSearchReadRequest(const void *packet, // IN: request packet size_t packetSize, // IN: packet size HgfsOp op, // IN: reqest type HgfsSearchReadInfo *info, // OUT: search info size_t *baseReplySize, // OUT: op base reply size size_t *inlineReplyDataSize, // OUT: size of inline reply data HgfsHandle *hgfsSearchHandle) // OUT: hgfs search handle { Bool result = TRUE; uint32 *startIndex; HgfsSearchReadMask *mask; HgfsSearchReadFlags *flags; size_t *replyPayloadSize; ASSERT(packet); ASSERT(info); ASSERT(baseReplySize); ASSERT(inlineReplyDataSize); ASSERT(hgfsSearchHandle); info->requestType = op; info->searchPattern = NULL; startIndex = &info->startIndex; replyPayloadSize = &info->payloadSize; mask = &info->requestedMask; flags = &info->flags; *mask = 0; *flags = 0; switch (op) { case HGFS_OP_SEARCH_READ_V4: { const HgfsRequestSearchReadV4 *request = packet; /* Enforced by the dispatch function. */ ASSERT(packetSize >= sizeof *request); if (0 != (request->flags & HGFS_SEARCH_READ_FID_OPEN_V4)) { /* * XXX - When this is implemented, the handle will get us a node, * (of directory type) and then with the node, we can look up a * search handle, if the data is cached in the search array. */ NOT_IMPLEMENTED(); } *hgfsSearchHandle = request->fid; *startIndex = request->restartIndex; *mask = request->mask; *flags = request->flags; *baseReplySize = offsetof(HgfsReplySearchReadV4, entries); *replyPayloadSize = request->replyDirEntryMaxSize; *inlineReplyDataSize = 0; ASSERT(*replyPayloadSize > 0); LOG(4, ("%s: HGFS_OP_SEARCH_READ_V4\n", __FUNCTION__)); break; } case HGFS_OP_SEARCH_READ_V3: { const HgfsRequestSearchReadV3 *request = packet; /* Enforced by the dispatch function. */ ASSERT(packetSize >= sizeof *request); *hgfsSearchHandle = request->search; *startIndex = request->offset; *flags = HGFS_SEARCH_READ_SINGLE_ENTRY; *mask = (HGFS_SEARCH_READ_FILE_NODE_TYPE | HGFS_SEARCH_READ_NAME | HGFS_SEARCH_READ_FILE_SIZE | HGFS_SEARCH_READ_TIME_STAMP | HGFS_SEARCH_READ_FILE_ATTRIBUTES | HGFS_SEARCH_READ_FILE_ID); *baseReplySize = offsetof(HgfsReplySearchReadV3, payload); *replyPayloadSize = HGFS_PACKET_MAX - *baseReplySize; *inlineReplyDataSize = *replyPayloadSize; LOG(4, ("%s: HGFS_OP_SEARCH_READ_V3\n", __FUNCTION__)); break; } case HGFS_OP_SEARCH_READ_V2: /* * Currently, the HgfsRequestSearchReadV2 is the same as * HgfsRequestSearchRead, so drop through. */ case HGFS_OP_SEARCH_READ: { const HgfsRequestSearchRead *request = packet; /* Enforced by the dispatch function. */ ASSERT(packetSize >= sizeof *request); *hgfsSearchHandle = request->search; *startIndex = request->offset; *flags = HGFS_SEARCH_READ_SINGLE_ENTRY; *mask = (HGFS_SEARCH_READ_FILE_NODE_TYPE | HGFS_SEARCH_READ_NAME | HGFS_SEARCH_READ_FILE_SIZE | HGFS_SEARCH_READ_TIME_STAMP | HGFS_SEARCH_READ_FILE_ATTRIBUTES); *baseReplySize = 0; *replyPayloadSize = HGFS_PACKET_MAX; *inlineReplyDataSize = *replyPayloadSize; break; } default: /* Should never occur. */ NOT_REACHED(); result = FALSE; Log("%s: ERROR Invalid OP %u\n", __FUNCTION__, op); break; } ASSERT(result); return result; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyRecord -- * * Pack hgfs search read reply record to the current entry record. * If the last record is not NULL then update its offset to the current * entry field. * * Results: * TRUE on success and number of bytes written in replyRecordSize. * FALSE on failure, nothing written. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSearchReadReplyRecord(HgfsOp requestType, // IN: search read request HgfsSearchReadEntry *entry, // IN: entry info size_t bytesRemaining, // IN: space in bytes for record void *lastSearchReadRecord, // IN/OUT: last packed entry void *currentSearchReadRecord,// OUT: currrent entry to pack size_t *replyRecordSize) // OUT: size of packet { Bool result = TRUE; size_t recordSize = 0; switch (requestType) { case HGFS_OP_SEARCH_READ_V4: { HgfsDirEntryV4 *replyCurrentEntry = currentSearchReadRecord; HgfsDirEntryV4 *replyLastEntry = lastSearchReadRecord; /* Skip the final empty record, it is not needed for V4.*/ if (0 == entry->nameLength) { break; } recordSize = offsetof(HgfsDirEntryV4, fileName.name) + entry->nameLength + 1; if (recordSize > bytesRemaining) { result = FALSE; break; } HgfsPackSearchReadReplyRecordV4(entry, replyLastEntry, replyCurrentEntry); break; } case HGFS_OP_SEARCH_READ_V3: { HgfsDirEntry *replyCurrentEntry = currentSearchReadRecord; /* * Previous shipping tools expect to account for a whole reply, * which is not strictly correct, it should be using * offsetof(HgfsDirEntry, fileName.name) + entry->nameLength + 1 * but we are stuck with it. */ recordSize = sizeof *replyCurrentEntry + entry->nameLength; if (recordSize > bytesRemaining) { result = FALSE; break; } HgfsPackSearchReadReplyRecordV3(&entry->attr, entry->name, entry->nameLength, replyCurrentEntry); break; } case HGFS_OP_SEARCH_READ_V2: { HgfsReplySearchReadV2 *replyV2 = currentSearchReadRecord; /* We have already accounted for the fixed part of the record. */ recordSize = entry->nameLength; if (recordSize > bytesRemaining) { result = FALSE; break; } HgfsPackSearchReadReplyRecordV2(&entry->attr, entry->name, entry->nameLength, replyV2); break; } case HGFS_OP_SEARCH_READ: { HgfsReplySearchRead *replyV1 = currentSearchReadRecord; /* We have already accounted for the fixed part of the record. */ recordSize = entry->nameLength; if (recordSize > bytesRemaining) { result = FALSE; break; } HgfsPackSearchReadReplyRecordV1(&entry->attr, entry->name, entry->nameLength, replyV1); break; } default: { Log("%s: Invalid SearchRead Op.", __FUNCTION__); NOT_REACHED(); result = FALSE; } } if (result) { *replyRecordSize = recordSize; } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchReadReplyHeader -- * * Pack hgfs search read reply header (common) part to all the * entries returned in the search read reply. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSearchReadReplyHeader(HgfsSearchReadInfo *info, // IN: request info size_t *payloadSize) // OUT: size of packet { Bool result = TRUE; *payloadSize = 0; switch (info->requestType) { case HGFS_OP_SEARCH_READ_V4: { HgfsReplySearchReadV4 *reply = info->reply; HgfsPackSearchReadReplyHeaderV4(info, reply, payloadSize); break; } case HGFS_OP_SEARCH_READ_V3: { HgfsReplySearchReadV3 *reply = info->reply; HgfsPackSearchReadReplyHeaderV3(info, reply, payloadSize); break; } case HGFS_OP_SEARCH_READ_V2: { HgfsReplySearchReadV2 *reply = info->reply; HgfsPackSearchReadReplyHeaderV2(info, reply, payloadSize); break; } case HGFS_OP_SEARCH_READ: { HgfsReplySearchRead *reply = info->reply; HgfsPackSearchReadReplyHeaderV1(info, reply, payloadSize); break; } default: { LOG(4, ("%s: Invalid SearchRead Op.", __FUNCTION__)); NOT_REACHED(); result = FALSE; } } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSetattrPayloadV3 -- * * Unpack hgfs set attr request V3 payload and initialize a corresponding * HgfsHandle or file name to tell us which file to set attributes. Hints * holds flags to specify a handle or name for the file or * directory to set attributes. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSetattrPayloadV3(const HgfsRequestSetattrV3 *requestV3,// IN: request payload size_t payloadSize, // IN: payload size HgfsFileAttrInfo *attr, // OUT: setattr info const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsAttrHint *hints, // OUT: getattr hints HgfsHandle *file, // OUT: file handle uint32 *caseFlags) // OUT: case-sensitivity flags { Bool result = TRUE; Bool useHandle; if (payloadSize < sizeof *requestV3) { result = FALSE; goto exit; } *hints = requestV3->hints; HgfsUnpackAttrV2(&requestV3->attr, attr); if (!HgfsUnpackFileNameV3(&requestV3->fileName, payloadSize - sizeof *requestV3, &useHandle, cpName, cpNameSize, file, caseFlags)) { result = FALSE; goto exit; } if (useHandle) { *hints |= HGFS_ATTR_HINT_USE_FILE_DESC; } exit: LOG(8, ("%s: unpacking HGFS_OP_SETATTR_V3 -> %d\n", __FUNCTION__, result)); return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSetattrPayloadV2 -- * * Unpack hgfs Setattr request V2 payload and initialize a corresponding * HgfsHandle or file name to tell us which to set attributes. Hints * holds flags to specify a handle or name for the file or * directory to set attributes. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSetattrPayloadV2(const HgfsRequestSetattrV2 *requestV2,// IN: request payload size_t payloadSize, // IN: payload size HgfsFileAttrInfo *attr, // OUT: setattr info const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsAttrHint *hints, // OUT: delete hints HgfsHandle *file) // OUT: file handle { Bool result = TRUE; /* Enforced by the dispatch function. */ if (payloadSize < sizeof *requestV2) { return FALSE; } LOG(4, ("%s: unpacking HGFS_OP_SETATTR_V2\n", __FUNCTION__)); *file = HGFS_INVALID_HANDLE; *hints = requestV2->hints; HgfsUnpackAttrV2(&requestV2->attr, attr); if (requestV2->hints & HGFS_ATTR_HINT_USE_FILE_DESC) { *file = requestV2->file; *cpName = NULL; *cpNameSize = 0; } else { result = HgfsUnpackFileName(&requestV2->fileName, payloadSize - sizeof *requestV2, cpName, cpNameSize); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSetattrPayloadV1 -- * * Unpack hgfs setattr request V1 payload and initialize a corresponding * file name to tell us which to set attributes. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSetattrPayloadV1(const HgfsRequestSetattr *requestV1, // IN: request payload size_t payloadSize, // IN: payload size HgfsFileAttrInfo *attr, // OUT: setattr info const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsAttrHint *hints) // OUT: setattr hints { LOG(4, ("%s: unpacking HGFS_OP_SETATTR\n", __FUNCTION__)); attr->mask = 0; attr->mask |= requestV1->update & HGFS_ATTR_SIZE ? HGFS_ATTR_VALID_SIZE : 0; attr->mask |= requestV1->update & HGFS_ATTR_CREATE_TIME ? HGFS_ATTR_VALID_CREATE_TIME : 0; attr->mask |= requestV1->update & HGFS_ATTR_ACCESS_TIME ? HGFS_ATTR_VALID_ACCESS_TIME : 0; attr->mask |= requestV1->update & HGFS_ATTR_WRITE_TIME ? HGFS_ATTR_VALID_WRITE_TIME : 0; attr->mask |= requestV1->update & HGFS_ATTR_CHANGE_TIME ? HGFS_ATTR_VALID_CHANGE_TIME : 0; attr->mask |= requestV1->update & HGFS_ATTR_PERMISSIONS ? HGFS_ATTR_VALID_OWNER_PERMS : 0; *hints |= requestV1->update & HGFS_ATTR_ACCESS_TIME_SET ? HGFS_ATTR_HINT_SET_ACCESS_TIME : 0; *hints |= requestV1->update & HGFS_ATTR_WRITE_TIME_SET ? HGFS_ATTR_HINT_SET_WRITE_TIME : 0; attr->type = requestV1->attr.type; attr->size = requestV1->attr.size; attr->creationTime = requestV1->attr.creationTime; attr->accessTime = requestV1->attr.accessTime; attr->writeTime = requestV1->attr.writeTime; attr->attrChangeTime = requestV1->attr.attrChangeTime; attr->ownerPerms = requestV1->attr.permissions; return HgfsUnpackFileName(&requestV1->fileName, payloadSize - sizeof *requestV1, cpName, cpNameSize); } /* *----------------------------------------------------------------------------- * * HgfsUnpackSetattrRequest -- * * Unpack hgfs setattr request and initialize a corresponding * HgfsFileAttrInfo structure that is used to pass around setattr request * information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackSetattrRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsFileAttrInfo *attr, // OUT: setattr info HgfsAttrHint *hints, // OUT: setattr hints const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsHandle *file, // OUT: server file ID uint32 *caseType) // OUT: case-sensitivity flags { ASSERT(packet); ASSERT(attr); ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); ASSERT(caseType); attr->requestType = op; /* Default values for legacy requests. */ *caseType = HGFS_FILE_NAME_DEFAULT_CASE; *hints = 0; *file = HGFS_INVALID_HANDLE; switch (op) { case HGFS_OP_SETATTR_V3: { const HgfsRequestSetattrV3 *requestV3 = packet; if (!HgfsUnpackSetattrPayloadV3(requestV3, packetSize, attr, cpName, cpNameSize, hints, file, caseType)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_SETATTR_V2: { const HgfsRequestSetattrV2 *requestV2 = packet; if (!HgfsUnpackSetattrPayloadV2(requestV2, packetSize, attr, cpName, cpNameSize, hints, file)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_SETATTR: { const HgfsRequestSetattr *requestV1 = packet; if (!HgfsUnpackSetattrPayloadV1(requestV1, packetSize, attr, cpName, cpNameSize, hints)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackSetattrReply -- * * Pack hgfs setattr reply. * Since the structure of the set attributes reply packet hasn't changed in * version 2 of the protocol, HgfsReplySetattrV2 is identical to * HgfsReplySetattr. So use HgfsReplySetattr type to access packetIn to * keep the code simple. * * Results: * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSetattrReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; *payloadSize = 0; switch (op) { case HGFS_OP_SETATTR_V3: { HgfsReplySetattrV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply consists of only a reserved field. */ reply->reserved = 0; *payloadSize = sizeof *reply; break; } case HGFS_OP_SETATTR_V2: case HGFS_OP_SETATTR: { HgfsReplySetattr *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: result = FALSE; LOG(4, ("%s: invalid op code %d\n", __FUNCTION__, op)); NOT_REACHED(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCreateDirPayloadV3 -- * * Unpack hgfs create directory request V3 payload and initialize a corresponding * file name to tell us which directory to create. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackCreateDirPayloadV3(const HgfsRequestCreateDirV3 *requestV3, // IN: request payload size_t payloadSize, // IN: payload size HgfsCreateDirInfo *info) // IN/OUT: info struct { /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ LOG(4, ("%s: HGFS_OP_CREATE_DIR_V3\n", __FUNCTION__)); ASSERT(payloadSize >= sizeof *requestV3); if (requestV3->fileName.length > payloadSize - sizeof *requestV3) { /* The input packet is smaller than the request. */ return FALSE; } if (!(requestV3->mask & HGFS_CREATE_DIR_VALID_FILE_NAME)) { /* We do not support requests without a valid file name. */ LOG(4, ("%s: Incorrect mask %x\n", __FUNCTION__, (uint32)requestV3->mask)); return FALSE; } /* * Copy all the fields into our carrier struct. Some will probably be * garbage, but it's simpler to copy everything now and check the * valid bits before reading later. */ info->mask = requestV3->mask; info->cpName = requestV3->fileName.name; info->cpNameSize = requestV3->fileName.length; info->caseFlags = requestV3->fileName.caseType; info->specialPerms = requestV3->specialPerms; info->fileAttr = requestV3->fileAttr; info->ownerPerms = requestV3->ownerPerms; info->groupPerms = requestV3->groupPerms; info->otherPerms = requestV3->otherPerms; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCreateDirPayloadV2 -- * * Unpack hgfs create directory request V2 payload and initialize a corresponding * file name to tell us which directory to create. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackCreateDirPayloadV2(const HgfsRequestCreateDirV2 *requestV2, // IN: request payload size_t payloadSize, // IN: payload size HgfsCreateDirInfo *info) // IN/OUT: info struct { /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ LOG(4, ("%s: HGFS_OP_CREATE_DIR_V2\n", __FUNCTION__)); ASSERT(payloadSize >= sizeof *requestV2); if (requestV2->fileName.length > payloadSize - sizeof *requestV2) { /* The input packet is smaller than the request. */ return FALSE; } if (!(requestV2->mask & HGFS_CREATE_DIR_VALID_FILE_NAME)) { /* We do not support requests without a valid file name. */ LOG(4, ("%s: Incorrect mask %x\n", __FUNCTION__, (uint32)requestV2->mask)); return FALSE; } /* * Copy all the fields into our carrier struct. Some will probably be * garbage, but it's simpler to copy everything now and check the * valid bits before reading later. */ info->mask = requestV2->mask; info->cpName = requestV2->fileName.name; info->cpNameSize = requestV2->fileName.length; info->specialPerms = requestV2->specialPerms; info->ownerPerms = requestV2->ownerPerms; info->groupPerms = requestV2->groupPerms; info->otherPerms = requestV2->otherPerms; info->fileAttr = 0; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCreateDirPayloadV1 -- * * Unpack hgfs create directory request V1 payload and initialize a corresponding * file name to tell us which directory to create. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackCreateDirPayloadV1(const HgfsRequestCreateDir *requestV1, // IN: request payload size_t payloadSize, // IN: payload size HgfsCreateDirInfo *info) // IN/OUT: info struct { /* * The request file name length is user-provided, so this test must be * carefully written to prevent wraparounds. */ LOG(4, ("%s: HGFS_OP_CREATE_DIR_V1\n", __FUNCTION__)); ASSERT(payloadSize >= sizeof *requestV1); if (requestV1->fileName.length > payloadSize - sizeof *requestV1) { /* The input packet is smaller than the request. */ LOG(4, ("%s: HGFS packet too small for the file name\n", __FUNCTION__)); return FALSE; } /* For CreateDirV1 requests, we know exactly what fields we expect. */ info->mask = HGFS_CREATE_DIR_VALID_OWNER_PERMS | HGFS_CREATE_DIR_VALID_FILE_NAME; info->cpName = requestV1->fileName.name; info->cpNameSize = requestV1->fileName.length; info->ownerPerms = requestV1->permissions; info->fileAttr = 0; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCreateDirRequest -- * * Unpack hgfs CreateDir request and initialize a corresponding * HgfsCreateDirInfo structure that is used to pass around CreateDir request * information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackCreateDirRequest(const void *packet, // IN: incoming packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: request type HgfsCreateDirInfo *info) // IN/OUT: info struct { ASSERT(packet); ASSERT(info); info->requestType = op; /* Default value for legacy requests. */ info->caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (op) { case HGFS_OP_CREATE_DIR_V3: { const HgfsRequestCreateDirV3 *requestV3 = packet; if (!HgfsUnpackCreateDirPayloadV3(requestV3, packetSize, info)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_CREATE_DIR_V2: { const HgfsRequestCreateDirV2 *requestV2 = packet; if (!HgfsUnpackCreateDirPayloadV2(requestV2, packetSize, info)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_CREATE_DIR: { const HgfsRequestCreateDir *requestV1 = packet; if (!HgfsUnpackCreateDirPayloadV1(requestV1, packetSize, info)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } default: LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackCreateDirReply -- * * Pack hgfs CreateDir reply. * * Results: * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackCreateDirReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; *payloadSize = 0; switch (op) { case HGFS_OP_CREATE_DIR_V3: { HgfsReplyCreateDirV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply consists of only a reserved field. */ reply->reserved = 0; *payloadSize = sizeof *reply; break; } case HGFS_OP_CREATE_DIR_V2: { HgfsReplyCreateDirV2 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } case HGFS_OP_CREATE_DIR: { HgfsReplyCreateDir *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: result = FALSE; LOG(4, ("%s: invalid op code %d\n", __FUNCTION__, op)); NOT_REACHED(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackWriteWin32StreamPayloadV3 -- * * Unpack hgfs write stream request V3 payload and initialize a corresponding * file name to tell us which directory to create. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackWriteWin32StreamPayloadV3(const HgfsRequestWriteWin32StreamV3 *requestV3, // IN: size_t payloadSize, // IN: HgfsHandle *file, // OUT: const char **data, // OUT: size_t *dataSize, // OUT: Bool *doSecurity) // OUT: { LOG(4, ("%s: HGFS_OP_WRITE_WIN32_STREAM_V3\n", __FUNCTION__)); if (payloadSize < sizeof *requestV3) { LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } if (payloadSize >= requestV3->requiredSize + sizeof *requestV3) { *file = requestV3->file; *data = requestV3->payload; *dataSize = requestV3->requiredSize; *doSecurity = (requestV3->flags & HGFS_WIN32_STREAM_IGNORE_SECURITY) == 0; return TRUE; } LOG(4, ("%s: HGFS packet too small - user data do not fit\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackWriteWin32StreamRequest -- * * Unpack hgfs SendFileUsingReader request. Returns file to write to, data * and whether to restore the security stream. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackWriteWin32StreamRequest(const void *packet, // IN: incoming packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: request type HgfsHandle *file, // OUT: file to write to const char **data, // OUT: data to write size_t *dataSize, // OUT: size of data Bool *doSecurity) // OUT: restore sec.str. { ASSERT(packet); ASSERT(file); ASSERT(data); ASSERT(dataSize); ASSERT(doSecurity); if (op != HGFS_OP_WRITE_WIN32_STREAM_V3) { /* The only supported version for the moment is V3. */ LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return HgfsUnpackWriteWin32StreamPayloadV3(packet, packetSize, file, data, dataSize, doSecurity); } /* *----------------------------------------------------------------------------- * * HgfsPackWriteWin32StreamReply -- * * Pack hgfs SendFileUsingReader reply. * Returns the actual amount of data written in the reply. * * Results: * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackWriteWin32StreamReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type uint32 actualSize, // IN: amount written size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { HgfsReplyWriteWin32StreamV3 *reply; Bool result = TRUE; *payloadSize = 0; if (HGFS_OP_WRITE_WIN32_STREAM_V3 == op) { reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->reserved = 0; reply->actualSize = actualSize; *payloadSize = sizeof *reply; } else { LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackReadPayload -- * * Unpack hgfs read payload to get the file handle and file offset to read from and * the length of data to read. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackReadPayload(const HgfsRequestRead *request, // IN: payload size_t payloadSize, // IN: payload size HgfsHandle* file, // OUT: HGFS handle to close uint64 *offset, // OUT: offset to read from uint32 *length) // OUT: length of data to read { LOG(4, ("%s: HGFS_OP_READ\n", __FUNCTION__)); if (payloadSize >= sizeof *request) { *file = request->file; *offset = request->offset; *length = request->requiredSize; return TRUE; } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackReadPayloadV3 -- * * Unpack hgfs read payload V3 to get parameters needed to perform read. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackReadPayloadV3(const HgfsRequestReadV3 *requestV3, // IN: payload size_t payloadSize, // IN: payload size HgfsHandle* file, // OUT: HGFS handle to close uint64 *offset, // OUT: offset to read from uint32 *length) // OUT: length of data to read { LOG(4, ("%s: HGFS_OP_READ_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { *file = requestV3->file; *offset = requestV3->offset; *length = requestV3->requiredSize; return TRUE; } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackReadRequest -- * * Unpack hgfs read request. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackReadRequest(const void *packet, // IN: HGFS request size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsHandle *file, // OUT: Handle to close uint64 *offset, // OUT: offset to read from uint32 *length) // OUT: length of data to read { Bool result; ASSERT(packet); switch (op) { case HGFS_OP_READ_FAST_V4: case HGFS_OP_READ_V3: { const HgfsRequestReadV3 *requestV3 = packet; result = HgfsUnpackReadPayloadV3(requestV3, packetSize, file, offset, length); break; } case HGFS_OP_READ: { const HgfsRequestRead *requestV1 = packet; result = HgfsUnpackReadPayload(requestV1, packetSize, file, offset, length); break; } default: NOT_REACHED(); result = FALSE; } if (!result) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackWritePayload -- * * Unpack hgfs write payload to get the file handle, file offset, of data to write, * write flags and pointer to the data to write. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackWritePayload(const HgfsRequestWrite *request, // IN: request payload size_t payloadSize, // IN: request payload size HgfsHandle* file, // OUT: HGFS handle to write to uint64 *offset, // OUT: offset to read from uint32 *length, // OUT: length of data to write HgfsWriteFlags *flags, // OUT: write flags const void **data) // OUT: data to be written { LOG(4, ("%s: HGFS_OP_WRITE\n", __FUNCTION__)); if (payloadSize >= sizeof *request) { if (sizeof *request + request->requiredSize - 1 <= payloadSize) { *file = request->file; *flags = request->flags; *offset = request->offset; *data = request->payload; *length = request->requiredSize; return TRUE; } } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackWritePayloadV3 -- * * Unpack hgfs write payload V3. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackWritePayloadV3(const HgfsRequestWriteV3 *requestV3, // IN: payload size_t payloadSize, // IN: request payload size HgfsHandle* file, // OUT: HGFS handle write to uint64 *offset, // OUT: offset to read from uint32 *length, // OUT: length of data to write HgfsWriteFlags *flags, // OUT: write flags const void **data) // OUT: data to be written { LOG(4, ("%s: HGFS_OP_WRITE_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { if (sizeof *requestV3 + requestV3->requiredSize - 1 <= payloadSize) { *file = requestV3->file; *flags = requestV3->flags; *offset = requestV3->offset; *data = requestV3->payload; *length = requestV3->requiredSize; return TRUE; } } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackWriteFastPayloadV4 -- * * Unpack hgfs write fast payload V4. * The only difference from V3 payload is that data to write are * provided in the payload but located in a separate buffer. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackWriteFastPayloadV4(const HgfsRequestWriteV3 *requestV3, // IN: payload size_t payloadSize, // IN: request payload size HgfsHandle* file, // OUT: HGFS handle write to uint64 *offset, // OUT: offset to write to uint32 *length, // OUT: size of data to write HgfsWriteFlags *flags) // OUT: write flags { LOG(4, ("%s: HGFS_OP_WRITE_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { *file = requestV3->file; *flags = requestV3->flags; *offset = requestV3->offset; *length = requestV3->requiredSize; return TRUE; } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackWriteRequest -- * * Unpack hgfs write request to get parameters and data to write. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackWriteRequest(const void *writeRequest,// IN: write request params size_t writeRequestSize, // IN: write request params size HgfsOp writeOp, // IN: request version HgfsHandle *file, // OUT: Handle to write to uint64 *offset, // OUT: offset to write to uint32 *length, // OUT: length of data to write HgfsWriteFlags *flags, // OUT: write flags const void **data) // OUT: data to be written { Bool result; switch (writeOp) { case HGFS_OP_WRITE_FAST_V4: { const HgfsRequestWriteV3 *requestV3 = writeRequest; *data = NULL; /* Write data is retrieved from shared memory. */ result = HgfsUnpackWriteFastPayloadV4(requestV3, writeRequestSize, file, offset, length, flags); break; } case HGFS_OP_WRITE_V3: { const HgfsRequestWriteV3 *requestV3 = writeRequest; result = HgfsUnpackWritePayloadV3(requestV3, writeRequestSize, file, offset, length, flags, data); break; } case HGFS_OP_WRITE: { const HgfsRequestWrite *requestV1 = writeRequest; result = HgfsUnpackWritePayload(requestV1, writeRequestSize, file, offset, length, flags, data); break; } default: LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, writeOp)); NOT_REACHED(); result = FALSE; } if (!result) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackWriteReply -- * * Pack hgfs write reply to the HgfsReplyWrite structure. * * Results: * Always TRUE, FALSE if bad opcode. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackWriteReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type uint32 actualSize, // IN: number of bytes that were written size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; *payloadSize = 0; switch (op) { case HGFS_OP_WRITE_FAST_V4: case HGFS_OP_WRITE_V3: { HgfsReplyWriteV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->reserved = 0; reply->actualSize = actualSize; *payloadSize = sizeof *reply; break; } case HGFS_OP_WRITE: { HgfsReplyWrite *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->actualSize = actualSize; *payloadSize = sizeof *reply; break; } default: NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackQueryVolumePayload -- * * Unpack hgfs query volume payload to get the file name which must be used to query * volume information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackQueryVolumePayload(const HgfsRequestQueryVolume *request, // IN: request payload size_t payloadSize, // IN: request payload size const char **fileName, // OUT: volume name size_t *nameLength) // OUT: volume name length { LOG(4, ("%s: HGFS_OP_QUERY_VOLUME_INFO\n", __FUNCTION__)); if (payloadSize >= sizeof *request) { return HgfsUnpackFileName(&request->fileName, payloadSize - sizeof *request + 1, fileName, nameLength); } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackQueryVolumePayloadV3 -- * * Unpack hgfs query volume payload V3. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackQueryVolumePayloadV3(const HgfsRequestQueryVolumeV3 *requestV3, // IN: payload size_t payloadSize, // IN: payload size Bool *useHandle, // OUT: use handle HgfsHandle* file, // OUT: HGFS handle const char **fileName, // OUT: volume name size_t *nameLength, // OUT: name length uint32 * caseFlags) // OUT: case flags { LOG(4, ("%s: HGFS_OP_QUERY_VOLUME_INFO_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { return HgfsUnpackFileNameV3(&requestV3->fileName, payloadSize - sizeof *requestV3 + 1, useHandle, fileName, nameLength, file, caseFlags); } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackQueryVolumeRequest -- * * Unpack hgfs query volume information request to get parameters related to * query volume operation. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackQueryVolumeRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type Bool *useHandle, // OUT: use handle const char **fileName, // OUT: file name size_t *fileNameLength, // OUT: file name length uint32 *caseFlags, // OUT: case sensitivity HgfsHandle *file) // OUT: Handle to the volume { ASSERT(packet); switch (op) { case HGFS_OP_QUERY_VOLUME_INFO_V3: { const HgfsRequestQueryVolumeV3 *requestV3 = packet; if (!HgfsUnpackQueryVolumePayloadV3(requestV3, packetSize, useHandle, file, fileName, fileNameLength, caseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_QUERY_VOLUME_INFO: { const HgfsRequestQueryVolume *requestV1 = packet; if (!HgfsUnpackQueryVolumePayload(requestV1, packetSize, fileName, fileNameLength)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } *file = HGFS_INVALID_HANDLE; *caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *useHandle = FALSE; break; } default: LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackQueryVolumeReply -- * * Pack hgfs query volume reply. * * Results: * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackQueryVolumeReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type uint64 freeBytes, // IN: volume free space uint64 totalBytes, // IN: volume capacity size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; *payloadSize = 0; switch (op) { case HGFS_OP_QUERY_VOLUME_INFO_V3: { HgfsReplyQueryVolumeV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->reserved = 0; reply->freeBytes = freeBytes; reply->totalBytes = totalBytes; *payloadSize = sizeof *reply; break; } case HGFS_OP_QUERY_VOLUME_INFO: { HgfsReplyQueryVolume *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->freeBytes = freeBytes; reply->totalBytes = totalBytes; *payloadSize = sizeof *reply; break; } default: result = FALSE; LOG(4, ("%s: invalid op code %d\n", __FUNCTION__, op)); NOT_REACHED(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSymlinkCreatePayload -- * * Unpack hgfs symbolic link payload to get symbolic link file name * and symbolic link target. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSymlinkCreatePayload(const HgfsRequestSymlinkCreate *request, // IN: request payload size_t payloadSize, // IN: payload size const char **srcFileName, // OUT: link file name size_t *srcNameLength, // OUT: file name length const char **tgFileName, // OUT: target file name size_t *tgNameLength) // OUT: target name length { uint32 prefixSize; LOG(4, ("%s: HGFS_OP_CREATE_SYMLINK_V3\n", __FUNCTION__)); prefixSize = offsetof(HgfsRequestSymlinkCreate, symlinkName.name); if (payloadSize >= prefixSize) { if (HgfsUnpackFileName(&request->symlinkName, payloadSize - prefixSize, srcFileName, srcNameLength)) { const HgfsFileName *targetName = (const HgfsFileName *)(*srcFileName + 1 + *srcNameLength); prefixSize = ((char *)targetName - (char *)request) + offsetof(HgfsFileName, name); return HgfsUnpackFileName(targetName, payloadSize - prefixSize, tgFileName, tgNameLength); } } return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSymlinkCreatePayloadV3 -- * * Unpack hgfs create symbolic link payload V3. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSymlinkCreatePayloadV3(const HgfsRequestSymlinkCreateV3 *requestV3, // IN: size_t payloadSize, // IN: Bool *srcUseHandle, // OUT: HgfsHandle* srcFile, // OUT: const char **srcFileName, // OUT: size_t *srcNameLength, // OUT: uint32 *srcCaseFlags, // OUT: Bool *tgUseHandle, // OUT: HgfsHandle* tgFile, // OUT: const char **tgFileName, // OUT: size_t *tgNameLength, // OUT: uint32 * tgCaseFlags) // OUT: { uint32 prefixSize; LOG(4, ("%s: HGFS_OP_CREATE_SYMLINK_V3\n", __FUNCTION__)); prefixSize = offsetof(HgfsRequestSymlinkCreateV3, symlinkName.name); if (payloadSize >= prefixSize) { if (HgfsUnpackFileNameV3(&requestV3->symlinkName, payloadSize - prefixSize, srcUseHandle, srcFileName, srcNameLength, srcFile, srcCaseFlags)) { const HgfsFileNameV3 *targetName; if (*srcUseHandle) { targetName = &requestV3->targetName; } else { targetName = (const HgfsFileNameV3 *)(*srcFileName + 1 + *srcNameLength); } prefixSize = ((char *)targetName - (char *)requestV3) + offsetof(HgfsFileNameV3, name); return HgfsUnpackFileNameV3(targetName, payloadSize - prefixSize, tgUseHandle, tgFileName, tgNameLength, tgFile, tgCaseFlags); } } return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSymlinkCreateRequest -- * * Unpack hgfs symbolic link creation request to get parameters related to * creating the symbolic link. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackSymlinkCreateRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type Bool *srcUseHandle, // OUT: use source handle const char **srcFileName, // OUT: source file name size_t *srcFileNameLength, // OUT: source file name length uint32 *srcCaseFlags, // OUT: source case sensitivity HgfsHandle *srcFile, // OUT: source file handle Bool *tgUseHandle, // OUT: use target handle const char **tgFileName, // OUT: target file name size_t *tgFileNameLength, // OUT: target file name length uint32 *tgCaseFlags, // OUT: target case sensitivity HgfsHandle *tgFile) // OUT: target file handle { ASSERT(packet); switch (op) { case HGFS_OP_CREATE_SYMLINK_V3: { const HgfsRequestSymlinkCreateV3 *requestV3 = packet; if (!HgfsUnpackSymlinkCreatePayloadV3(requestV3, packetSize, srcUseHandle, srcFile, srcFileName, srcFileNameLength, srcCaseFlags, tgUseHandle, tgFile, tgFileName, tgFileNameLength, tgCaseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_CREATE_SYMLINK: { const HgfsRequestSymlinkCreate *requestV1 = packet; if (!HgfsUnpackSymlinkCreatePayload(requestV1, packetSize, srcFileName, srcFileNameLength, tgFileName, tgFileNameLength)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } *srcFile = HGFS_INVALID_HANDLE; *srcCaseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *srcUseHandle = FALSE; *tgFile = HGFS_INVALID_HANDLE; *tgCaseFlags = HGFS_FILE_NAME_DEFAULT_CASE; *tgUseHandle = FALSE; break; } default: LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackSymlinkCreateReply -- * * Pack hgfs symbolic link creation reply. * * Results: * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSymlinkCreateReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (op) { case HGFS_OP_CREATE_SYMLINK_V3: { HgfsReplySymlinkCreateV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply only consists of a reserved field. */ reply->reserved = 0; *payloadSize = sizeof *reply; break; } case HGFS_OP_CREATE_SYMLINK: { HgfsReplySymlinkCreate *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); *payloadSize = sizeof *reply; break; } default: result = FALSE; LOG(4, ("%s: invalid op code %d\n", __FUNCTION__, op)); NOT_REACHED(); } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchOpenPayload -- * * Unpack hgfs search open payload to get name of directory to open. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSearchOpenPayload(const HgfsRequestSearchOpen *request, // IN: payload size_t payloadSize, // IN: payload size const char **dirName, // OUT: directory name size_t *dirNameLength) // OUT: name length { LOG(4, ("%s: HGFS_OP_SEARCH_OPEN\n", __FUNCTION__)); if (payloadSize >= sizeof *request) { if (sizeof *request + request->dirName.length - 1 <= payloadSize) { *dirName = request->dirName.name; *dirNameLength = request->dirName.length; return TRUE; } } LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchOpenPayloadV3 -- * * Unpack hgfs search open payload V3 to get name of directory to open and * case flags. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSearchOpenPayloadV3(const HgfsRequestSearchOpenV3 *requestV3, // IN: payload size_t payloadSize, // IN: payload size const char **dirName, // OUT: directory name size_t *dirNameLength, // OUT: name length uint32 *caseFlags) // OUT: case flags { Bool result = FALSE; LOG(4, ("%s: HGFS_OP_SEARCH_OPEN_V3\n", __FUNCTION__)); if (payloadSize >= sizeof *requestV3) { uint32 prefixSize = offsetof(HgfsRequestSearchOpenV3, dirName.name); Bool useDirHandle; HgfsHandle dirHandle; result = HgfsUnpackFileNameV3(&requestV3->dirName, payloadSize - prefixSize, &useDirHandle, dirName, dirNameLength, &dirHandle, caseFlags); if (useDirHandle) { LOG(4, ("%s: client is trying to a handle %u\n", __FUNCTION__, dirHandle)); result = FALSE; } } LOG(4, ("%s: returns %d\n", __FUNCTION__, result)); return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSearchOpenRequest -- * * Unpack hgfs search open request to get directory name and case flags. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackSearchOpenRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type const char **dirName, // OUT: directory name size_t *dirNameLength, // OUT: name length uint32 *caseFlags) // OUT: case flags { ASSERT(packet); switch (op) { case HGFS_OP_SEARCH_OPEN_V3: { const HgfsRequestSearchOpenV3 *requestV3 = packet; if (!HgfsUnpackSearchOpenPayloadV3(requestV3, packetSize, dirName, dirNameLength, caseFlags)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } break; } case HGFS_OP_SEARCH_OPEN: { const HgfsRequestSearchOpen *requestV1 = packet; if (!HgfsUnpackSearchOpenPayload(requestV1, packetSize, dirName, dirNameLength)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } *caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; break; } default: LOG(4, ("%s: Incorrect opcode %d\n", __FUNCTION__, op)); NOT_REACHED(); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackSearchOpenReply -- * * Pack hgfs search open reply. * * Results: * TRUE unless it is invoked for a wrong op (which indicates a bug in the code). * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSearchOpenReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type HgfsHandle search, // IN: search handle size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; switch (op) { case HGFS_OP_SEARCH_OPEN_V3: { HgfsReplySearchOpenV3 *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->reserved = 0; reply->search = search; *payloadSize = sizeof *reply; break; } case HGFS_OP_SEARCH_OPEN: { HgfsReplySearchOpen *reply; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->search = search; *payloadSize = sizeof *reply; break; } default: NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCreateSessionPayloadV4 -- * * Unpack hgfs create session request V4 payload. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackCreateSessionPayloadV4(const HgfsRequestCreateSessionV4 *requestV4, // IN: payload size_t payloadSize, // IN: HgfsCreateSessionInfo *info) // IN/OUT: info { LOG(4, ("%s: HGFS_OP_CREATE_SESSION_V4\n", __FUNCTION__)); if (payloadSize < offsetof(HgfsRequestCreateSessionV4, reserved)) { /* The input packet is smaller than the request. */ return FALSE; } if (requestV4->numCapabilities) { if (payloadSize < offsetof(HgfsRequestCreateSessionV4, capabilities) + requestV4->numCapabilities * sizeof(HgfsCapability)) { LOG(4, ("%s: HGFS packet too small\n", __FUNCTION__)); return FALSE; } } info->maxPacketSize = requestV4->maxPacketSize; info->flags = requestV4->flags; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackCreateSessionRequest -- * * Unpack hgfs CreateSession request and initialize a corresponding * HgfsCreateDirInfo structure that is used to pass around CreateDir request * information. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackCreateSessionRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: request type HgfsCreateSessionInfo *info) // IN/OUT: info struct { const HgfsRequestCreateSessionV4 *requestV4; ASSERT(packet); ASSERT(info); ASSERT(op == HGFS_OP_CREATE_SESSION_V4); requestV4 = packet; if (!HgfsUnpackCreateSessionPayloadV4(requestV4, packetSize, info)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackCreateSessionReply -- * * Pack hgfs CreateSession reply. * * Results: * Always TRUE. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackCreateSessionReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { HgfsReplyCreateSessionV4 *reply; uint32 numCapabilities = session->numberOfCapabilities; uint32 capabilitiesLen = numCapabilities * sizeof *session->hgfsSessionCapabilities; HGFS_ASSERT_PACK_PARAMS; *payloadSize = offsetof(HgfsReplyCreateSessionV4, capabilities) + capabilitiesLen; reply = HgfsAllocInitReply(packet, packetHeader, *payloadSize, session); reply->sessionId = session->sessionId; reply->numCapabilities = numCapabilities; reply->maxPacketSize = session->maxPacketSize; reply->identityOffset = 0; reply->flags = session->flags; reply->reserved = 0; memcpy(reply->capabilities, session->hgfsSessionCapabilities, capabilitiesLen); return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackDestroySessionReply -- * * Pack hgfs CreateSession reply. * * Results: * Always TRUE. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackDestroySessionReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { HgfsReplyDestroySessionV4 *reply; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); /* Reply only consists of a reserved field. */ *payloadSize = sizeof *reply; reply->reserved = 0; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerGetDefaultCapabilities -- * * Returns list capabilities that are supported by all sessions. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void HgfsServerGetDefaultCapabilities(HgfsCapability *capabilities, // OUT: capabilities uint32 *numberOfCapabilities) // OUT: number of items { *numberOfCapabilities = ARRAYSIZE(hgfsDefaultCapabilityTable); ASSERT(*numberOfCapabilities <= HGFS_OP_MAX); memcpy(capabilities, hgfsDefaultCapabilityTable, sizeof hgfsDefaultCapabilityTable); } /* *----------------------------------------------------------------------------- * * HgfsPackSetWatchReplyV4 -- * * Pack hgfs set watch V4 reply payload to the HgfsReplySetWatchV4 structure. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsPackSetWatchReplyV4(HgfsSubscriberHandle watchId, // IN: host id of thee new watch HgfsReplySetWatchV4 *reply) // OUT: reply buffer to fill { reply->watchId = watchId; reply->reserved = 0; } /* *----------------------------------------------------------------------------- * * HgfsPackSetWatchReply -- * * Pack hgfs set watch reply to the HgfsReplySetWatchV4 structure. * * Results: * TRUE if successfully allocated reply request, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackSetWatchReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: operation code HgfsSubscriberHandle watchId, // IN: id of the new watch size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HgfsReplySetWatchV4 *reply; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; if (HGFS_OP_SET_WATCH_V4 == op) { reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); HgfsPackSetWatchReplyV4(watchId, reply); *payloadSize = sizeof *reply; } else { NOT_REACHED(); result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackSetWatchPayloadV4 -- * * Unpack HGFS set directory notication watch payload version 4 and initializes * a corresponding HgfsHandle or file name to tell us which directory to watch. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackSetWatchPayloadV4(const HgfsRequestSetWatchV4 *requestV4, // IN: request payload size_t payloadSize, // IN: payload size Bool *useHandle, // OUT: handle or cpName uint32 *flags, // OUT: watch flags uint32 *events, // OUT: event filter const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsHandle *dir, // OUT: directory handle uint32 *caseFlags) // OUT: case-sensitivity { if (payloadSize < sizeof *requestV4) { return FALSE; } *flags = requestV4->flags; *events = requestV4->events; return HgfsUnpackFileNameV3(&requestV4->fileName, payloadSize - sizeof *requestV4, useHandle, cpName, cpNameSize, dir, caseFlags); } /* *----------------------------------------------------------------------------- * * HgfsUnpackSetWatchRequest -- * * Unpack hgfs set directory notication watch request and initialize a corresponding * HgfsHandle or directory name to tell us which directory to monitor. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackSetWatchRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation Bool *useHandle, // OUT: handle or cpName const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size uint32 *flags, // OUT: flags for the new watch uint32 *events, // OUT: event filter HgfsHandle *dir, // OUT: direrctory handle uint32 *caseFlags) // OUT: case-sensitivity flags { const HgfsRequestSetWatchV4 *requestV4 = packet; Bool result; ASSERT(packet); ASSERT(cpName); ASSERT(cpNameSize); ASSERT(dir); ASSERT(flags); ASSERT(events); ASSERT(caseFlags); ASSERT(useHandle); if (HGFS_OP_SET_WATCH_V4 != op) { NOT_REACHED(); result = FALSE; } else { result = HgfsUnpackSetWatchPayloadV4(requestV4, packetSize, useHandle, flags, events, cpName, cpNameSize, dir, caseFlags); } if (!result) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); } return result; } /* *----------------------------------------------------------------------------- * * HgfsPackRemoveWatchReply -- * * Pack hgfs remove watch reply to the HgfsReplyRemoveWatchV4 structure. * * Results: * TRUE if successfully allocated reply request, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackRemoveWatchReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: operation code size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session) // IN: Session info { Bool result = TRUE; HgfsReplyRemoveWatchV4 *reply; HGFS_ASSERT_PACK_PARAMS; *payloadSize = 0; if (HGFS_OP_REMOVE_WATCH_V4 != op) { NOT_REACHED(); result = FALSE; } else { reply = HgfsAllocInitReply(packet, packetHeader, sizeof *reply, session); reply->reserved = 0; *payloadSize = sizeof *reply; } return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackRemoveWatchPayload -- * * Unpack HGFS remove directory notication watch payload version 4. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackRemoveWatchPayloadV4(const HgfsRequestRemoveWatchV4 *requestV4, // IN: request payload size_t payloadSize, // IN: payload size HgfsSubscriberHandle *watchId) // OUT: watch id { if (payloadSize < sizeof *requestV4) { return FALSE; } *watchId = requestV4->watchId; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackRemoveWatchRequest -- * * Unpack hgfs remove directory notication watch request. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackRemoveWatchRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation HgfsSubscriberHandle *watchId) // OUT: watch Id to remove { const HgfsRequestRemoveWatchV4 *requestV4 = packet; ASSERT(packet); ASSERT(watchId); ASSERT(HGFS_OP_REMOVE_WATCH_V4 == op); if (HGFS_OP_REMOVE_WATCH_V4 != op) { return FALSE; } else if (!HgfsUnpackRemoveWatchPayloadV4(requestV4, packetSize, watchId)) { LOG(4, ("%s: Error decoding HGFS packet\n", __FUNCTION__)); return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackCalculateNotificationSize -- * * Calculates size needed for change notification packet. * * Results: * TRUE if successfully allocated reply request, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ size_t HgfsPackCalculateNotificationSize(char const *shareName, // IN: shared folder name char *fileName) // IN: relative file path { size_t result = sizeof (HgfsRequestNotifyV4); if (NULL != fileName) { size_t shareNameLen = strlen(shareName); result += strlen(fileName) + 1 + shareNameLen; } result += sizeof (HgfsHeader); return result; } /* *----------------------------------------------------------------------------- * * HgfsPackGetOplockBreakSize -- * * Gets the size needed for the oplock break request. * * Results: * Size of the oplock break request. * * Side effects: * None. * *----------------------------------------------------------------------------- */ size_t HgfsPackGetOplockBreakSize(void) { return sizeof (HgfsRequestOplockBreakV4) + sizeof (HgfsHeader); } /* *----------------------------------------------------------------------------- * * HgfsPackOplockBreakRequestV4( -- * * Pack hgfs oplock break V4 request to be sent to the guest. * * Results: * Length of the packed structure or 0 if the structure does not fit in the * the buffer. * * Side effects: * None * *----------------------------------------------------------------------------- */ static size_t HgfsPackOplockBreakRequestV4(HgfsHandle fileId, // IN: file ID HgfsLockType serverLock, // IN: lock type size_t bufferSize, // IN: available space HgfsRequestOplockBreakV4 *reply) // OUT: notification buffer { size_t size = 0; if (bufferSize < sizeof *reply) { goto exit; } reply->reserved = 0; reply->fid = fileId; reply->serverLock = serverLock; size = sizeof *reply; exit: return size; } /* *----------------------------------------------------------------------------- * * HgfsPackOplockBreakRequest -- * * Pack the HGFS protocol Oplock break request. * * Results: * TRUE if successfully packed the request, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackOplockBreakRequest(void *packet, // IN/OUT: Hgfs Packet HgfsHandle fileId, // IN: file ID HgfsLockType serverLock, // IN: lock type uint64 sessionId, // IN: session ID size_t *bufferSize) // IN/OUT: size of packet { size_t opBreakRequestSize; HgfsRequestOplockBreakV4 *opBreakRequest; HgfsHeader *header = packet; Bool result = TRUE; ASSERT(packet); ASSERT(bufferSize); if (*bufferSize < sizeof *header) { result = FALSE; goto exit; } /* * Initialize notification header. * Set status and requestId to 0 since these fields are not relevant for * oplock break requests. * Initialize payload size to 0 - it is not known yet and will be filled later. */ opBreakRequest = (HgfsRequestOplockBreakV4 *)((char *)header + sizeof *header); opBreakRequestSize = HgfsPackOplockBreakRequestV4(fileId, serverLock, *bufferSize - sizeof *header, opBreakRequest); if (0 == opBreakRequestSize) { result = FALSE; goto exit; } result = HgfsPackReplyHeaderV4(HGFS_ERROR_SUCCESS, opBreakRequestSize, HGFS_OP_OPLOCK_BREAK_V4, sessionId, 0, HGFS_PACKET_FLAG_REQUEST, *bufferSize, header); exit: return result; } /* *----------------------------------------------------------------------------- * * HgfsUnpackOplockBreakAckPayloadV4 -- * * Unpack HGFS oplock break acknowledge payload version 4. * * Results: * TRUE on success. * FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsUnpackOplockBreakAckPayloadV4(const HgfsReplyOplockBreakV4 *opBrkAck, // IN: request payload size_t payloadSize, // IN: payload size HgfsHandle *fileId, // OUT: file Id to remove HgfsLockType *serverLock) // OUT: lock type { if (payloadSize < sizeof *opBrkAck) { return FALSE; } *fileId = opBrkAck->fid; *serverLock = opBrkAck->serverLock; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsUnpackOplockBreakAckReply -- * * Unpack hgfs oplock break acknowledge reply. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsUnpackOplockBreakAckReply(const void *packet, // IN: HGFS packet size_t packetSize, // IN: reply packet size HgfsOp op, // IN: operation version HgfsHandle *fileId, // OUT: file Id to remove HgfsLockType *serverLock) // OUT: lock type { const HgfsReplyOplockBreakV4 *replyV4 = packet; Bool result = FALSE; ASSERT(fileId); ASSERT(serverLock); ASSERT(HGFS_OP_OPLOCK_BREAK_V4 == op); if (HGFS_OP_OPLOCK_BREAK_V4 == op) { result = HgfsUnpackOplockBreakAckPayloadV4(replyV4, packetSize, fileId, serverLock); } if (!result) { LOG(4, ("%s: Error unpacking HGFS_OP_OPLOCK_BREAK_V4 packet\n", __FUNCTION__)); } return result; } /* *----------------------------------------------------------------------------- * * HgfsBuildCPName -- * * Build crossplatform name out of share name and relative to the shared folder * file path. * * Results: * Length of the output crossplatform name. * * Side effects: * None * *----------------------------------------------------------------------------- */ static int HgfsBuildCPName(char const *shareName, // IN: utf8 share name char *fileName, // IN: utf8 file path char **cpName) // OUT: full name in cp format { size_t shareNameLen = strlen(shareName) + 1; size_t fileNameLen = strlen(fileName) + 1; char *fullName = Util_SafeMalloc(shareNameLen + fileNameLen); int cpNameResult; *cpName = Util_SafeMalloc(shareNameLen + fileNameLen); Str_Strcpy(fullName, shareName, shareNameLen); fullName[shareNameLen - 1] = DIRSEPC; Str_Strcpy(fullName + shareNameLen, fileName, fileNameLen); // Unescaped name can't be longer then escaped thus it must fit. cpNameResult = CPName_ConvertTo(fullName, shareNameLen + fileNameLen, *cpName); free(fullName); if (cpNameResult < 0) { free(*cpName); *cpName = NULL; } return cpNameResult; } /* *----------------------------------------------------------------------------- * * HgfsPackHgfsName -- * * Pack cpName into HgfsFileName structure. * * Results: * TRUE if there is enough space in the buffer, * FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsPackHgfsName(char *cpName, // IN: cpName to pack size_t cpNameLen, // IN: length of the cpName size_t availableSpace, // IN: space available for HgfsFileName size_t *nameSize, // OUT: space consumed by HgfsFileName HgfsFileName *fileName) // OUT: structure to pack cpName into { if (availableSpace < offsetof(HgfsFileName, name) + cpNameLen) { return FALSE; } fileName->length = cpNameLen; memcpy(fileName->name, cpName, cpNameLen); *nameSize = offsetof(HgfsFileName, name) + cpNameLen; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsPackChangeNotifyEventV4 -- * * Pack single change directory notification event information. * * Results: * Length of the packed structure or 0 if the structure does not fit in the * the buffer. * * Side effects: * None * *----------------------------------------------------------------------------- */ static size_t HgfsPackChangeNotifyEventV4(uint32 mask, // IN: event mask char const *shareName, // IN: share name char *fileName, // IN: file name size_t bufferSize, // IN: available space HgfsNotifyEventV4 *reply) // OUT: notificaiton buffer { size_t totalLength = 0; if (sizeof *reply > bufferSize) { /* Not enough space for the event, drop the event. */ goto exit; } reply->nextOffset = 0; reply->mask = mask; if (NULL != fileName) { char *cpFullName; size_t remainingSize; size_t hgfsNameSize; int cpFullNameSize; cpFullNameSize = HgfsBuildCPName(shareName, fileName, &cpFullName); if (cpFullNameSize < 0) { /* Could not build the crossplatform name, drop the event. */ goto exit; } remainingSize = bufferSize - offsetof(HgfsNotifyEventV4, fileName); if (!HgfsPackHgfsName(cpFullName, cpFullNameSize, remainingSize, &hgfsNameSize, &reply->fileName)) { /* Name would not fit, drop the event. */ free(cpFullName); goto exit; } remainingSize -= hgfsNameSize; totalLength = bufferSize - remainingSize; free(cpFullName); } else { reply->fileName.length = 0; totalLength = sizeof *reply; } exit: return totalLength; } /* *----------------------------------------------------------------------------- * * HgfsPackChangeNotifyRequestV4 -- * * Pack hgfs directory change notification request to be sent to the guest. * * Results: * Length of the packed structure or 0 if the structure does not fit in the * the buffer. * * Side effects: * None * *----------------------------------------------------------------------------- */ static size_t HgfsPackChangeNotifyRequestV4(HgfsSubscriberHandle watchId, // IN: watch uint32 flags, // IN: notify flags uint32 mask, // IN: event mask char const *shareName, // IN: share name char *fileName, // IN: relative file path size_t bufferSize, // IN: available space HgfsRequestNotifyV4 *reply) // OUT: notification buffer { size_t size; size_t notificationOffset; if (bufferSize < sizeof *reply) { return 0; } reply->watchId = watchId; reply->flags = flags; if ((flags & HGFS_NOTIFY_FLAG_OVERFLOW) == HGFS_NOTIFY_FLAG_OVERFLOW) { size = sizeof *reply; reply->count = 0; reply->flags = HGFS_NOTIFY_FLAG_OVERFLOW; } else { /* * For the moment server sends only one notification at a time and it relies * on transport to coalesce requests. * Later on we may consider supporting multiple notifications. */ reply->count = 1; notificationOffset = offsetof(HgfsRequestNotifyV4, events); size = HgfsPackChangeNotifyEventV4(mask, shareName, fileName, bufferSize - notificationOffset, reply->events); if (size != 0) { size += notificationOffset; } else { /* * Set event flag to tell guest that some events were dropped * when filling out notification details failed. */ size = sizeof *reply; reply->count = 0; reply->flags = HGFS_NOTIFY_FLAG_OVERFLOW; } } return size; } /* *----------------------------------------------------------------------------- * * HgfsPackChangeNotificationRequest -- * * Pack hgfs directory change notification request to the * HgfsRequestNotifyV4 structure. * * Results: * TRUE if successfully allocated reply request, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsPackChangeNotificationRequest(void *packet, // IN/OUT: Hgfs Packet HgfsSubscriberHandle subscriber, // IN: watch char const *shareName, // IN: share name char *fileName, // IN: relative name uint32 mask, // IN: event mask uint32 notifyFlags, // IN: notify flags HgfsSessionInfo *session, // IN: session size_t *bufferSize) // INOUT: size of packet { size_t notifyRequestSize; HgfsRequestNotifyV4 *notifyRequest; HgfsHeader *header = packet; Bool result; ASSERT(packet); ASSERT(shareName); ASSERT(NULL != fileName || (notifyFlags & HGFS_NOTIFY_FLAG_OVERFLOW) == HGFS_NOTIFY_FLAG_OVERFLOW); ASSERT(session); ASSERT(bufferSize); if (*bufferSize < sizeof *header) { return FALSE; } /* * Initialize notification header. * Set status and requestId to 0 since these fields are not relevant for * notifications. * Initialize payload size to 0 - it is not known yet and will be filled later. */ notifyRequest = (HgfsRequestNotifyV4 *)((char *)header + sizeof *header); notifyRequestSize = HgfsPackChangeNotifyRequestV4(subscriber, notifyFlags, mask, shareName, fileName, *bufferSize - sizeof *header, notifyRequest); if (0 != notifyRequestSize) { result = HgfsPackReplyHeaderV4(HGFS_ERROR_SUCCESS, notifyRequestSize, HGFS_OP_NOTIFY_V4, session->sessionId, 0, HGFS_PACKET_FLAG_REQUEST, *bufferSize, header); } else { result = FALSE; } return result; } open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerInt.h0000644000000000000000000011232712660700525021507 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef __HGFS_SERVER_INT_H__ # define __HGFS_SERVER_INT_H__ #include "vm_basic_types.h" struct DirectoryEntry; #ifndef _WIN32 typedef int fileDesc; #else # include typedef HANDLE fileDesc; #endif #include "dbllnklst.h" #include "hgfsProto.h" #include "cpName.h" // for HgfsNameStatus #include "hgfsServerPolicy.h" #include "hgfsUtil.h" // for HgfsInternalStatus #include "vm_atomic.h" #include "userlock.h" #include "hgfsServer.h" // for the server public types #define HGFS_DEBUG_ASYNC (0) typedef struct HgfsTransportSessionInfo HgfsTransportSessionInfo; /* Identifier for a local file */ typedef struct HgfsLocalId { uint64 volumeId; uint64 fileId; } HgfsLocalId; typedef enum { REQ_ASYNC, /* Hint that request should be processed Async. */ REQ_SYNC, /* " Sync. */ } RequestHint; /* Three possible filenode states */ typedef enum { FILENODE_STATE_UNUSED, /* Linked on the free list */ FILENODE_STATE_IN_USE_CACHED, /* Linked on the cached nodes list */ FILENODE_STATE_IN_USE_NOT_CACHED, /* Not linked on any list */ } FileNodeState; /* Three possible search types */ typedef enum { DIRECTORY_SEARCH_TYPE_DIR, /* Objects are files and subdirectories */ DIRECTORY_SEARCH_TYPE_BASE, /* Objects are shares */ DIRECTORY_SEARCH_TYPE_OTHER, /* Objects are the contents of "root/drive" or contents of "root" */ } DirectorySearchType; #define HGFS_SEARCH_LAST_ENTRY_INDEX ((uint32)~((uint32)0)) /* Two possible volume info type */ typedef enum { VOLUME_INFO_TYPE_MIN, VOLUME_INFO_TYPE_MAX, } VolumeInfoType; /* * The "default" share access is used in cross-platform code, so it's helpful * to have a single macro for accessing it. */ #ifdef _WIN32 # define HGFS_DEFAULT_SHARE_ACCESS (FILE_SHARE_READ | FILE_SHARE_WRITE | \ FILE_SHARE_DELETE) #else # define HGFS_DEFAULT_SHARE_ACCESS 0 #endif // _WIN32 typedef struct HgfsShareInfo { /* Filename of the root directory for the shared folder */ const char *rootDir; /* Length of the root directory filename (does not include nul terminator) */ size_t rootDirLen; /* Read permissions for the shared folder, needed for handle => name conversions. */ Bool readPermissions; /* Write permissions for the shared folder, needed for handle => name conversions. */ Bool writePermissions; /* * Shared folder handle used by change directory notification code to identify * shared folder. */ HgfsSharedFolderHandle handle; } HgfsShareInfo; /* * This struct represents a file on the local filesystem that has been * opened by a remote client. We store the name of the local file and * enough state to keep track of whether the file has changed locally * between remote accesses. None of the fields contain cross-platform * types; everything has been converted for the local filesystem. * * A file node object can only be in 1 of these 3 states: * 1) FILENODE_STATE_UNUSED: linked on the free list * 2) FILENODE_STATE_IN_USE_CACHED: Linked on the cached nodes list * 3) FILENODE_STATE_IN_USE_NOT_CACHED: Linked on neither of the above two lists. */ typedef struct HgfsFileNode { /* Links to place the object on various lists */ DblLnkLst_Links links; /* HGFS handle uniquely identifying this node. */ HgfsHandle handle; /* Local filename (in UTF8) */ char *utf8Name; /* Length of filename (does not include nul terminator) */ size_t utf8NameLen; /* share name */ char *shareName; /* Length of share name (does not include nul terminator) */ size_t shareNameLen; /* ID of file in local filesystem */ HgfsLocalId localId; /* File descriptor */ fileDesc fileDesc; /* On POSIX, access mode. On Windows, desired access */ uint32 mode; /* Share access to open with (Windows only) */ uint32 shareAccess; /* The server lock that the node currently has. */ HgfsLockType serverLock; /* File node state on lists */ FileNodeState state; /* File flags - see below. */ uint32 flags; /* * Context as required by some file operations. Eg: BackupWrite on * Windows: BackupWrite requires the caller to hold on to a pointer * to a Windows internal data structure between subsequent calls to * BackupWrite while restoring a file. */ void *fileCtx; /* Parameters associated with the share. */ HgfsShareInfo shareInfo; } HgfsFileNode; /* HgfsFileNode flags. */ /* TRUE if opened in append mode */ #define HGFS_FILE_NODE_APPEND_FL (1 << 0) /* Whether this file was opened in sequential mode. */ #define HGFS_FILE_NODE_SEQUENTIAL_FL (1 << 1) /* Whether this a shared folder open. */ #define HGFS_FILE_NODE_SHARED_FOLDER_OPEN_FL (1 << 2) /* * This struct represents a file search that a client initiated. * * A search object can only be in 1 of these 2 states: * 1) Unused: linked on the free list * 2) In use: unlinked */ typedef struct HgfsSearch { /* Links to place the object on various lists */ DblLnkLst_Links links; /* Flags to track state and information: see below. */ uint32 flags; /* HGFS handle uniquely identifying this search. */ HgfsHandle handle; /* Local directory name (in UTF8) */ char *utf8Dir; /* Length of directory name (does not include nul terminator) */ size_t utf8DirLen; /* Share name. */ char *utf8ShareName; /* Share name length. */ size_t utf8ShareNameLen; /* Directory entries for this search */ struct DirectoryEntry **dents; /* Number of dents */ uint32 numDents; /* * What type of search is this (what objects does it track)? This is * important to know so we can do the right kind of stat operation later * when we want to retrieve the attributes for each dent. */ DirectorySearchType type; /* Parameters associated with the share. */ HgfsShareInfo shareInfo; } HgfsSearch; /* HgfsSearch flags. */ /* TRUE if opened in append mode */ #define HGFS_SEARCH_FLAG_READ_ALL_ENTRIES (1 << 0) /* HgfsSessionInfo flags. */ typedef enum { HGFS_SESSION_TYPE_REGULAR, /* Dynamic session, created by the HgfsTransport. */ HGFS_SESSION_TYPE_INTERNAL, /* This is a static session. */ } HgfsSessionInfoType; /* HgfsSessionState, used for session status. */ typedef enum { HGFS_SESSION_STATE_OPEN, HGFS_SESSION_STATE_CLOSED, } HgfsSessionInfoState; typedef struct HgfsSessionInfo { DblLnkLst_Links links; Bool isInactive; /* The sessions state and capabilities. */ HgfsSessionFlags flags; /* Unique session id. */ uint64 sessionId; /* Max packet size that is supported by both client and server. */ uint32 maxPacketSize; /* Transport session context. */ HgfsTransportSessionInfo *transportSession; /* Current state of the session. */ HgfsSessionInfoState state; /* Lock to ensure some fileIO requests are atomic for a handle. */ MXUserExclLock *fileIOLock; int numInvalidationAttempts; Atomic_uint32 refCount; /* Reference count for session. */ /* ** START NODE ARRAY ************************************************** * * Lock for the following 6 fields: the node array, * counters and lists for this session. */ MXUserExclLock *nodeArrayLock; /* Open file nodes of this session. */ HgfsFileNode *nodeArray; /* Number of nodes in the nodeArray. */ uint32 numNodes; /* Free list of file nodes. LIFO to be cache-friendly. */ DblLnkLst_Links nodeFreeList; /* List of cached open nodes. */ DblLnkLst_Links nodeCachedList; /* Current number of open nodes. */ unsigned int numCachedOpenNodes; /* Number of open nodes having server locks. */ unsigned int numCachedLockedNodes; /** END NODE ARRAY ****************************************************/ /* ** START SEARCH ARRAY ************************************************ * * Lock for the following three fields: for the search array * and it's counter and list, for this session. */ MXUserExclLock *searchArrayLock; /* Directory entry cache for this session. */ HgfsSearch *searchArray; /* Number of entries in searchArray. */ uint32 numSearches; /* Free list of searches. LIFO. */ DblLnkLst_Links searchFreeList; /** END SEARCH ARRAY ****************************************************/ /* Array of session specific capabiities. */ HgfsCapability hgfsSessionCapabilities[HGFS_OP_MAX]; uint32 numberOfCapabilities; } HgfsSessionInfo; /* * This represents the maximum number of HGFS sessions that can be * created in a HGFS transport session. We picked a random value * for this variable. There is no specific reason behind picking * this value. */ #define MAX_SESSION_COUNT 1024 /* * This represents the maximum number attempts made by the HGFS * invalidator before completely destroying the HGFS session. We * picked a random value and there is no specific reason behind * the value 4 for thie variable. */ #define MAX_SESSION_INVALIDATION_ATTEMPTS 4 /* * These structs represent information about file open requests, file * attributes, and directory creation requests. * * The main reason for these structs is data abstraction -- we pass * a struct around instead of the individual parameters. This way * as more parameters are implemented, we don't have to add more * parameters to the functions, instead just extend the structs. */ typedef struct HgfsFileOpenInfo { HgfsOp requestType; HgfsHandle file; /* Opaque file ID used by the server */ HgfsOpenValid mask; /* Bitmask that specified which fields are valid. */ HgfsOpenMode mode; /* Which type of access requested. See desiredAccess */ HgfsOpenFlags flags; /* Which flags to open the file with */ HgfsPermissions specialPerms; /* Desired 'special' permissions for file creation */ HgfsPermissions ownerPerms; /* Desired 'owner' permissions for file creation */ HgfsPermissions groupPerms; /* Desired 'group' permissions for file creation */ HgfsPermissions otherPerms; /* Desired 'other' permissions for file creation */ HgfsAttrFlags attr; /* Attributes, if any, for file creation */ uint64 allocationSize; /* How much space to pre-allocate during creation */ uint32 desiredAccess; /* Extended support for windows access modes */ uint32 shareAccess; /* Windows only, share access modes */ HgfsLockType desiredLock; /* The type of lock desired by the client */ HgfsLockType acquiredLock; /* The type of lock acquired by the server */ uint32 cpNameSize; const char *cpName; char *utf8Name; uint32 caseFlags; /* Case-sensitivity flags. */ HgfsShareInfo shareInfo; /* Parameters associated with the share. */ } HgfsFileOpenInfo; typedef struct HgfsFileAttrInfo { HgfsOp requestType; HgfsAttrValid mask; HgfsFileType type; /* File type */ uint64 size; /* File size (in bytes) */ uint64 creationTime; /* Creation time. Ignored by POSIX */ uint64 accessTime; /* Time of last access */ uint64 writeTime; /* Time of last write */ uint64 attrChangeTime; /* Time file attributes were last * changed. Ignored by Windows */ HgfsPermissions specialPerms; /* Special permissions bits. Ignored by Windows */ HgfsPermissions ownerPerms; /* Owner permissions bits */ HgfsPermissions groupPerms; /* Group permissions bits. Ignored by Windows */ HgfsPermissions otherPerms; /* Other permissions bits. Ignored by Windows */ HgfsAttrFlags flags; /* Various flags and Windows 'attributes' */ uint64 allocationSize; /* Actual size of file on disk */ uint32 userId; /* User identifier, ignored by Windows */ uint32 groupId; /* group identifier, ignored by Windows */ uint64 hostFileId; /* File Id of the file on host: inode_t on Linux */ uint32 volumeId; /* Volume Id of the volune on which the file resides */ uint32 effectivePerms; /* Permissions in effect for the current user */ uint32 eaSize; /* Extended attribute data size */ uint32 reparseTag; /* Windows reparse point tag, valid by attr flag */ HgfsShortFileName shortName; /* Windows DOS 8 dot 3 name for long names */ } HgfsFileAttrInfo; typedef struct HgfsSearchReadEntry { HgfsSearchReadMask mask; /* Info returned mask */ HgfsFileAttrInfo attr; /* Attributes of entry */ uint32 fileIndex; /* Entry directory index */ char *name; /* Name */ uint32 nameLength; /* Name byte length */ } HgfsSearchReadEntry; typedef struct HgfsSearchReadInfo { HgfsOp requestType; /* HGFS request version */ HgfsSearchReadMask requestedMask; /* Entry info requested mask */ HgfsSearchReadFlags flags; /* Request specific flags */ HgfsSearchReadFlags replyFlags; /* Reply specific flags */ char *searchPattern; /* Search pattern to match entries with */ uint32 searchPatternLength; /* Byte length of search pattern */ uint32 startIndex; /* Starting index for entries */ uint32 currentIndex; /* Current index for entries */ uint32 numberRecordsWritten; /* Number of entries written */ void *reply; /* Fixed part of search read reply */ void *replyPayload; /* Variable part (dirent records) of reply */ size_t payloadSize; /* Remaining bytes in reply payload. */ } HgfsSearchReadInfo; typedef struct HgfsCreateDirInfo { HgfsOp requestType; HgfsCreateDirValid mask; HgfsPermissions specialPerms; /* Special permissions bits. Ignored by Windows */ HgfsPermissions ownerPerms; /* Owner permissions bits */ HgfsPermissions groupPerms; /* Group permissions bits. Ignored by Windows */ HgfsPermissions otherPerms; /* Other permissions bits. Ignored by Windows */ uint32 cpNameSize; const char *cpName; uint32 caseFlags; /* Case-sensitivity flags. */ HgfsAttrFlags fileAttr; /* Various flags and Windows 'attributes' */ } HgfsCreateDirInfo; typedef struct HgfsCreateSessionInfo { uint32 maxPacketSize; HgfsSessionFlags flags; /* Session capability flags. */ } HgfsCreateSessionInfo; Bool HgfsCreateAndCacheFileNode(HgfsFileOpenInfo *openInfo, // IN: Open info struct HgfsLocalId const *localId, // IN: Local unique file ID fileDesc fileDesc, // IN: OS file handle Bool append, // IN: Open with append flag HgfsSessionInfo *session); // IN: Session info Bool HgfsSearchHandle2FileName(HgfsHandle handle, // IN: Hgfs search handle char **fileName, // OUT: cp file name uint32 *fileNameSize); // OUT: cp file name size void HgfsUpdateNodeNames(const char *oldLocalName, // IN: Name of file to look for const char *newLocalName, // IN: Name to replace with HgfsSessionInfo *session); // IN: Session info Bool HgfsRemoveSearch(HgfsHandle searchHandle, HgfsSessionInfo *session); #ifdef VMX86_LOG #define HGFS_SERVER_DIR_DUMP_DENTS(_searchHandle, _session) do { \ if (DOLOG(4)) { \ HgfsServerDirDumpDents(_searchHandle, _session); \ } \ } while (0) void HgfsServerDirDumpDents(HgfsHandle searchHandle, // IN: Handle to dump dents from HgfsSessionInfo *session); // IN: Session info #else #define HGFS_SERVER_DIR_DUMP_DENTS(_searchHandle, _session) do {} while (0) #endif struct DirectoryEntry * HgfsGetSearchResult(HgfsHandle handle, // IN: Handle to search HgfsSessionInfo *session, // IN: Session info uint32 offset, // IN: Offset to retrieve at Bool remove); // IN: If true, removes the result Bool HgfsServerStatFs(const char *pathName, // IN: Path we're interested in size_t pathLength, // IN: Length of path uint64 *freeBytes, // OUT: Free bytes on volume uint64 *totalBytes); // OUT: Total bytes on volume HgfsNameStatus HgfsServerGetAccess(char *in, // IN: CP filename to check size_t inSize, // IN: Size of name in HgfsOpenMode mode, // IN: Requested access mode uint32 caseFlags, // IN: Case-sensitivity flags char **bufOut, // OUT: File name in local fs size_t *outLen); // OUT: Length of name out Bool HgfsServerIsSharedFolderOnly(char const *in, // IN: CP filename to check size_t inSize); // IN: Size of name in void * HgfsServerResEnumInit(void); Bool HgfsServerResEnumGet(void *enumState, char const **enumResName, size_t *enumResNameLen, Bool *enumResDone); Bool HgfsServerResEnumExit(void *enumState); HgfsInternalStatus HgfsServerGetDirEntry(HgfsHandle handle, // IN: Handle to search HgfsSessionInfo *session, // IN: Session info uint32 index, // IN: index to retrieve at Bool remove, // IN: If true, removes the result struct DirectoryEntry **dirEntry);// OUT: directory entry HgfsInternalStatus HgfsServerSearchRealDir(char const *baseDir, // IN: Directory to search size_t baseDirLen, // IN: Length of directory char const *shareName, // IN: Share name char const *rootDir, // IN: Root directory for the share HgfsSessionInfo *session, // IN: Session info HgfsHandle *handle); // OUT: Search handle HgfsInternalStatus HgfsServerSearchVirtualDir(HgfsServerResEnumGetFunc getName, // IN: Name enumerator HgfsServerResEnumInitFunc initName, // IN: Init function HgfsServerResEnumExitFunc cleanupName, // IN: Cleanup function DirectorySearchType type, // IN: Kind of search HgfsSessionInfo *session, // IN: Session info HgfsHandle *handle); // OUT: Search handle HgfsInternalStatus HgfsServerRestartSearchVirtualDir(HgfsServerResEnumGetFunc getName, // IN: Name enumerator HgfsServerResEnumInitFunc initName, // IN: Init function HgfsServerResEnumExitFunc cleanupName, // IN: Cleanup function HgfsSessionInfo *session, // IN: Session info HgfsHandle searchHandle); // IN: search to restart void * HgfsAllocInitReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: incoming packet header size_t replyDataSize, // IN: payload size HgfsSessionInfo *session); // IN: Session Info /* Node cache functions. */ Bool HgfsRemoveFromCache(HgfsHandle handle, // IN: Hgfs handle of the node HgfsSessionInfo *session); // IN: Session info Bool HgfsAddToCache(HgfsHandle handle, // IN: Hgfs handle of the node HgfsSessionInfo *session); // IN: Session info Bool HgfsIsCached(HgfsHandle handle, // IN: Hgfs handle of the node HgfsSessionInfo *session); // IN: Session info Bool HgfsIsServerLockAllowed(HgfsSessionInfo *session); // IN: session info Bool HgfsHandle2FileDesc(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info fileDesc *fd, // OUT: OS handle (file descriptor) void **fileCtx); // OUT: OS file context Bool HgfsFileDesc2Handle(fileDesc fd, // IN: OS handle (file descriptor) HgfsSessionInfo *session, // IN: session info HgfsHandle *handle); // OUT: Hgfs file handle Bool HgfsHandle2ShareMode(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info HgfsOpenMode *shareMode); // OUT: UTF8 file name size Bool HgfsHandle2FileName(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info char **fileName, // OUT: CP file name size_t *fileNameSize); // OUT: CP file name size Bool HgfsHandle2FileNameMode(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session,// IN: Session info Bool *readPermissions, // OUT: shared folder permissions Bool *writePermissions, // OUT: shared folder permissions char **fileName, // OUT: UTF8 file name size_t *fileNameSize); // OUT: UTF8 file name size Bool HgfsHandle2AppendFlag(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info Bool *appendFlag); // OUT: Append flag Bool HgfsHandle2LocalId(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info HgfsLocalId *localId); // OUT: Local id info Bool HgfsUpdateNodeFileDesc(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info fileDesc fd, // IN: OS handle (file desc void *fileCtx); // IN: OS file context Bool HgfsUpdateNodeServerLock(fileDesc fd, // IN: OS handle HgfsSessionInfo *session, // IN: session info HgfsLockType serverLock); // IN: new oplock Bool HgfsUpdateNodeAppendFlag(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info Bool appendFlag); // OUT: Append flag Bool HgfsGetNodeCopy(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info Bool copyName, // IN: Should we copy the name? HgfsFileNode *copy); // IN/OUT: Copy of the node Bool HgfsHandleIsSequentialOpen(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info Bool *sequentialOpen); // OUT: If open was sequential Bool HgfsHandleIsSharedFolderOpen(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info Bool *sharedFolderOpen); // OUT: If shared folder Bool HgfsGetSearchCopy(HgfsHandle handle, // IN: Hgfs search handle HgfsSessionInfo *session, // IN: Session info HgfsSearch *copy); // IN/OUT: Copy of the search Bool HgfsServerGetOpenMode(HgfsFileOpenInfo *openInfo, // IN: Open info to examine uint32 *modeOut); // OUT: Local mode char* HgfsServerGetTargetRelativePath(const char* source, // IN: source file name const char* target); // IN: target file name Bool HgfsServerCheckOpenFlagsForShare(HgfsFileOpenInfo *openInfo, // IN: Hgfs file handle HgfsOpenFlags *flags); // IN/OUT: open mode /* Platform specific exports. */ Bool HgfsPlatformInit(void); void HgfsPlatformDestroy(void); HgfsInternalStatus HgfsPlatformCloseFile(fileDesc fileDesc, // IN: OS handle of the file void *fileCtx); // IN: file context Bool HgfsPlatformDoFilenameLookup(void); HgfsNameStatus HgfsPlatformFilenameLookup(const char *sharePath, // IN: share path in question size_t sharePathLength, // IN char *fileName, // IN: filename to be looked up size_t fileNameLength, // IN uint32 caseFlags, // IN: case-sensitivity flags char **convertedFileName, // OUT: case-converted filename size_t *convertedFileNameLength); // OUT HgfsInternalStatus HgfsPlatformConvertFromNameStatus(HgfsNameStatus status); // IN: name status HgfsNameStatus HgfsPlatformPathHasSymlink(const char *fileName, // IN: fileName to be checked size_t fileNameLength, // IN const char *sharePath, // IN: share path in question size_t sharePathLen); // IN HgfsInternalStatus HgfsPlatformSymlinkCreate(char *localSymlinkName, // IN: symbolic link file name char *localTargetName); // IN: symlink target name HgfsInternalStatus HgfsPlatformGetattrFromName(char *fileName, // IN: file name HgfsShareOptions configOptions, // IN: configuration options char *shareName, // IN: share name HgfsFileAttrInfo *attr, // OUT: file attributes char **targetName); // OUT: Symlink target HgfsInternalStatus HgfsPlatformGetDirEntry(HgfsSearch *search, // IN: search HgfsSessionInfo *session, // IN: Session info uint32 offset, // IN: Offset to retrieve at Bool remove, // IN: If true, removes the result struct DirectoryEntry **dirEntry); // OUT: dirent HgfsInternalStatus HgfsPlatformSetDirEntry(HgfsSearch *search, // IN: search HgfsShareOptions configOptions, // IN: share configuration settings HgfsSessionInfo *session, // IN: session info struct DirectoryEntry *dirEntry, // IN: the indexed dirent Bool getAttr, // IN: get the entry attributes HgfsFileAttrInfo *entryAttr, // OUT: entry attributes, optional char **entryName, // OUT: entry name uint32 *entryNameLength); // OUT: entry name length HgfsInternalStatus HgfsPlatformScandir(char const *baseDir, // IN: Directory to search in size_t baseDirLen, // IN: Length of directory Bool followSymlinks, // IN: followSymlinks config option struct DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys int *numDents); // OUT: Number of DirectoryEntrys HgfsInternalStatus HgfsPlatformScanvdir(HgfsServerResEnumGetFunc enumNamesGet, // IN: Function to get name HgfsServerResEnumInitFunc enumNamesInit, // IN: Setup function HgfsServerResEnumExitFunc enumNamesExit, // IN: Cleanup function DirectorySearchType type, // IN: Kind of search struct DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys uint32 *numDents); // OUT: total number of directory entrys HgfsInternalStatus HgfsPlatformSearchDir(HgfsNameStatus nameStatus, // IN: name status const char *dirName, // IN: relative directory name size_t dirNameLength, // IN: length of dirName uint32 caseFlags, // IN: case flags HgfsShareInfo *shareInfo, // IN: sharfed folder information char *baseDir, // IN: name of the shared directory uint32 baseDirLen, // IN: length of the baseDir HgfsSessionInfo *session, // IN: session info HgfsHandle *handle); // OUT: search handle HgfsInternalStatus HgfsPlatformRestartSearchDir(HgfsHandle handle, // IN: search handle HgfsSessionInfo *session, // IN: session info DirectorySearchType searchType); // IN: Kind of search #ifdef VMX86_LOG void HgfsPlatformDirDumpDents(HgfsSearch *search); // IN: search #endif HgfsInternalStatus HgfsPlatformReadFile(fileDesc readFile, // IN: file descriptor HgfsSessionInfo *session, // IN: session info uint64 offset, // IN: file offset to read from uint32 requiredSize, // IN: length of data to read void* payload, // OUT: buffer for the read data uint32 *actualSize); // OUT: actual length read HgfsInternalStatus HgfsPlatformWriteFile(HgfsHandle file, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: session info uint64 offset, // IN: file offset to write to uint32 requiredSize, // IN: length of data to write HgfsWriteFlags flags, // IN: write flags const void *payload, // IN: data to be written uint32 *actualSize); // OUT: actual length written HgfsInternalStatus HgfsPlatformWriteWin32Stream(HgfsHandle file, // IN: packet header char *dataToWrite, // IN: data to write size_t requiredSize, // IN: data size Bool doSecurity, // IN: write ACL uint32 *actualSize, // OUT: written data size HgfsSessionInfo *session); // IN: session info HgfsInternalStatus HgfsPlatformVDirStatsFs(HgfsSessionInfo *session, // IN: session info HgfsNameStatus nameStatus, // IN: VolumeInfoType infoType, // IN: uint64 *outFreeBytes, // OUT: uint64 *outTotalBytes); // OUT: HgfsInternalStatus HgfsPlatformGetFd(HgfsHandle hgfsHandle, // IN: HGFS file handle HgfsSessionInfo *session, // IN: Session info Bool append, // IN: Open with append flag fileDesc *fd); // OUT: Opened file descriptor HgfsInternalStatus HgfsPlatformFileExists(char *utf8LocalName); // IN: Full file path utf8 encoding /* * NOTE. * This function requires valid localSrcName and localTargetName even when * srcFile and targetFile are specified. * Depending on some various conditions it may fall back on using file names * instead of file handles. */ HgfsInternalStatus HgfsPlatformRename(char *localSrcName, // IN: local path to source file fileDesc srcFile, // IN: source file handle char *localTargetName, // IN: local path to target file fileDesc targetFile, // IN: target file handle HgfsRenameHint hints); // IN: rename hints HgfsInternalStatus HgfsPlatformCreateDir(HgfsCreateDirInfo *info, // IN: direcotry properties char *utf8Name); // IN: full path for the new directory HgfsInternalStatus HgfsPlatformDeleteFileByHandle(HgfsHandle file, // IN: file being deleted HgfsSessionInfo *session); // IN: session info HgfsInternalStatus HgfsPlatformDeleteFileByName(char const *utf8Name); // IN: full file path in utf8 encoding HgfsInternalStatus HgfsPlatformDeleteDirByHandle(HgfsHandle dir, // IN: directory being deleted HgfsSessionInfo *session); // IN: session info HgfsInternalStatus HgfsPlatformDeleteDirByName(char const *utf8Name); // IN: full file path in utf8 encoding HgfsInternalStatus HgfsPlatformHandleIncompleteName(HgfsNameStatus nameStatus, // IN: name status HgfsFileAttrInfo *attr); // OUT: attributes void HgfsPlatformGetDefaultDirAttrs(HgfsFileAttrInfo *attr); // OUT: attributes HgfsInternalStatus HgfsPlatformGetattrFromFd(fileDesc fileDesc, // IN: file descriptor to query HgfsSessionInfo *session, // IN: session info HgfsFileAttrInfo *attr); // OUT: file attributes HgfsInternalStatus HgfsPlatformSetattrFromFd(HgfsHandle file, // IN: file descriptor HgfsSessionInfo *session, // IN: session info HgfsFileAttrInfo *attr, // IN: attrs to set HgfsAttrHint hints, // IN: attr hints Bool useHostTime); // IN: use current host time HgfsInternalStatus HgfsPlatformSetattrFromName(char *utf8Name, // IN: local file path HgfsFileAttrInfo *attr, // IN: attrs to set HgfsShareOptions configOptions, // IN: share options HgfsAttrHint hints, // IN: attr hints Bool useHostTime); // IN: use current host time HgfsInternalStatus HgfsPlatformValidateOpen(HgfsFileOpenInfo *openInfo, // IN: Open info struct Bool followLinks, // IN: follow symlinks on the host HgfsSessionInfo *session, // IN: Session info HgfsLocalId *localId, // OUT: Local unique file ID fileDesc *newHandle); // OUT: Handle to the file void * HSPU_GetMetaPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet size_t *metaPacketSize, // OUT: Size of metaPacket HgfsServerChannelCallbacks *chanCb); // IN: Channel callbacks Bool HSPU_ValidateDataPacketSize(HgfsPacket *packet, // IN: Hgfs Packet size_t dataSize); // IN: data size void * HSPU_GetDataPacketBuf(HgfsPacket *packet, // IN/OUT: Hgfs Packet MappingType mappingType, // IN: Readable/ Writeable ? HgfsServerChannelCallbacks *chanCb); // IN: Channel callbacks void HSPU_SetDataPacketSize(HgfsPacket *packet, // IN/OUT: Hgfs Packet size_t dataSize); // IN: data size void HSPU_PutDataPacketBuf(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb); // IN: Channel callbacks void HSPU_PutMetaPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb); // IN: Channel callbacks Bool HSPU_ValidateReplyPacketSize(HgfsPacket *packet, // IN: Hgfs Packet size_t replyHeaderSize, // IN: reply header size size_t replyResultSize, // IN: reply result size size_t replyResultDataSize, // IN: reply result data size Bool useMappedMetaPacket); // IN: using meta buffer void * HSPU_GetReplyPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb, // IN: Channel callbacks size_t replyDataSize, // IN: Size of reply data size_t *replyPacketSize); // OUT: Size of reply Packet void HSPU_PutReplyPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb); // IN: Channel callbacks #endif /* __HGFS_SERVER_INT_H__ */ open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerOplockInt.h0000644000000000000000000000354612660700525022661 0ustar rootroot/********************************************************* * Copyright (C) 2013-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerOplock.h -- * * Header file for private common data types used in the HGFS * opportunistic lock routines. */ #ifndef _HGFS_SERVER_OPLOCKINT_H_ #define _HGFS_SERVER_OPLOCKINT_H_ #include "hgfsProto.h" // for protocol types #include "hgfsServerInt.h" // for common server types e.g. HgfsSessionInfo /* * Does this platform have oplock support? We define it here to avoid long * ifdefs all over the code. For now, Linux and Windows hosts only. * * XXX: Just kidding, no oplock support yet. */ #if 0 #define HGFS_OPLOCKS #endif /* * XXX describe the data structure */ /* Server lock related structure */ typedef struct { fileDesc fileDesc; int32 event; HgfsLockType serverLock; } ServerLockData; /* * Global variables */ /* * Global functions */ #ifdef HGFS_OPLOCKS void HgfsServerOplockBreak(ServerLockData *data); void HgfsAckOplockBreak(ServerLockData *lockData, HgfsLockType replyLock); #endif #endif // ifndef _HGFS_SERVER_OPLOCKINT_H_ open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerOplock.h0000644000000000000000000000355612660700525022207 0ustar rootroot/********************************************************* * Copyright (C) 2013-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerOplock.h -- * * Header file for public common data types used in the HGFS * opportunistic lock routines. */ #ifndef _HGFS_SERVER_OPLOCK_H_ #define _HGFS_SERVER_OPLOCK_H_ #include "hgfsProto.h" // for protocol types #include "hgfsServerInt.h" // for common server types e.g. HgfsSessionInfo /* * Data structures */ /* * Global variables */ /* * Global functions */ Bool HgfsServerOplockInit(void); void HgfsServerOplockDestroy(void); Bool HgfsHandle2ServerLock(HgfsHandle handle, HgfsSessionInfo *session, HgfsLockType *lock); Bool HgfsFileHasServerLock(const char *utf8Name, HgfsSessionInfo *session, HgfsLockType *serverLock, fileDesc *fileDesc); Bool HgfsAcquireServerLock(fileDesc fileDesc, HgfsSessionInfo *session, HgfsLockType *serverLock); #endif // ifndef _HGFS_SERVER_OPLOCK_H_ open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerOplock.c0000644000000000000000000002375512660700525022205 0ustar rootroot/********************************************************* * Copyright (C) 2012-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerOplock.c -- * * HGFS server opportunistic lock support that is common to all platforms. */ #if defined(__APPLE__) #define _DARWIN_USE_64_BIT_INODE #endif #include #include #include "vmware.h" #include "str.h" #include "cpName.h" #include "cpNameLite.h" #include "hgfsServerInt.h" #include "hgfsServerOplockInt.h" /* * Local data */ /* * Global data */ /* * Local functions */ /* *----------------------------------------------------------------------------- * * HgfsServerOplockInit -- * * Set up any state needed to start HGFS server. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsServerOplockInit(void) { Bool result = FALSE; #ifdef HGFS_OPLOCKS result = HgfsPlatformOplockInit(); #endif return result; } /* *----------------------------------------------------------------------------- * * HgfsServerOplockDestroy -- * * Tear down any oplock related state used for HGFS server. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsServerOplockDestroy(void) { #ifdef HGFS_OPLOCKS /* Tear down oplock state, so we no longer catch signals. */ HgfsPlatformOplockDestroy(); #endif } /* *----------------------------------------------------------------------------- * * HgfsHandle2ServerLock -- * * Retrieve the serverlock information for the file node that corresponds to * the specified hgfs handle. If the server is not compiled with oplock * support, we always return TRUE and HGFS_LOCK_NONE. * * Results: * TRUE if the hgfs handle is valid and the lock was retrieved successfully. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsHandle2ServerLock(HgfsHandle handle, // IN: Hgfs file handle HgfsSessionInfo *session, // IN: Session info HgfsLockType *lock) // OUT: Server lock { #ifdef HGFS_OPLOCKS Bool found = FALSE; HgfsFileNode *fileNode = NULL; ASSERT(lock); MXUser_AcquireExclLock(session->nodeArrayLock); fileNode = HgfsHandle2FileNode(handle, session); if (fileNode == NULL) { goto exit; } *lock = fileNode->serverLock; found = TRUE; exit: MXUser_ReleaseExclLock(session->nodeArrayLock); return found; #else *lock = HGFS_LOCK_NONE; return TRUE; #endif } /* *----------------------------------------------------------------------------- * * HgfsFileHasServerLock -- * * Check if the file with the given name is already opened with a server * lock on it. If the server is compiled without oplock support, we always * return FALSE. * * Results: * TRUE if the node was found and has an oplock. * FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsFileHasServerLock(const char *utf8Name, // IN: Name in UTF8 HgfsSessionInfo *session, // IN: Session info HgfsLockType *serverLock, // OUT: Existing oplock fileDesc *fileDesc) // OUT: Existing fd { #ifdef HGFS_OPLOCKS unsigned int i; Bool found = FALSE; ASSERT(utf8Name); ASSERT(session); ASSERT(session->nodeArray); MXUser_AcquireExclLock(session->nodeArrayLock); for (i = 0; i < session->numNodes; i++) { HgfsFileNode *existingFileNode = &session->nodeArray[i]; if ((existingFileNode->state == FILENODE_STATE_IN_USE_CACHED) && (existingFileNode->serverLock != HGFS_LOCK_NONE) && (!stricmp(existingFileNode->utf8Name, utf8Name))) { LOG(4, ("Found file with a lock: %s\n", utf8Name)); *serverLock = existingFileNode->serverLock; *fileDesc = existingFileNode->fileDesc; found = TRUE; break; } } MXUser_ReleaseExclLock(session->nodeArrayLock); return found; #else return FALSE; #endif } #ifdef HGFS_OPLOCKS /* *----------------------------------------------------------------------------- * * HgfsServerOplockBreakReply -- * * The client was sent an oplock break request, and responded with this * reply. It contains the oplock status that the client is now in. Since * the break could have actually been a degrade, it is well within the * client's rights to transition to a non-broken state. We need to make * sure that such a transition was legal, acknowledge the brea * appropriately, and update our own state. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsServerOplockBreakReply(const unsigned char *packetIn, // IN: Reply packet unsigned int packetSize, // IN: Size of packet void *clientData) // IN: From request { HgfsReplyServerLockChange *reply; ServerLockData *lockData = clientData; ASSERT(packetIn); ASSERT(clientData); if (packetSize < sizeof *reply) { return; } reply = (HgfsReplyServerLockChange *)packetIn; /* * XXX: It should be safe to ignore the status and id from the actual * HgfsReply. The only information we need to properly acknowledge the break * is the original fd and the new lease, which, in the case of a degrade, * is double checked in HgfsAckOplockBreak, so we'd be safe from a garbage * value. */ HgfsAckOplockBreak(lockData, reply->serverLock); } /* *----------------------------------------------------------------------------- * * HgfsServerOplockBreak -- * * When the host FS needs to break the oplock so that another client * can open the file, it signals the event in the overlapped structure * that we used to request an oplock. * This sets off the following chains of events: * 1. Send the oplock break request to the guest. * 2. Once the guest acknowledges the oplock break, the completion * routine GuestRpcServerRequestCallback will fire, causing * HgfsServerOplockBreakReply to also fire, which will break the oplock * on the host FS. * * Results: * None. * * Side effects: * If successful, allocates memory for the rpc request. * *----------------------------------------------------------------------------- */ void HgfsServerOplockBreak(ServerLockData *lockData) { HgfsHandle hgfsHandle; char *requestBuffer = NULL; HgfsRequestServerLockChange *request; HgfsLockType lock; LOG(4, ("%s: entered\n", __FUNCTION__)); /* * XXX: Just because the file in not in the cache on the server, * does not mean it was closed on the client. It is possible that * we closed the file on the server because we ran out of space * in cache. That's why for now as long as a file has a lock, * we don't remove it from the node cache. This should be fixed. * * In any case, none of these cache-related failures should cause us to ack * the oplock break locally. That is because if the file wasn't in the * cache, or it had no lock, chances are someone else (maybe the VCPU * thread) broke the oplock and/or closed the file. */ if (!HgfsFileDesc2Handle(lockData->fileDesc, &hgfsHandle)) { LOG(4, ("%s: file is not in the cache\n", __FUNCTION__)); goto free_and_exit; } if (!HgfsHandle2ServerLock(hgfsHandle, &lock)) { LOG(4, ("%s: could not retrieve node's lock info.\n", __FUNCTION__)); goto free_and_exit; } if (lock == HGFS_LOCK_NONE) { LOG(4, ("%s: the file does not have a server lock.\n", __FUNCTION__)); goto free_and_exit; } /* * We need to setup the entire request here. The command prefix will be * added later, so save some space for it. * * XXX: This should probably go into a common allocation function that * other out-of-band requests can use. */ requestBuffer = malloc(sizeof *request + HGFS_CLIENT_CMD_LEN); if (requestBuffer == NULL) { LOG(4, ("%s: could not allocate memory.\n", __FUNCTION__)); goto ack_and_exit; } /* Save space for the command prefix. */ request = (HgfsRequestServerLockChange *) (requestBuffer + HGFS_CLIENT_CMD_LEN); request->header.op = HGFS_OP_SERVER_LOCK_CHANGE; request->header.id = 0; /* XXX */ request->file = hgfsHandle; request->newServerLock = lockData->serverLock; /* * Just send the request size for our actual request; our callee will * write in the command prefix and modify the request size appropriately. * * If for some reason we fail, we'll acknowledge the oplock break * immediately. */ if (HgfsServerManager_SendRequest(requestBuffer, sizeof *request, HgfsServerOplockBreakReply, lockData)) { return; } free(requestBuffer); ack_and_exit: HgfsAckOplockBreak(lockData, HGFS_LOCK_NONE); return; free_and_exit: free(lockData); } #endif open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerParameters.h0000644000000000000000000005123512660700525023060 0ustar rootroot/********************************************************* * Copyright (C) 2013-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerParameters.h -- * * This defines the HGFS protocol message packet functions * for creating requests and extracting data from replies. */ #ifndef _HGFS_SERVER_PARAMETERS_H_ #define _HGFS_SERVER_PARAMETERS_H_ #include "hgfsServer.h" // for HgfsPacket type #include "hgfsProto.h" // for the HGFS protocol request, reply and types #include "hgfsUtil.h" // for HgfsInternalStatus #include "hgfsServerInt.h" // for HgfsSessionInfo /* * Global functions */ HgfsInternalStatus HgfsUnpackPacketParams(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size Bool *sessionEnabled, // OUT: session enabled request uint64 *sessionId, // OUT: session Id uint32 *requestId, // OUT: unique request id HgfsOp *opcode, // OUT: request opcode size_t *payloadSize, // OUT: size of the opcode request const void **payload); // OUT: pointer to the opcode request Bool HgfsPackReplyHeader(HgfsInternalStatus status, // IN: reply status uint32 payloadSize, // IN: size of the reply payload Bool sessionEnabledHeader, // IN: session enabled header uint64 sessionId, // IN: session id uint32 requestId, // IN: request id HgfsOp op, // IN: request type uint32 hdrFlags, // IN: header flags size_t hdrPacketSize, // IN: header packet size void *hdrPacket); // OUT: outgoing packet header Bool HgfsUnpackOpenRequest(const void *packet, // IN: incoming packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: request type HgfsFileOpenInfo *openInfo); // IN/OUT: open info struct Bool HgfsPackOpenReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsFileOpenInfo *openInfo, // IN: open info struct size_t *payloadSize, // OUT: outgoing packet size HgfsSessionInfo *session); // IN: Session Info Bool HgfsUnpackGetattrRequest(const void *packetHeader, // IN: packet header size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsFileAttrInfo *attrInfo, // IN/OUT: unpacked attr struct HgfsAttrHint *hints, // OUT: getattr hints const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsHandle *file, // OUT: file handle uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsUnpackDeleteRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints HgfsHandle *file, // OUT: file handle uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsPackDeleteReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: requested operation size_t *payloadSize, // OUT: size of HGFS packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsUnpackRenameRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation const char **cpOldName, // OUT: rename src size_t *cpOldNameLen, // OUT: rename src size const char **cpNewName, // OUT: rename dst size_t *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle HgfsHandle *targetFile, // OUT: target file handle uint32 *oldCaseFlags, // OUT: old case-sensitivity flags uint32 *newCaseFlags); // OUT: new case-sensitivity flags Bool HgfsPackRenameReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: requested operation size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsPackGetattrReply(HgfsPacket *packet, // IN/OUT: Hgfs packet const void *packetHeader, // IN: packet header HgfsFileAttrInfo *attr, // IN: attr stucture const char *utf8TargetName, // IN: optional target name uint32 utf8TargetNameLen, // IN: file name length size_t *payloadSize, // OUT: size of HGFS packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsPackSymlinkCreateReply(HgfsPacket *packet, // IN/OUT: Hgfs packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of HGFS packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsUnpackSearchReadRequest(const void *packet, // IN: request packet size_t packetSize, // IN: packet size HgfsOp op, // IN: requested operation HgfsSearchReadInfo *info, // OUT: search info size_t *baseReplySize, // OUT: op base reply size size_t *inlineReplyDataSize, // OUT: size of inline reply data HgfsHandle *hgfsSearchHandle);// OUT: hgfs search handle Bool HgfsPackSearchReadReplyRecord(HgfsOp requestType, // IN: search read request HgfsSearchReadEntry *entry, // IN: entry info size_t maxRecordSize, // IN: max size in bytes for record void *lastSearchReadRecord, // IN/OUT: last packed entry void *currentSearchReadRecord,// OUT: currrent entry to pack size_t *replyRecordSize); // OUT: size of packet Bool HgfsPackSearchReadReplyHeader(HgfsSearchReadInfo *info, // IN: request info size_t *payloadSize); // OUT: size of packet Bool HgfsUnpackSetattrRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation HgfsFileAttrInfo *attr, // IN/OUT: getattr info HgfsAttrHint *hints, // OUT: setattr hints const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsHandle *file, // OUT: server file ID uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsPackSetattrReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsUnpackCreateDirRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: requested operation HgfsCreateDirInfo *info); // IN/OUT: info struct Bool HgfsPackCreateDirReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsPackQueryVolumeReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type uint64 freeBytes, // IN: volume free space uint64 totalBytes, // IN: volume capacity size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsUnpackQueryVolumeRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type Bool *useHandle, // OUT: use handle const char **fileName, // OUT: file name size_t *fileNameLength, // OUT: file name length uint32 *caseFlags, // OUT: case sensitivity HgfsHandle *file); // OUT: Handle to the volume Bool HgfsUnpackSymlinkCreateRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type Bool *srcUseHandle, // OUT: use source handle const char **srcFileName, // OUT: source file name size_t *srcFileNameLength, // OUT: source file name length uint32 *srcCaseFlags, // OUT: source case sensitivity HgfsHandle *srcFile, // OUT: source file handle Bool *tgUseHandle, // OUT: use target handle const char **tgFileName, // OUT: target file name size_t *tgFileNameLength, // OUT: target file name length uint32 *tgCaseFlags, // OUT: target case sensitivity HgfsHandle *tgFile); // OUT: target file handle Bool HgfsUnpackWriteWin32StreamRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: request type HgfsHandle *file, // OUT: file to write to const char **payload, // OUT: data to write size_t *requiredSize, // OUT: size of data Bool *doSecurity); // OUT: restore sec.str. Bool HgfsUnpackCreateSessionRequest(const void *packetHeader, // IN: request packet size_t packetSize, // IN: size of packet HgfsOp op, // IN: request type HgfsCreateSessionInfo *info); // IN/OUT: info struct Bool HgfsPackWriteWin32StreamReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet headert HgfsOp op, // IN: request type uint32 actualSize, // IN: amount written size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN:Session Info Bool HgfsUnpackCloseRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsHandle *file); // OUT: Handle to close Bool HgfsUnpackSearchOpenRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type const char **dirName, // OUT: directory name size_t *dirNameLength, // OUT: name length uint32 *caseFlags); // OUT: case flags Bool HgfsPackCloseReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsUnpackSearchCloseRequest(const void *packet, // IN: request packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsHandle *file); // OUT: Handle to close Bool HgfsPackSearchOpenReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type HgfsHandle search, // IN: search handle size_t *packetSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsPackSearchCloseReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type size_t *packetSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsPackWriteReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: request type uint32 actualSize, // IN: number of bytes that were written size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session info Bool HgfsUnpackReadRequest(const void *packet, // IN: HGFS request size_t packetSize, // IN: request packet size HgfsOp op, // IN: request type HgfsHandle *file, // OUT: Handle to close uint64 *offset, // OUT: offset to read from uint32 *length); // OUT: length of data to read Bool HgfsUnpackWriteRequest(const void *writeRequest,// IN: HGFS write request params size_t writeRequestSize, // IN: write request params size HgfsOp writeOp, // IN: request version HgfsHandle *file, // OUT: Handle to write to uint64 *offset, // OUT: offset to write to uint32 *length, // OUT: length of data to write HgfsWriteFlags *flags, // OUT: write flags const void **data); // OUT: data to be written Bool HgfsPackCreateSessionReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info Bool HgfsPackDestroySessionReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session Info void HgfsServerGetDefaultCapabilities(HgfsCapability *capabilities, // OUT: uint32 *numberOfCapabilities); // OUT: Bool HgfsUnpackSetWatchRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: request packet size HgfsOp op, // IN: requested operation Bool *useHandle, // OUT: handle or cpName const char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size uint32 *flags, // OUT: flags for the new watch uint32 *events, // OUT: event filter HgfsHandle *dir, // OUT: direrctory handle uint32 *caseFlags); // OUT: case-sensitivity flags Bool HgfsPackSetWatchReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: operation code HgfsSubscriberHandle watchId, // IN: new watch id size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session info Bool HgfsUnpackRemoveWatchRequest(const void *packet, // IN: HGFS packet size_t packetSize, // IN: packet size HgfsOp op, // IN: operation code HgfsSubscriberHandle *watchId); // OUT: watch Id Bool HgfsPackRemoveWatchReply(HgfsPacket *packet, // IN/OUT: Hgfs Packet const void *packetHeader, // IN: packet header HgfsOp op, // IN: operation code size_t *payloadSize, // OUT: size of packet HgfsSessionInfo *session); // IN: Session info size_t HgfsPackCalculateNotificationSize(char const *shareName, // IN: shared folder name char *fileName); // IN: file name Bool HgfsPackChangeNotificationRequest(void *packet, // IN/OUT: Hgfs Packet HgfsSubscriberHandle subscriber, // IN: watch char const *shareName, // IN: share name char *fileName, // IN: file name uint32 mask, // IN: event mask uint32 notifyFlags, // IN: notify flags HgfsSessionInfo *session, // IN: session size_t *bufferSize); // IN/OUT: packet size #endif // ifndef _HGFS_SERVER_PARAMETERS_H_ open-vm-tools-10.0.7-3227872/lib/hgfsServer/Makefile.in0000644000000000000000000004206012660700525020606 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/hgfsServer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libHgfsServer_la_LIBADD = am_libHgfsServer_la_OBJECTS = hgfsServer.lo hgfsServerLinux.lo \ hgfsServerPacketUtil.lo hgfsDirNotifyStub.lo \ hgfsServerParameters.lo hgfsServerOplock.lo \ hgfsServerOplockLinux.lo libHgfsServer_la_OBJECTS = $(am_libHgfsServer_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libHgfsServer_la_SOURCES) DIST_SOURCES = $(libHgfsServer_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libHgfsServer.la libHgfsServer_la_SOURCES = hgfsServer.c hgfsServerLinux.c \ hgfsServerPacketUtil.c hgfsDirNotifyStub.c \ hgfsServerParameters.c hgfsServerOplock.c \ hgfsServerOplockLinux.c AM_CFLAGS = -DVMTOOLS_USE_GLIB @GLIB2_CPPFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/hgfsServer/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/hgfsServer/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libHgfsServer.la: $(libHgfsServer_la_OBJECTS) $(libHgfsServer_la_DEPENDENCIES) $(LINK) $(libHgfsServer_la_OBJECTS) $(libHgfsServer_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsDirNotifyStub.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServerLinux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServerOplock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServerOplockLinux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServerPacketUtil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServerParameters.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsDirNotifyStub.c0000644000000000000000000001354112660700525022324 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsDirNotifyStub.c -- * * Stubs for directory notification support, used to build guest components. */ #include #include "vmware.h" #include "vm_basic_types.h" #include "hgfsProto.h" #include "hgfsServer.h" #include "hgfsUtil.h" #include "hgfsDirNotify.h" /* *----------------------------------------------------------------------------- * * HgfsNotify_Init -- * * Initialization for the notification component. * * Results: * Invalid value error. * * Side effects: * None. * *----------------------------------------------------------------------------- */ HgfsInternalStatus HgfsNotify_Init(void) { return HGFS_ERROR_NOT_SUPPORTED; } /* *----------------------------------------------------------------------------- * * HgfsNotify_Exit -- * * Exit for the notification component. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsNotify_Exit(void) { } /* *----------------------------------------------------------------------------- * * HgfsNotify_Deactivate -- * * Deactivates generating file system change notifications. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsNotify_Deactivate(HgfsNotifyActivateReason reason) // IN: reason unused { } /* *----------------------------------------------------------------------------- * * HgfsNotify_Activate -- * * Activates generating file system change notifications. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsNotify_Activate(HgfsNotifyActivateReason reason) // IN: reason unused { } /* *----------------------------------------------------------------------------- * * HgfsNotify_AddSharedFolder -- * * Allocates memory and initializes new shared folder structure. * * Results: * Opaque subscriber handle for the new subscriber or HGFS_INVALID_FOLDER_HANDLE * if adding shared folder fails. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsSharedFolderHandle HgfsNotify_AddSharedFolder(const char *path, // IN: path in the host const char *shareName) // IN: name of the shared folder { return HGFS_INVALID_FOLDER_HANDLE; } /* *----------------------------------------------------------------------------- * * HgfsNotify_AddSubscriber -- * * Allocates memory and initializes new subscriber structure. * Inserts allocated subscriber into corrspondent array. * * Results: * Opaque subscriber handle for the new subscriber or HGFS_INVALID_SUBSCRIBER_HANDLE * if adding subscriber fails. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsSubscriberHandle HgfsNotify_AddSubscriber(HgfsSharedFolderHandle sharedFolder, // IN: shared folder handle const char *path, // IN: relative path uint32 eventFilter, // IN: event filter uint32 recursive, // IN: look in subfolders HgfsNotifyEventReceiveCb eventCb, // IN notification callback struct HgfsSessionInfo *session) // IN: server context { return HGFS_INVALID_SUBSCRIBER_HANDLE; } /* *----------------------------------------------------------------------------- * * HgfsNotify_RemoveSharedFolder -- * * Deallcates memory used by shared folder and performs necessary cleanup. * Also deletes all subscribers that are defined for the shared folder. * * Results: * FALSE. * * Side effects: * Removes all subscribers that correspond to the shared folder and invalidates * thier handles. * *----------------------------------------------------------------------------- */ Bool HgfsNotify_RemoveSharedFolder(HgfsSharedFolderHandle sharedFolder) // IN { return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsNotify_RemoveSubscriber -- * * Deallcates memory used by NotificationSubscriber and performs necessary cleanup. * * Results: * FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool HgfsNotify_RemoveSubscriber(HgfsSubscriberHandle subscriber) // IN { return FALSE; } /* *----------------------------------------------------------------------------- * * HgfsNotify_RemoveSessionSubscribers -- * * Removes all entries that are related to a particular session. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void HgfsNotify_RemoveSessionSubscribers(struct HgfsSessionInfo *session) // IN { } open-vm-tools-10.0.7-3227872/lib/hgfsServer/hgfsServerPacketUtil.c0000644000000000000000000006045112660700525023015 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerPacketUtil.c -- * * Utility functions for manipulating packet used by hgfs server code */ #include #include #include #include "vmware.h" #include "hgfsServer.h" #include "hgfsServerInt.h" #include "util.h" #define LOGLEVEL_MODULE hgfs #include "loglevel_user.h" static void *HSPUGetBuf(HgfsServerChannelCallbacks *chanCb, MappingType mappingType, HgfsVmxIov *iov, uint32 iovCount, uint32 startIndex, size_t dataSize, size_t bufSize, void **buf, Bool *isAllocated, uint32 *iovMappedCount); static void HSPUPutBuf(HgfsServerChannelCallbacks *chanCb, MappingType mappingType, HgfsVmxIov *iov, uint32 iovCount, uint32 startIndex, size_t bufSize, void **buf, Bool *isAllocated, uint32 *iovMappedCount); static void HSPUCopyBufToIovec(HgfsVmxIov *iov, uint32 iovMapped, uint32 startIndex, void *buf, size_t bufSize); static void HSPUCopyIovecToBuf(HgfsVmxIov *iov, uint32 iovMapped, uint32 startIndex, void *buf, size_t bufSize); static Bool HSPUMapBuf(HgfsChannelMapVirtAddrFunc mapVa, HgfsChannelUnmapVirtAddrFunc putVa, size_t mapSize, uint32 startIndex, uint32 iovCount, HgfsVmxIov *iov, uint32 *mappedCount); static void HSPUUnmapBuf(HgfsChannelUnmapVirtAddrFunc unmapVa, uint32 startIndex, HgfsVmxIov *iov, uint32 *mappedCount); /* *----------------------------------------------------------------------------- * * HSPU_ValidateReplyPacketSize -- * * Validate a reply buffer size in an hgfs packet with the reply data * size for the request. * * Results: * TRUE if the reply buffer size is large enough for the request reply * results. FALSE if not. * * Side effects: * None. *----------------------------------------------------------------------------- */ Bool HSPU_ValidateReplyPacketSize(HgfsPacket *packet, // IN: Hgfs Packet size_t replyHeaderSize, // IN: reply header size size_t replyResultSize, // IN: reply result size size_t replyResultDataSize, // IN: reply result data size Bool useMappedMetaPacket) // IN: using meta buffer { size_t bytesRemaining; Bool replySizeIsOkay = FALSE; if (packet->replyPacket != NULL) { /* Pre-allocated reply buffer (as used by the backdoor). */ bytesRemaining = packet->replyPacketSize; } else if (useMappedMetaPacket) { /* No reply buffer (as used by the VMCI) reuse the metapacket buffer. */ bytesRemaining = packet->metaPacketSize; } else { /* No reply buffer but we will allocate the size required. */ replySizeIsOkay = TRUE; goto exit; } if (bytesRemaining >= replyHeaderSize) { bytesRemaining -= replyHeaderSize; } else { goto exit; } if (bytesRemaining >= replyResultSize) { bytesRemaining -= replyResultSize; } else { goto exit; } if (bytesRemaining >= replyResultDataSize) { replySizeIsOkay = TRUE; } exit: return replySizeIsOkay; } /* *----------------------------------------------------------------------------- * * HSPU_GetReplyPacket -- * * Get a reply packet given an hgfs packet. * Guest mappings may be established. * * Results: * Pointer to reply packet. * * Side effects: * Buffer may be allocated. *----------------------------------------------------------------------------- */ void * HSPU_GetReplyPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb, // IN: Channel callbacks size_t replyDataSize, // IN: Size of reply data size_t *replyPacketSize) // OUT: Size of reply Packet { if (packet->replyPacket != NULL) { /* * When we are transferring packets over backdoor, reply packet * is a static buffer. Backdoor should always return from here. */ packet->replyPacketDataSize = replyDataSize; LOG(4, ("Existing reply packet %s %"FMTSZ"u %"FMTSZ"u\n", __FUNCTION__, replyDataSize, packet->replyPacketSize)); ASSERT(replyDataSize <= packet->replyPacketSize); } else if (chanCb != NULL && chanCb->getWriteVa != NULL) { /* Can we write directly into guest memory? */ if (packet->metaPacket != NULL) { /* * Use the mapped metapacket buffer for the reply. * This currently makes assumptions about the mapping - * - It is mapped read -write * - It is always large enough for any reply * This will change as it is grossly inefficient as the maximum size * is always mapped and copied no matter how much data it really contains. */ LOG(10, ("%s Using meta packet for reply packet\n", __FUNCTION__)); ASSERT(BUF_READWRITEABLE == packet->metaMappingType); ASSERT(replyDataSize <= packet->metaPacketSize); packet->replyPacket = packet->metaPacket; packet->replyPacketDataSize = replyDataSize; packet->replyPacketSize = packet->metaPacketSize; packet->replyPacketIsAllocated = FALSE; /* * The reply is using the meta buffer so update the valid data size. * * Note, currently We know the reply size is going to be less than the * incoming request valid data size. This will updated when that part is * fixed. See the above comment about the assumptions and asserts. */ packet->metaPacketDataSize = packet->replyPacketDataSize; } else { NOT_IMPLEMENTED(); } } else { /* For sockets channel we always need to allocate buffer */ LOG(10, ("%s Allocating reply packet\n", __FUNCTION__)); packet->replyPacket = Util_SafeMalloc(replyDataSize); packet->replyPacketIsAllocated = TRUE; packet->replyPacketDataSize = replyDataSize; packet->replyPacketSize = replyDataSize; } *replyPacketSize = packet->replyPacketSize; return packet->replyPacket; } /* *----------------------------------------------------------------------------- * * HSPU_PutReplyPacket -- * * Free buffer if reply packet was allocated. * * Results: * None. * * Side effects: * None. *----------------------------------------------------------------------------- */ void HSPU_PutReplyPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb) // IN: Channel callbacks { /* * If there wasn't an allocated buffer for the reply, there is nothing to * do as the reply is in the metapacket buffer which will be handled by the * put on the metapacket. */ if (packet->replyPacketIsAllocated) { LOG(10, ("%s Freeing reply packet", __FUNCTION__)); free(packet->replyPacket); packet->replyPacketIsAllocated = FALSE; packet->replyPacket = NULL; packet->replyPacketSize = 0; } } /* *----------------------------------------------------------------------------- * * HSPU_GetMetaPacket -- * * Get a meta packet given an hgfs packet. * Guest mappings will be established. * * Results: * Pointer to meta packet. * * Side effects: * Buffer may be allocated. *----------------------------------------------------------------------------- */ void * HSPU_GetMetaPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet size_t *metaPacketSize, // OUT: Size of metaPacket HgfsServerChannelCallbacks *chanCb) // IN: Channel callbacks { *metaPacketSize = packet->metaPacketDataSize; if (packet->metaPacket != NULL) { return packet->metaPacket; } if (packet->metaPacketSize == 0) { return NULL; } packet->metaMappingType = BUF_READWRITEABLE; return HSPUGetBuf(chanCb, packet->metaMappingType, packet->iov, packet->iovCount, 0, packet->metaPacketDataSize, packet->metaPacketSize, &packet->metaPacket, &packet->metaPacketIsAllocated, &packet->metaPacketMappedIov); } /* *----------------------------------------------------------------------------- * * HSPU_ValidateDataPacketSize -- * * Validate a data packet buffer size in an hgfs packet with the required data * size for the request. * * Results: * TRUE if the data buffer size is valid for the request. * FALSE if not. * * Side effects: * None. *----------------------------------------------------------------------------- */ Bool HSPU_ValidateDataPacketSize(HgfsPacket *packet, // IN: Hgfs Packet size_t dataSize) // IN: data size { return (dataSize <= packet->dataPacketSize); } /* *----------------------------------------------------------------------------- * * HSPU_GetDataPacketBuf -- * * Get a data packet given an hgfs packet. * Guest mappings will be established. * * Results: * Pointer to data packet. * * Side effects: * Buffer may be allocated. *----------------------------------------------------------------------------- */ void * HSPU_GetDataPacketBuf(HgfsPacket *packet, // IN/OUT: Hgfs Packet MappingType mappingType, // IN: Writeable/Readable HgfsServerChannelCallbacks *chanCb) // IN: Channel callbacks { if (packet->dataPacket != NULL) { return packet->dataPacket; } if (packet->dataPacketSize == 0) { return NULL; } packet->dataMappingType = mappingType; return HSPUGetBuf(chanCb, packet->dataMappingType, packet->iov, packet->iovCount, packet->dataPacketIovIndex, packet->dataPacketDataSize, packet->dataPacketSize, &packet->dataPacket, &packet->dataPacketIsAllocated, &packet->dataPacketMappedIov); } /* *----------------------------------------------------------------------------- * * HSPUGetBuf -- * * Get a {meta, data} packet given an hgfs packet. * Guest mappings will be established. * * Results: * Pointer to buffer. * * Side effects: * Buffer may be allocated. *----------------------------------------------------------------------------- */ static void * HSPUGetBuf(HgfsServerChannelCallbacks *chanCb, // IN: Channel callbacks MappingType mappingType, // IN: Access type Readable/Writeable HgfsVmxIov *iov, // IN: iov array uint32 iovCount, // IN: iov array size uint32 startIndex, // IN: Start index of iov size_t dataSize, // IN: Size of data in tghe buffer size_t bufSize, // IN: Size of buffer void **buf, // OUT: Contigous buffer Bool *isAllocated, // OUT: Buffer allocated uint32 *iovMappedCount) // OUT: iov mapped count { uint32 iovMapped = 0; HgfsChannelMapVirtAddrFunc mapVa; Bool releaseMappings = FALSE; ASSERT(buf != NULL); *buf = NULL; *isAllocated = FALSE; if (chanCb == NULL) { goto exit; } if (mappingType == BUF_WRITEABLE || mappingType == BUF_READWRITEABLE) { mapVa = chanCb->getWriteVa; } else { ASSERT(mappingType == BUF_READABLE); mapVa = chanCb->getReadVa; } /* Looks like we are in the middle of poweroff. */ if (mapVa == NULL) { goto exit; } /* Establish guest memory mappings */ if (!HSPUMapBuf(mapVa, chanCb->putVa, bufSize, startIndex, iovCount, iov, &iovMapped)) { /* Guest probably passed us bad physical address */ goto exit; } if (iovMapped == 1) { /* A single page buffer is contiguous so hold on to guest mappings. */ *buf = iov[startIndex].va; goto exit; } /* More than one page was mapped. */ ASSERT(iov[startIndex].len < bufSize); LOG(10, ("%s: Hgfs Allocating buffer \n", __FUNCTION__)); *buf = Util_SafeMalloc(bufSize); *isAllocated = TRUE; if ((mappingType == BUF_READABLE || mappingType == BUF_READWRITEABLE) && (0 != dataSize)) { HSPUCopyIovecToBuf(iov, iovMapped, startIndex, *buf, dataSize); } releaseMappings = TRUE; exit: if (releaseMappings) { HSPUUnmapBuf(chanCb->putVa, startIndex, iov, &iovMapped); } *iovMappedCount = iovMapped; return *buf; } /* *----------------------------------------------------------------------------- * * HSPU_PutMetaPacket -- * * Free meta packet buffer if allocated. * Guest mappings will be released. * * Results: * void. * * Side effects: * *----------------------------------------------------------------------------- */ void HSPU_PutMetaPacket(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb) // IN: Channel callbacks { if (packet->metaPacket == NULL) { return; } LOG(4, ("%s Hgfs Putting Meta packet\n", __FUNCTION__)); HSPUPutBuf(chanCb, packet->metaMappingType, packet->iov, packet->iovCount, 0, packet->metaPacketDataSize, &packet->metaPacket, &packet->metaPacketIsAllocated, &packet->metaPacketMappedIov); } /* *----------------------------------------------------------------------------- * * HSPU_SetDataPacketSize -- * * Set the size of the valid data in the data packet buffer. * * Results: * void. * * Side effects: * None. *----------------------------------------------------------------------------- */ void HSPU_SetDataPacketSize(HgfsPacket *packet, // IN/OUT: Hgfs Packet size_t dataSize) // IN: data size { ASSERT(NULL != packet); ASSERT(dataSize <= packet->dataPacketSize); packet->dataPacketDataSize = dataSize; } /* *----------------------------------------------------------------------------- * * HSPU_PutDataPacketBuf -- * * Free data packet buffer if allocated. * Guest mappings will be released. * * Results: * void. * * Side effects: * None. *----------------------------------------------------------------------------- */ void HSPU_PutDataPacketBuf(HgfsPacket *packet, // IN/OUT: Hgfs Packet HgfsServerChannelCallbacks *chanCb) // IN: Channel callbacks { if (packet->dataPacket == NULL) { return; } LOG(4, ("%s Hgfs Putting Data packet\n", __FUNCTION__)); HSPUPutBuf(chanCb, packet->dataMappingType, packet->iov, packet->iovCount, packet->dataPacketIovIndex, packet->dataPacketDataSize, &packet->dataPacket, &packet->dataPacketIsAllocated, &packet->dataPacketMappedIov); } /* *----------------------------------------------------------------------------- * * HSPUPutBuf -- * * Free buffer if allocated and release guest mappings. * * Results: * None. * * Side effects: * None. *----------------------------------------------------------------------------- */ void HSPUPutBuf(HgfsServerChannelCallbacks *chanCb, // IN: Channel callbacks MappingType mappingType, // IN: Access type Readable/Writeable HgfsVmxIov *iov, // IN: iov array uint32 iovCount, // IN: iov array size uint32 startIndex, // IN: Start index of iov size_t bufSize, // IN: Size of buffer void **buf, // OUT: Contigous buffer Bool *isAllocated, // OUT: Buffer allocated uint32 *iovMappedCount) // OUT: iov mapped count { ASSERT(buf != NULL); if (chanCb == NULL || chanCb->putVa == NULL) { goto exit; } if (*isAllocated && (mappingType == BUF_WRITEABLE || mappingType == BUF_READWRITEABLE)) { /* * 1. Map the iov's if required for the size into host addresses. * 2. Write the buffer data into the iov host addresses. * 3. Unmap the iov's host virtual addresses. */ if (0 == *iovMappedCount) { if (!HSPUMapBuf(chanCb->getWriteVa, chanCb->putVa, bufSize, startIndex, iovCount, iov, iovMappedCount)) { goto exit; } } HSPUCopyBufToIovec(iov, *iovMappedCount, startIndex, *buf, bufSize); } if (0 < *iovMappedCount) { HSPUUnmapBuf(chanCb->putVa, startIndex, iov, iovMappedCount); } exit: if (*isAllocated) { LOG(10, ("%s: Hgfs Freeing buffer \n", __FUNCTION__)); free(*buf); *isAllocated = FALSE; } *buf = NULL; } /* *----------------------------------------------------------------------------- * * HSPUCopyBufToIovec -- * * Write out buffer to data Iovec. * * Results: * void * * Side effects: * @iov is populated with contents of @buf *----------------------------------------------------------------------------- */ static void HSPUCopyBufToIovec(HgfsVmxIov *iov, // IN: iovs (array of mappings) uint32 iovCount, // IN: iov count of mappings uint32 startIndex, // IN: start index into iov void *buf, // IN: Contigous Buffer size_t bufSize) // IN: Size of buffer { size_t iovIndex; size_t endIndex; size_t remainingSize; size_t copiedAmount = 0; ASSERT(buf != NULL); for (iovIndex = startIndex, endIndex = startIndex + iovCount, remainingSize = bufSize; iovIndex < endIndex && remainingSize > 0; iovIndex++) { size_t copyAmount = remainingSize < iov[iovIndex].len ? remainingSize: iov[iovIndex].len; ASSERT(iov[iovIndex].va != NULL); memcpy(iov[iovIndex].va, (char *)buf + copiedAmount, copyAmount); remainingSize -= copyAmount; copiedAmount += copyAmount; } ASSERT(remainingSize == 0); } /* *----------------------------------------------------------------------------- * * HSPUCopyIovecToBuf -- * * Read Iovec into the buffer. * * Results: * void * * Side effects: * @iov is populated with contents of @buf *----------------------------------------------------------------------------- */ static void HSPUCopyIovecToBuf(HgfsVmxIov *iov, // IN: iovs (array of mappings) uint32 iovCount, // IN: iov count of mappings uint32 startIndex, // IN: start index into iov void *buf, // IN: contigous Buffer size_t bufSize) // IN: size of buffer { size_t iovIndex; size_t endIndex; size_t remainingSize; size_t copiedAmount = 0; for (iovIndex = startIndex, endIndex = startIndex + iovCount, remainingSize = bufSize; iovIndex < endIndex && remainingSize > 0; iovIndex++) { size_t copyAmount = remainingSize < iov[iovIndex].len ? remainingSize : iov[iovIndex].len; memcpy((char *)buf + copiedAmount, iov[iovIndex].va, copyAmount); copiedAmount += copyAmount; remainingSize -= copyAmount; } ASSERT(copiedAmount == bufSize && remainingSize == 0); } /* *----------------------------------------------------------------------------- * * HSPUMapBuf -- * * Map the buffer for the required size. * * Results: * TRUE if we mapped the requested size and the number of mappings performed. * Otherwise FALSE if something failed, and 0 mappings performed. * * Side effects: * None. *----------------------------------------------------------------------------- */ static Bool HSPUMapBuf(HgfsChannelMapVirtAddrFunc mapVa, // IN: map virtual address function HgfsChannelUnmapVirtAddrFunc putVa, // IN: unmap virtual address function size_t mapSize, // IN: size to map uint32 startIndex, // IN: Start index of iovs to map uint32 iovCount, // IN: iov count HgfsVmxIov *iov, // IN/OUT: iovs (array) to map uint32 *mappedCount) // OUT: mapped iov count { uint32 iovIndex; uint32 mappedIovCount; size_t remainingSize; Bool mapped = TRUE; for (iovIndex = startIndex, mappedIovCount = 0, remainingSize = mapSize; iovIndex < iovCount && remainingSize > 0; iovIndex++, mappedIovCount++) { iov[iovIndex].context = NULL; /* Check: Iov in VMCI should never cross page boundary */ ASSERT(iov[iovIndex].len <= (PAGE_SIZE - PAGE_OFFSET(iov[iovIndex].pa))); iov[iovIndex].va = mapVa(iov[iovIndex].pa, iov[iovIndex].len, &iov[iovIndex].context); if (NULL == iov[iovIndex].va) { /* Failed to map the physical address. */ break; } remainingSize = remainingSize < iov[iovIndex].len ? 0: remainingSize - iov[iovIndex].len; } if (0 != remainingSize) { /* Something failed in the mappings Undo any mappings we created. */ HSPUUnmapBuf(putVa, startIndex, iov, &mappedIovCount); mapped = FALSE; } *mappedCount = mappedIovCount; return mapped; } /* *----------------------------------------------------------------------------- * * HSPUUnmapBuf -- * * Unmap the buffer and release guest mappings. * * Results: * None. * * Side effects: * None. *----------------------------------------------------------------------------- */ static void HSPUUnmapBuf(HgfsChannelUnmapVirtAddrFunc unmapVa, // IN/OUT: Hgfs Packet uint32 startIndex, // IN: Start index of iovs to map HgfsVmxIov *iov, // IN/OUT: iovs (array) to map uint32 *mappedCount) // IN/OUT: iov count to unmap { uint32 iovIndex; uint32 endIndex; for (iovIndex = startIndex, endIndex = startIndex + *mappedCount; iovIndex < endIndex; iovIndex++) { ASSERT(iov[iovIndex].context); unmapVa(&iov[iovIndex].context); iov[iovIndex].context = NULL; iov[iovIndex].va = NULL; } *mappedCount = 0; } open-vm-tools-10.0.7-3227872/lib/pollGtk/0000755000000000000000000000000012660700526016036 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/pollGtk/Makefile.am0000644000000000000000000000201012660700526020063 0ustar rootroot################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libPollGtk.la libPollGtk_la_SOURCES = libPollGtk_la_SOURCES += pollGtk.c AM_CFLAGS = AM_CFLAGS += @GLIB2_CPPFLAGS@ open-vm-tools-10.0.7-3227872/lib/pollGtk/pollGtk.c0000644000000000000000000012657112660700526017632 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * pollGtk.c -- a simple poll implementation built on top of GLib * For historical reasons, it is named pollGtk but does not * depend on gtk. * This is the actual Poll_* functions, and so it is different * than the Gtk IVmdbPoll implementation. * * This has to be at least slightly thread-safe. Specifically, * it has to allow any thread to schedule callbacks on the Poll * thread. For example, the asyncSocket library may schedule a * callback in a signal handler when a socket is suddenly * disconnected. As a result, we need to wrap a lock around the * queue of events. */ #ifdef _WIN32 #include #pragma pack(push, 8) #endif #include #ifdef _WIN32 #pragma pack(pop) #endif #include "pollImpl.h" #include "mutexRankLib.h" #include "err.h" #define LOGLEVEL_MODULE poll #include "loglevel_user.h" /* * This describes a single callback waiting for an event * or a timeout. */ typedef struct { int flags; PollerFunction cb; void *clientData; PollClassSet classSet; MXUserRecLock *cbLock; uint32 timesNotFired; } PollEntryInfo; typedef struct PollGtkEntry { PollEntryInfo read; PollEntryInfo write; PollEventType type; PollDevHandle event; /* POLL_DEVICE file descriptor or POLL_REALTIME delay. */ guint gtkInputId; /* Handle of the registered GTK callback */ /* * In practice, "channel" is only used when invoking the callbacks of clients * who registered with POLL_FLAG_FD. When you create a channel from a file * descriptor with g_io_channel_win32_new_fd(), you MUST read from the * channel with g_io_channel_read() instead of reading directly from the fd * with read(fd). * * See http://library.gnome.org/devel/glib/unstable/glib-IO-Channels.html#g-io-channel-win32-new-fd for details. */ GIOChannel *channel; } PollGtkEntry; /* * This describes a data necessary to find matching entry. */ typedef struct { int flags; PollerFunction cb; void *clientData; PollClassSet classSet; PollEventType type; Bool matchAnyClientData; } PollGtkFindEntryData; /* * The global Poll state. */ typedef struct Poll { MXUserExclLock *lock; GHashTable *deviceTable; GHashTable *timerTable; #ifdef _WIN32 GHashTable *signaledTable; GSList *newSignaled; Bool signaledInUse; guint retrySource; #endif } Poll; static Poll *pollState; static VMwareStatus PollGtkCallback(PollClassSet classSet, // IN int flags, // IN PollerFunction f, // IN void *clientData, // IN PollEventType type, // IN PollDevHandle info, // IN MXUserRecLock *lock); // IN static gboolean PollGtkBasicCallback(gpointer data); static gboolean PollGtkEventCallback(GIOChannel *source, GIOCondition condition, gpointer data); static gboolean PollGtkEventCallbackWork(GIOChannel *source, GIOCondition condition, gpointer data, Bool hasPollLock, Bool *firedAll); #ifdef _WIN32 static gboolean PollGtkFireSignaled(gpointer key, gpointer value, gpointer user_data); static gboolean PollGtkFireSignaledList(gpointer data); #endif static void PollGtkRemoveOneCallback(gpointer data); #define ASSERT_POLL_LOCKED() \ ASSERT(!pollState || !pollState->lock || \ MXUser_IsCurThreadHoldingExclLock(pollState->lock)) #define LOG_ENTRY(_l, _str, _e, _isWrite) \ do { \ if (_isWrite) { \ LOG(_l, ("POLL: entry %p (wcb %p, data %p, flags %x, type %x)" _str, \ (_e), (_e)->write.cb, (_e)->write.clientData, \ (_e)->write.flags, (_e)->type)); \ } else { \ LOG(_l, ("POLL: entry %p (rcb %p, data %p, flags %x, type %x)" _str, \ (_e), (_e)->read.cb, (_e)->read.clientData, \ (_e)->read.flags, (_e)->type)); \ } \ } while (0) typedef void (*PollerFunctionGtk)(void *, GIOChannel *); /* *---------------------------------------------------------------------------- * * PollGtkLock -- * PollGtkUnlock -- * * Locking of the internal poll state. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static INLINE void PollGtkLock(void) { MXUser_AcquireExclLock(pollState->lock); } static INLINE void PollGtkUnlock(void) { MXUser_ReleaseExclLock(pollState->lock); } /* *---------------------------------------------------------------------- * * PollGtkInit -- * * Module initialization. * * Results: * None * * Side effects: * Initializes the module-wide state and sets pollState. * *---------------------------------------------------------------------- */ static void PollGtkInit(void) { ASSERT(pollState == NULL); pollState = g_new0(Poll, 1); pollState->lock = MXUser_CreateExclLock("pollGtkLock", RANK_pollDefaultLock); VERIFY(pollState->lock); pollState->deviceTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, PollGtkRemoveOneCallback); ASSERT(pollState->deviceTable); pollState->timerTable = g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, PollGtkRemoveOneCallback); ASSERT(pollState->timerTable); #ifdef _WIN32 pollState->signaledTable = g_hash_table_new(g_direct_hash, g_direct_equal); ASSERT(pollState->signaledTable); #endif } /* *---------------------------------------------------------------------- * * PollGtkExit -- * * Module exit. * * Results: * None * * Side effects: * Discards the module-wide state and clears pollState. * *---------------------------------------------------------------------- */ static void PollGtkExit(void) { Poll *poll = pollState; ASSERT(poll != NULL); PollGtkLock(); g_hash_table_destroy(poll->deviceTable); g_hash_table_destroy(poll->timerTable); poll->deviceTable = NULL; poll->timerTable = NULL; #ifdef _WIN32 g_hash_table_destroy(poll->signaledTable); poll->signaledTable = NULL; g_slist_free(poll->newSignaled); poll->newSignaled = NULL; if (poll->retrySource > 0) { g_source_remove(poll->retrySource); poll->retrySource = 0; } #endif PollGtkUnlock(); MXUser_DestroyExclLock(poll->lock); g_free(poll); pollState = NULL; } /* *---------------------------------------------------------------------- * * PollGtkLoopTimeout -- * * The poll loop. * This is defined here to allow libraries like Foundry to link. * When run with the Gtk Poll implementation, however, this routine * should never be called. The Gtk framework will pump events. * * Result: * Void. * * Side effects: * *---------------------------------------------------------------------- */ static void PollGtkLoopTimeout(Bool loop, // IN: loop forever if TRUE, else do one pass. Bool *exit, // IN: NULL or set to TRUE to end loop. PollClass class, // IN: class of events (POLL_CLASS_*) int timeout) // IN: maximum time to sleep { NOT_IMPLEMENTED(); } /* *---------------------------------------------------------------------- * * PollGtkEntryInfoMatches -- * * Test whether provided PollEntryInfo satisfies FindEntryData * requirements. * * Results: * TRUE if the value matches our search criteria, FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE gboolean PollGtkEntryInfoMatches(const PollEntryInfo *entry, // IN const PollGtkFindEntryData *search) // IN { return PollClassSet_Equals(entry->classSet, search->classSet) && entry->cb == search->cb && entry->flags == search->flags && (search->matchAnyClientData || entry->clientData == search->clientData); } /* *---------------------------------------------------------------------- * * PollGtkFindReadPredicate -- * * Predicate usable by GHashTable iteration functions to find * specific elements, looking for read entry. * * Results: * TRUE if the value matches our search criteria, FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean PollGtkFindReadPredicate(gpointer key, // IN gpointer value, // IN gpointer data) // IN { const PollGtkEntry *current = value; const PollGtkFindEntryData *search = data; ASSERT_POLL_LOCKED(); return current->type == search->type && PollGtkEntryInfoMatches(¤t->read, search); } /* *---------------------------------------------------------------------- * * PollGtkFindWritePredicate -- * * Predicate usable by GHashTable iteration functions to find * specific elements, looking for write entry. * * Results: * TRUE if the value matches our search criteria, FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ static gboolean PollGtkFindWritePredicate(gpointer key, // IN gpointer value, // IN gpointer data) // IN { const PollGtkEntry *current = value; const PollGtkFindEntryData *search = data; ASSERT_POLL_LOCKED(); return current->type == search->type && PollGtkEntryInfoMatches(¤t->write, search); } #ifdef _WIN32 /* *---------------------------------------------------------------------------- * * PollGtkFireSignaled -- * * Fire the callback(s) of a previously signaled event, if the callback(s) * is still registered. * * Results: * TRUE if we fire all callbacks that are ready to fire. * * Side effects: * If returning TRUE, the associated key is removed from signaledTable. * *---------------------------------------------------------------------------- */ static gboolean PollGtkFireSignaled(gpointer key, // IN: PollDevHandle gpointer value, // IN: PollGtkEntry * gpointer user_data) // IN: unused { PollGtkEntry *entry; Bool firedAll = TRUE; GIOCondition condition = 0; entry = g_hash_table_lookup(pollState->deviceTable, key); if (entry == NULL) { goto exit; } if (entry->read.cb && entry->read.timesNotFired > 0) { condition |= G_IO_IN; } if (entry->write.cb && entry->write.timesNotFired > 0) { condition |= G_IO_OUT; } if (condition == 0) { goto exit; } PollGtkEventCallbackWork(NULL, condition, entry, TRUE, &firedAll); exit: LOG(4, ("POLL: entry %p %s\n", entry, entry && condition ? (firedAll ? "fired" : "not all fired") : "not ready to fire")); return firedAll; } /* *---------------------------------------------------------------------------- * * PollGtkFireSignaledList -- * * This is a timer based callback scheduled when the signaled list is not * empty. For each entry, we will try to fire any callback with non-zero * timesNotFired. The entry is removed from the signaled list only if * all the callbacks that we try to fire do fire. * * Results: * TRUE if this callback should fire again, FALSE otherwise. * * Side effects: * Timer source is removed if FALSE is returned. * *---------------------------------------------------------------------------- */ static gboolean PollGtkFireSignaledList(gpointer data) // IN: unused { Poll *poll = pollState; gboolean ret; GSList *cur; ASSERT(poll); PollGtkLock(); /* * Do not allow other changes to signaledTable while iterating through the * hash table. (The poll lock is dropped when callback fires.) */ poll->signaledInUse = TRUE; g_hash_table_foreach_remove(pollState->signaledTable, PollGtkFireSignaled, NULL); /* Now we can add any new signaled entry into the hash table. */ for (cur = poll->newSignaled; cur; cur = g_slist_next(cur)) { PollGtkEntry *entry; gpointer key = cur->data; entry = g_hash_table_lookup(poll->deviceTable, key); if (entry) { g_hash_table_replace(poll->signaledTable, key, entry); } } g_slist_free(poll->newSignaled); poll->newSignaled = NULL; /* Return TRUE to keep this function firing, FALSE to unregister. */ if (g_hash_table_size(poll->signaledTable) > 0) { LOG(5, ("POLL: not removing retry source\n")); ret = TRUE; } else { LOG(5, ("POLL: no retry remains; removing timer source\n")); poll->retrySource = 0; ret = FALSE; } poll->signaledInUse = FALSE; PollGtkUnlock(); return ret; } /* *---------------------------------------------------------------------------- * * PollGtkAddToSignaledList -- * * Remember a signaled event so that we can retry later. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void PollGtkAddToSignaledList(PollGtkEntry *entry) // IN { Poll *poll = pollState; gpointer key; ASSERT_POLL_LOCKED(); ASSERT(entry); key = (gpointer)(intptr_t)entry->event; /* * Add it to a separate linked list if the poll thread is iterating over * signaledTable. */ if (poll->signaledInUse) { if (!g_slist_find(poll->newSignaled, key)) { poll->newSignaled = g_slist_prepend(poll->newSignaled, key); LOG(4, ("POLL: added entry %p event 0x%x to signaled list\n", entry, entry->event)); } } else { g_hash_table_replace(poll->signaledTable, key, entry); if (poll->retrySource == 0) { poll->retrySource = g_timeout_add(0, PollGtkFireSignaledList, NULL); } LOG(4, ("POLL: added entry %p event 0x%x to signaled hash table\n", entry, entry->event)); } } /* *---------------------------------------------------------------------------- * * PollGtkReadableSocketCheck -- * * Windows does not signal a read event for a socket if there has not * been a recv() since the last time the socket is signaled (even * after a new event is associated with the socket). We check the socket * and add it to the signaled list if there is data to read. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static void PollGtkReadableSocketCheck(PollGtkEntry *entry) // IN { char buf[1]; int ret; ASSERT_POLL_LOCKED(); ASSERT(entry->read.cb && entry->read.flags & POLL_FLAG_SOCKET); ret = recv(entry->event, buf, 1, MSG_PEEK); if (ret == 1) { entry->read.timesNotFired = 1; PollGtkAddToSignaledList(entry); } } /* *---------------------------------------------------------------------------- * * PollGtkWritableSocketCheck -- * * Windows does not signal a write event for a socket if a previous * write had not resulted in WSAEWOULDBLOCK. Do a zero-byte send() * to find out if it would block and if not, add the event to the * signaled list so that it will fire. * * Results: * TRUE if socket is writable. * * Side effects: * None. * *---------------------------------------------------------------------------- */ static Bool PollGtkWritableSocketCheck(PollGtkEntry *entry) // IN { int ret; char c; ASSERT_POLL_LOCKED(); ASSERT(entry->write.cb && entry->write.flags & POLL_FLAG_SOCKET); ret = send(entry->event, &c, 0, 0); if (ret == SOCKET_ERROR) { if (GetLastError() != WSAEWOULDBLOCK) { LOG(1, ("POLL error while doing zero-byte send: %u %s\n", GetLastError(), Err_ErrString())); } return FALSE; } else { entry->write.timesNotFired = 1; PollGtkAddToSignaledList(entry); return TRUE; } } #endif /* *---------------------------------------------------------------------- * * PollGtkDeviceCallback -- * * Insert specified entry as device callback. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void PollGtkDeviceCallback(PollGtkEntry *entry) // IN { Poll *poll = pollState; int conditionFlags; ASSERT_POLL_LOCKED(); conditionFlags = G_IO_ERR | G_IO_HUP | G_IO_NVAL; if (POLL_FLAG_READ & entry->read.flags) { conditionFlags |= G_IO_IN | G_IO_PRI; } if (POLL_FLAG_WRITE & entry->write.flags) { conditionFlags |= G_IO_OUT; } /* * XXX Looking at the GTK/GLIB source code, it seems that a returned value * of 0 indicates failure (and I should check for it), but that is not * clear */ #ifdef _WIN32 if ((entry->read.flags | entry->write.flags) & POLL_FLAG_SOCKET) { entry->channel = g_io_channel_win32_new_socket(entry->event); if (entry->read.flags & POLL_FLAG_READ) { PollGtkReadableSocketCheck(entry); } if (entry->write.flags & POLL_FLAG_WRITE) { PollGtkWritableSocketCheck(entry); } } else if ((entry->read.flags | entry->write.flags) & POLL_FLAG_FD) { entry->channel = g_io_channel_win32_new_fd(entry->event); } else { entry->channel = g_io_channel_win32_new_messages(entry->event); } #else entry->channel = g_io_channel_unix_new(entry->event); #endif entry->gtkInputId = g_io_add_watch(entry->channel, conditionFlags, PollGtkEventCallback, entry); g_hash_table_insert(poll->deviceTable, (gpointer)(intptr_t)entry->event, entry); } /* *---------------------------------------------------------------------- * * PollGtkCallbackRemoveEntry -- * * Remove specified poll entry. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void PollGtkCallbackRemoveEntry(PollGtkEntry *foundEntry, // IN Bool removeWrite) // IN { Poll *poll = pollState; ASSERT_POLL_LOCKED(); if (foundEntry->type == POLL_DEVICE) { PollGtkEntry *newEntry = NULL; intptr_t key; if (removeWrite) { if (foundEntry->read.flags) { newEntry = g_new0(PollGtkEntry, 1); newEntry->read = foundEntry->read; LOG_ENTRY(2, " to be removed, read cb remains\n", foundEntry, TRUE); } else { LOG_ENTRY(2, " to be removed\n", foundEntry, TRUE); } } else { if (foundEntry->write.flags) { newEntry = g_new0(PollGtkEntry, 1); newEntry->write = foundEntry->write; LOG_ENTRY(2, " to be removed, write cb remains\n", foundEntry, FALSE); } else { LOG_ENTRY(2, " to be removed\n", foundEntry, FALSE); } } key = foundEntry->event; g_hash_table_remove(poll->deviceTable, (gpointer)key); #ifdef _WIN32 if (!poll->signaledInUse) { g_hash_table_remove(poll->signaledTable, (gpointer)key); } #endif if (newEntry) { newEntry->event = key; newEntry->type = POLL_DEVICE; PollGtkDeviceCallback(newEntry); } } else { ASSERT(!removeWrite); ASSERT(foundEntry->write.cb == NULL); LOG_ENTRY(2, " to be removed\n", foundEntry, FALSE); if (!g_hash_table_remove(poll->timerTable, (gpointer)(intptr_t)foundEntry->gtkInputId)) { LOG(2, ("POLL: entry %p not found\n", foundEntry)); } } } /* *---------------------------------------------------------------------- * * PollGtkCallbackRemoveInt -- * * Remove a callback. * * Results: * TRUE if entry found and removed, FALSE otherwise * * Side effects: * A callback may be modified instead of completely removed. * *---------------------------------------------------------------------- */ static Bool PollGtkCallbackRemoveInt(PollClassSet classSet, // IN int flags, // IN PollerFunction f, // IN void *clientData, // IN Bool matchAnyClientData, // IN PollEventType type, // IN void **foundClientData) // OUT { Poll *poll = pollState; GHashTable *searchTable; PollGtkFindEntryData searchEntry; PollGtkEntry *foundEntry; ASSERT(poll); ASSERT(!clientData || !matchAnyClientData); ASSERT(type >= 0 && type < POLL_NUM_QUEUES); ASSERT(foundClientData); searchEntry.classSet = classSet; searchEntry.flags = flags; searchEntry.cb = f; searchEntry.clientData = clientData; searchEntry.type = type; searchEntry.matchAnyClientData = matchAnyClientData; switch (type) { case POLL_REALTIME: case POLL_MAIN_LOOP: searchTable = poll->timerTable; break; case POLL_DEVICE: searchTable = poll->deviceTable; break; case POLL_VIRTUALREALTIME: case POLL_VTIME: default: NOT_IMPLEMENTED(); } PollGtkLock(); if (flags & POLL_FLAG_WRITE) { foundEntry = g_hash_table_find(searchTable, PollGtkFindWritePredicate, &searchEntry); } else { foundEntry = g_hash_table_find(searchTable, PollGtkFindReadPredicate, &searchEntry); } if (foundEntry) { if (flags & POLL_FLAG_WRITE) { *foundClientData = foundEntry->write.clientData; PollGtkCallbackRemoveEntry(foundEntry, TRUE); } else { *foundClientData = foundEntry->read.clientData; PollGtkCallbackRemoveEntry(foundEntry, FALSE); } } else { LOG(1, ("POLL: no matching entry for cb %p, data %p, flags %x, type %x\n", f, clientData, flags, type)); } PollGtkUnlock(); return foundEntry != NULL; } /* *---------------------------------------------------------------------- * * PollGtkCallbackRemove -- * * Remove a callback. * * Results: * TRUE if entry found and removed, FALSE otherwise * * Side effects: * A callback may be modified instead of completely removed. * *---------------------------------------------------------------------- */ static Bool PollGtkCallbackRemove(PollClassSet classSet, // IN int flags, // IN PollerFunction f, // IN void *clientData, // IN PollEventType type) // IN { void *foundClientData; return PollGtkCallbackRemoveInt(classSet, flags, f, clientData, FALSE, type, &foundClientData); } /* *---------------------------------------------------------------------- * * PollGtkCallbackRemoveOneByCB -- * * Remove a callback. * * Results: * TRUE if entry found and removed (*clientData updated), FALSE otherwise * * Side effects: * A callback may be modified instead of completely removed. * *---------------------------------------------------------------------- */ static Bool PollGtkCallbackRemoveOneByCB(PollClassSet classSet, // IN int flags, // IN PollerFunction f, // IN PollEventType type, // IN void **clientData) // OUT { return PollGtkCallbackRemoveInt(classSet, flags, f, NULL, TRUE, type, clientData); } /* *---------------------------------------------------------------------- * * PollGtkRemoveOneCallback -- * * Results: * None. * * Side effects: * If entry was active, it is removed from main loop. * *---------------------------------------------------------------------- */ static void PollGtkRemoveOneCallback(gpointer data) // IN { PollGtkEntry *eventEntry = data; switch(eventEntry->type) { case POLL_REALTIME: case POLL_MAIN_LOOP: g_source_remove(eventEntry->gtkInputId); break; case POLL_DEVICE: g_source_remove(eventEntry->gtkInputId); g_io_channel_unref(eventEntry->channel); eventEntry->channel = NULL; break; case POLL_VIRTUALREALTIME: case POLL_VTIME: default: NOT_IMPLEMENTED(); } g_free(eventEntry); } /* *---------------------------------------------------------------------- * * PollGtkCallback -- * * For the POLL_REALTIME or POLL_DEVICE queues, entries can be * inserted for good, to fire on a periodic basis (by setting the * POLL_FLAG_PERIODIC flag). * * Otherwise, the callback fires only once. * * For periodic POLL_REALTIME callbacks, "info" is the time in * microseconds between execution of the callback. For * POLL_DEVICE callbacks, info is a file descriptor. * *---------------------------------------------------------------------- */ static VMwareStatus PollGtkCallback(PollClassSet classSet, // IN int flags, // IN PollerFunction f, // IN void *clientData, // IN PollEventType type, // IN PollDevHandle info, // IN MXUserRecLock *lock) // IN { VMwareStatus result; Poll *poll = pollState; PollGtkEntry *newEntry; ASSERT(f); newEntry = g_new0(PollGtkEntry, 1); newEntry->type = type; if (flags & POLL_FLAG_WRITE) { newEntry->write.flags = flags; newEntry->write.cb = f; newEntry->write.clientData = clientData; newEntry->write.cbLock = lock; newEntry->write.classSet = classSet; LOG_ENTRY(2, " is being added\n", newEntry, TRUE); } else { newEntry->read.flags = flags; newEntry->read.cb = f; newEntry->read.clientData = clientData; newEntry->read.cbLock = lock; newEntry->read.classSet = classSet; LOG_ENTRY(2, " is being added\n", newEntry, FALSE); } PollGtkLock(); if (type == POLL_DEVICE) { PollGtkEntry *foundEntry; foundEntry = g_hash_table_lookup(poll->deviceTable, (gpointer)(intptr_t)info); if (foundEntry) { /* * We are going to merge old entry with new. Verify that we really * found entry we were looking for. */ ASSERT(foundEntry->type == type); ASSERT(foundEntry->event == info); /* * Now verify that found entry does not wait for direction we are * registering. */ if (flags & POLL_FLAG_WRITE) { ASSERT(foundEntry->write.flags == 0); ASSERT(foundEntry->write.cb == NULL); ASSERT(foundEntry->read.cb != NULL); newEntry->read = foundEntry->read; LOG_ENTRY(2, " will merge with new entry\n", foundEntry, FALSE); } else { ASSERT(foundEntry->read.flags == 0); ASSERT(foundEntry->read.cb == NULL); ASSERT(foundEntry->write.cb != NULL); newEntry->write = foundEntry->write; LOG_ENTRY(2, " will merge with new entry\n", foundEntry, TRUE); } /* * Either both callbacks must be for socket, or for non-socket. * Mixing them is not supported at this moment. */ ASSERT(((newEntry->read.flags ^ newEntry->write.flags) & POLL_FLAG_SOCKET) == 0); g_hash_table_remove(poll->deviceTable, (gpointer)(intptr_t)info); } else if (vmx86_debug) { /* * We did not find entry by fd. Try looking it up by flags/f/cs/cd. * If we can find it, then user tried to insert same flags/f/cs/cd for * two file descriptors. Which is not allowed. */ PollGtkFindEntryData searchEntry; searchEntry.flags = flags; searchEntry.classSet = classSet; searchEntry.cb = f; searchEntry.clientData = clientData; searchEntry.type = POLL_DEVICE; searchEntry.matchAnyClientData = FALSE; if (flags & POLL_FLAG_WRITE) { foundEntry = g_hash_table_find(poll->deviceTable, PollGtkFindWritePredicate, &searchEntry); } else { foundEntry = g_hash_table_find(poll->deviceTable, PollGtkFindReadPredicate, &searchEntry); } ASSERT(!foundEntry); } } ASSERT(poll != NULL); /* * Every callback must be in POLL_CLASS_MAIN (plus possibly others) */ ASSERT(PollClassSet_IsMember(classSet, POLL_CLASS_MAIN) != 0); ASSERT(type >= 0 && type < POLL_NUM_QUEUES); switch(type) { case POLL_MAIN_LOOP: ASSERT(info == 0); /* Fall-through */ case POLL_REALTIME: ASSERT(info == (uint32)info); ASSERT(info >= 0); newEntry->event = info / 1000; /* * info is the delay in microseconds, but we need to pass in * a delay in milliseconds. */ newEntry->gtkInputId = g_timeout_add(info / 1000, PollGtkBasicCallback, newEntry); g_hash_table_insert(poll->timerTable, (gpointer)(intptr_t)newEntry->gtkInputId, newEntry); break; case POLL_DEVICE: /* * info is a file descriptor/socket/handle */ newEntry->event = info; PollGtkDeviceCallback(newEntry); break; case POLL_VIRTUALREALTIME: case POLL_VTIME: default: NOT_IMPLEMENTED(); } result = VMWARE_STATUS_SUCCESS; PollGtkUnlock(); return result; } // Poll_Callback /* *----------------------------------------------------------------------------- * * PollGtkEventCallback -- * PolLGtkEventCallbackWork -- * * This is the basic callback marshaller. It is invoked directly by gtk * in the case of event callbacks and indirectly through a wrapper for * timer callbacks. It calls the real callback and either cleans up * the event or (if it's PERIODIC) leaves it registered to fire again. * * Results: * TRUE if the event source should remain registered. FALSE otherwise. * * Side effects: * Depends on the invoked callback * *----------------------------------------------------------------------------- */ static gboolean PollGtkEventCallback(GIOChannel *source, // IN: GIOChannel associated with // the file descriptor GIOCondition condition, // IN: State(s) of the file // descriptor that triggered // the GTK callback gpointer data) // IN: PollGtkEntry * { Bool fired; return PollGtkEventCallbackWork(source, condition, data, FALSE, &fired); } static gboolean PollGtkEventCallbackWork(GIOChannel *source, // IN: GIOCondition condition, // IN: gpointer data, // IN: Bool hasPollLock, // IN: Bool *firedAll) // OUT: { PollGtkEntry *eventEntry; PollerFunction cbFunc; void *clientData; MXUserRecLock *cbLock; Bool needReadAndWrite = FALSE; Bool fireWriteCallback; PollDevHandle fd = -1; gboolean ret; GIOChannel *channel; *firedAll = FALSE; if (!hasPollLock) { PollGtkLock(); } if (g_source_is_destroyed(g_main_current_source())) { ret = FALSE; goto exitHasLock; } eventEntry = data; ASSERT(eventEntry); /* * Cache the bits we need to fire the callback in case the * callback is discarded for being non-periodic. */ channel = eventEntry->channel; if (eventEntry->read.cb && (condition & (G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL))) { cbFunc = eventEntry->read.cb; clientData = eventEntry->read.clientData; cbLock = eventEntry->read.cbLock; ret = (eventEntry->read.flags & POLL_FLAG_PERIODIC) != 0; fireWriteCallback = FALSE; fd = eventEntry->event; if (eventEntry->write.cb && (condition & G_IO_OUT)) { needReadAndWrite = TRUE; } } else if (eventEntry->write.cb && (condition & (G_IO_OUT | G_IO_ERR | G_IO_HUP | G_IO_NVAL))) { cbFunc = eventEntry->write.cb; clientData = eventEntry->write.clientData; cbLock = eventEntry->write.cbLock; ret = (eventEntry->write.flags & POLL_FLAG_PERIODIC) != 0; fireWriteCallback = TRUE; fd = eventEntry->event; } else { ASSERT(FALSE); ret = TRUE; goto exitHasLock; } if (cbLock && !MXUser_TryAcquireRecLock(cbLock)) { /* * We cannot fire at this time. For device callbacks, on Posix platforms * we should get called again at the next dispatch so we do nothing; on * Windows platforms we cannot rely on that so we have to remember the * signaled event and retry in the next loop iteration. For non-zero * delay real-time callbacks, we schedule a 0-delay timer callback to * attempt firing again. Main-loop callbacks are already 0-delay * callbacks, so we only need to return TRUE such that the source is not * removed. * TODO: Detect busy looping and apply backoff. */ LOG_ENTRY(3, " did not fire\n", eventEntry, fireWriteCallback); if (fireWriteCallback) { eventEntry->write.timesNotFired++; } else { eventEntry->read.timesNotFired++; } if (eventEntry->type == POLL_DEVICE) { #ifdef _WIN32 PollGtkAddToSignaledList(eventEntry); #endif } else { if (eventEntry->type == POLL_REALTIME && eventEntry->event != 0 && eventEntry->read.timesNotFired == 1) { /* Re-purpose the event for the retry (as a 0-delay timer). */ g_source_remove(eventEntry->gtkInputId); if (!g_hash_table_steal(pollState->timerTable, (gpointer)(intptr_t)eventEntry->gtkInputId)) { LOG_ENTRY(0, " not found\n", eventEntry, FALSE); ASSERT(FALSE); } eventEntry->gtkInputId = g_timeout_add(0, PollGtkBasicCallback, eventEntry); g_hash_table_insert(pollState->timerTable, (gpointer)(intptr_t)eventEntry->gtkInputId, eventEntry); LOG_ENTRY(1, " rescheduled for retry\n", eventEntry, FALSE); ret = FALSE; } else { /* The event is already a 0-delay timer. */ LOG_ENTRY(2, " will retry firing\n", eventEntry, FALSE); ret = TRUE; } ASSERT(!needReadAndWrite); goto exitHasLock; } } else { /* * Fire the callback. * * The callback must fire after unregistering non-periodic callbacks * in case the callback function re-registers itself. If the callback * explicitly calls Poll_CallbackRemove, it is harmless when the callback * is already gone. */ LOG_ENTRY(3, " about to fire\n", eventEntry, fireWriteCallback); *firedAll = TRUE; if (!ret) { PollGtkCallbackRemoveEntry(eventEntry, fireWriteCallback); } else if (fireWriteCallback) { eventEntry->write.timesNotFired = 0; } else if (!fireWriteCallback && eventEntry->read.timesNotFired > 0) { eventEntry->read.timesNotFired = 0; if (eventEntry->type == POLL_REALTIME && eventEntry->event != 0) { /* We need to reschedule the callback with the original delay. */ g_source_remove(eventEntry->gtkInputId); if (!g_hash_table_steal(pollState->timerTable, (gpointer)(intptr_t)eventEntry->gtkInputId)) { LOG_ENTRY(0, " not found\n", eventEntry, FALSE); ASSERT(FALSE); } eventEntry->gtkInputId = g_timeout_add((guint)eventEntry->event, PollGtkBasicCallback, eventEntry); g_hash_table_insert(pollState->timerTable, (gpointer)(intptr_t)eventEntry->gtkInputId, eventEntry); LOG_ENTRY(1, " rescheduled with original delay\n", eventEntry, FALSE); } } PollGtkUnlock(); ((PollerFunctionGtk)cbFunc)(clientData, channel); if (cbLock) { MXUser_ReleaseRecLock(cbLock); } #ifdef _WIN32 PollGtkLock(); eventEntry = g_hash_table_lookup(pollState->deviceTable, (gpointer)(intptr_t)fd); if (fireWriteCallback && eventEntry && eventEntry->write.cb && (eventEntry->write.flags & POLL_FLAG_SOCKET)) { PollGtkWritableSocketCheck(eventEntry); } else if (!fireWriteCallback && eventEntry && eventEntry->read.cb && (eventEntry->read.flags & POLL_FLAG_SOCKET)) { PollGtkReadableSocketCheck(eventEntry); } if (fireWriteCallback || !needReadAndWrite) { goto exitHasLock; } #else /* ifdef _WIN32 */ if (needReadAndWrite) { PollGtkLock(); } else { goto exit; } #endif } /* * We must fire both read & write callbacks. Read callback already fired, * and could remove write callback. So lookup entry from file descriptor. */ if (needReadAndWrite) { PollGtkEntry *foundEntry; cbFunc = NULL; cbLock = NULL; ASSERT(fd != -1); foundEntry = g_hash_table_lookup(pollState->deviceTable, (gpointer)(intptr_t)fd); if (foundEntry && (cbFunc = foundEntry->write.cb) != NULL) { cbLock = foundEntry->write.cbLock; clientData = foundEntry->write.clientData; if (!cbLock || MXUser_TryAcquireRecLock(cbLock)) { LOG_ENTRY(3, " about to fire\n", foundEntry, TRUE); if (!(foundEntry->write.flags & POLL_FLAG_PERIODIC)) { PollGtkCallbackRemoveEntry(foundEntry, TRUE); ret = FALSE; } else { foundEntry->write.timesNotFired = 0; } PollGtkUnlock(); cbFunc(clientData); if (cbLock) { MXUser_ReleaseRecLock(cbLock); } #ifdef _WIN32 PollGtkLock(); foundEntry = g_hash_table_lookup(pollState->deviceTable, (gpointer)(intptr_t)fd); if (foundEntry && foundEntry->write.cb && (foundEntry->write.flags & POLL_FLAG_SOCKET)) { PollGtkWritableSocketCheck(foundEntry); } goto exitHasLock; #else goto exit; #endif } else { LOG_ENTRY(3, " did not fire\n", foundEntry, TRUE); foundEntry->write.timesNotFired++; *firedAll = FALSE; #ifdef _WIN32 PollGtkAddToSignaledList(foundEntry); #endif } } } exitHasLock: if (!hasPollLock) { PollGtkUnlock(); } return ret; #ifndef _WIN32 exit: if (hasPollLock) { PollGtkLock(); } return ret; #endif } /* *----------------------------------------------------------------------------- * * PollGtkBasicCallback -- * * This is called by Gtk when a timeout expires. It is simply * an adapter that immediately calls PollGtkEventCallback. * * Results: * TRUE if the event source should remain registered. FALSE otherwise. * * Side effects: * Depends on the invoked callback * *----------------------------------------------------------------------------- */ static gboolean PollGtkBasicCallback(gpointer data) // IN: The eventEntry { return PollGtkEventCallback(NULL, G_IO_IN, data); } /* *----------------------------------------------------------------------------- * * Poll_InitGtk -- * * Public init function for this Poll implementation. Poll loop will be * up and running after this is called. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void Poll_InitGtk(void) { static volatile gsize inited = 0; static const PollImpl gtkImpl = { PollGtkInit, PollGtkExit, PollGtkLoopTimeout, PollGtkCallback, PollGtkCallbackRemove, PollGtkCallbackRemoveOneByCB, PollLockingAlwaysEnabled, }; if (g_once_init_enter(&inited)) { gsize didInit = 1; Poll_InitWithImpl(>kImpl); g_once_init_leave(&inited, didInit); } } open-vm-tools-10.0.7-3227872/lib/pollGtk/Makefile.in0000644000000000000000000004033312660700526020106 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/pollGtk DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libPollGtk_la_LIBADD = am_libPollGtk_la_OBJECTS = pollGtk.lo libPollGtk_la_OBJECTS = $(am_libPollGtk_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libPollGtk_la_SOURCES) DIST_SOURCES = $(libPollGtk_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libPollGtk.la libPollGtk_la_SOURCES = pollGtk.c AM_CFLAGS = @GLIB2_CPPFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/pollGtk/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/pollGtk/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libPollGtk.la: $(libPollGtk_la_OBJECTS) $(libPollGtk_la_DEPENDENCIES) $(LINK) $(libPollGtk_la_OBJECTS) $(libPollGtk_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pollGtk.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/impersonate/0000755000000000000000000000000012660700526016750 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/impersonate/impersonatePosix.c0000644000000000000000000002717412660700526022500 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * impersonatePosix.c -- * * Description: * Posix specific functions to impersonate as specific users. */ #include #include #include #include #include #include #include #include #if !defined(VMX86_TOOLS) #include #endif #include #include "impersonateInt.h" #include "su.h" #include "posix.h" #if !defined(VMX86_TOOLS) static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; static pthread_key_t threadLocalStorageKey = INVALID_PTHREAD_KEY_VALUE; static void ThreadLocalFree(void *ptr); #else static ImpersonationState *impLinux = NULL; #endif static Bool ImpersonateDoPosix(struct passwd *pwd); /* *---------------------------------------------------------------------------- * * ImpersonateInit -- * * Linux specific initialization (thread local storage for linux) * * Results: * None. * * Side effects: * Memory created. * *---------------------------------------------------------------------------- */ void ImpersonateInit(void) { #if !defined(VMX86_TOOLS) int status; status = pthread_key_create(&threadLocalStorageKey, ThreadLocalFree); if (status != 0) { Warning("Impersonate: key_create failed: %d\n", status); VERIFY(status == 0); return; } VERIFY(threadLocalStorageKey != INVALID_PTHREAD_KEY_VALUE); #endif } /* *---------------------------------------------------------------------- * * ThreadLocalFree -- * * A wrapper for "free()". This function is called when a thread * terminates so that the thread-local state can be deallocated. * *---------------------------------------------------------------------- */ #if !defined(VMX86_TOOLS) static void ThreadLocalFree(void *ptr) { ImpersonationState *imp = (ImpersonationState*) ptr; IMPWARN(("Impersonate: ThreadLocalFree(0x%08x)\n", imp)); ASSERT(imp); ASSERT(imp->impersonatedUser == NULL); ASSERT(imp->refCount == 0); free(imp); } #endif /* *---------------------------------------------------------------------------- * * ImpersonateGetTLS -- * * This function abstracts away the differences between Linux and * Windows for obtaining a pointer to thread-local state. * * Results: * Returns pointer to thread-local state. * * Side effects: * On Linux this function will allocate state on the first occasion * that a particular thread calls this function for the first time. * *---------------------------------------------------------------------------- */ ImpersonationState * ImpersonateGetTLS(void) { ImpersonationState *ptr = NULL; int status; /* If a prior call has already allocated state, then use it */ #if !defined(VMX86_TOOLS) /* If a prior call has already allocated state, then use it */ ptr = pthread_getspecific(threadLocalStorageKey); #else ptr = impLinux; #endif if (ptr != NULL) { return ptr; } /* No state allocated, so we need to allocate it */ ptr = calloc(1, sizeof *ptr); VERIFY(ptr); #if !defined(VMX86_TOOLS) status = pthread_setspecific(threadLocalStorageKey, ptr); #else impLinux = ptr; status = 0; #endif if (status != 0) { Warning("Impersonate: setspecific: %d\n", status); VERIFY(status == 0); } return ptr; } /* *---------------------------------------------------------------------------- * * ImpersonateRunas -- * * Impersonate as the appropriate runas user. In linux this is always * the config file owner regardless the calling context. * * Results: * TRUE if impersonation succeeds, FALSE otherwise. * * Side effects: * imp.impersonatedUser may be updated. * *---------------------------------------------------------------------------- */ Bool ImpersonateRunas(const char *cfg, // IN const char *caller, // IN AuthToken callerToken) // IN { /* * In linux, this call always impersonates as the owner of the config file. */ ASSERT(!caller && !callerToken); return ImpersonateOwner(cfg); } /* *---------------------------------------------------------------------------- * * ImpersonateOwner -- * * Impersonate the owner of the config file. Only makes sense on linux. * * Results: * TRUE if impersonation succeeds, false otherwise. * * Side effects: * imp.impersonatedUser may be updated. * *---------------------------------------------------------------------------- */ Bool ImpersonateOwner(const char *file) // IN { struct stat buf; char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; int error; if (Posix_Stat(file, &buf) == -1) { Warning("Failed to lookup owner for: %s. Reason: %s\n", file, Err_Errno2String(errno)); return FALSE; } if ((error = Posix_Getpwuid_r(buf.st_uid, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } Warning("Failed to lookup user with uid: %" FMTUID ". Reason: %s\n", buf.st_uid, Err_Errno2String(error)); return FALSE; } return ImpersonateDoPosix(ppw); } /* *---------------------------------------------------------------------- * * ImpersonateUndo -- Linux specific * * Change back into the superuser * * Side effects: * * EUID is set back to the superuser, and environment variables are * updated back. * *---------------------------------------------------------------------- */ Bool ImpersonateUndo(void) { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; ImpersonationState *imp = NULL; int ret; int error; #if !defined(VMX86_TOOLS) pthread_mutex_lock(&mut); #endif imp = ImpersonateGetTLS(); ASSERT(imp); //ASSERT(imp->impersonatedUser); if ((error = Posix_Getpwuid_r(0, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } ret = error; Warning("Failed to get password entry for uid 0: %s\n", Err_Errno2String(error)); goto exit; } #if __APPLE__ NOT_IMPLEMENTED(); #else /* Return to root */ ret = Id_SetEUid(ppw->pw_uid); if (ret < 0) { goto exit; } #endif ret = Id_SetGid(ppw->pw_gid); if (ret < 0) { goto exit; } /* * The call to initgroups leaks memory in versions of glibc earlier than 2.1.93. * See bug 10042. -jhu */ ret = initgroups(ppw->pw_name, ppw->pw_gid); if (ret < 0) { goto exit; } /* Restore root's environment */ Posix_Setenv("USER", ppw->pw_name, 1); Posix_Setenv("HOME", ppw->pw_dir, 1); Posix_Setenv("SHELL", ppw->pw_shell, 1); free((char *)imp->impersonatedUser); imp->impersonatedUser = NULL; ret = 0; exit: VERIFY(ret == 0); #if !defined(VMX86_TOOLS) pthread_mutex_unlock(&mut); #endif return (ret ? FALSE : TRUE); } /* *---------------------------------------------------------------------------- * * ImpersonateDoPosix -- * * Impersonate as the user corresponding to the passwd entry * XXX: Mostly copied from vmsd_impersonate.c * * Results: * TRUE if impersonation succeeds, FALSE otherwise. * * Side effects: * imp.impersonatedUser is updated. * *---------------------------------------------------------------------------- */ Bool ImpersonateDoPosix(struct passwd *pwd) // IN { int ret = 0; ImpersonationState *imp = NULL; #if !defined(VMX86_TOOLS) pthread_mutex_lock(&mut); #endif imp = ImpersonateGetTLS(); ASSERT(imp); if (pwd->pw_uid == geteuid()) { imp->refCount++; IMPWARN(("ImpersonateDoPosix (%s : %x : %x) refcount = %d\n", imp->impersonatedUser, getpid(), imp, imp->refCount)); goto unlock; } ASSERT(getuid() == 0); VERIFY(geteuid() == 0); ret = Id_SetGid(pwd->pw_gid); if (ret < 0) { goto exit; } /* * The call to initgroups leaks memory in versions of glibc earlier than * 2.1.93.See bug 10042. -jhu */ ret = initgroups(pwd->pw_name, pwd->pw_gid); if (ret < 0) { goto exit; } #if __APPLE__ NOT_IMPLEMENTED(); #else ret = Id_SetEUid(pwd->pw_uid); if (ret < 0) { goto exit; } #endif /* Setup the user's environment */ Posix_Setenv("USER", pwd->pw_name, 1); Posix_Setenv("HOME", pwd->pw_dir, 1); Posix_Setenv("SHELL", pwd->pw_shell, 1); imp->impersonatedUser = strdup(pwd->pw_name); VERIFY(imp->impersonatedUser); exit: imp->refCount = 1; VERIFY(ret == 0); unlock: #if !defined(VMX86_TOOLS) pthread_mutex_unlock(&mut); #endif return (ret ? FALSE : TRUE); } /* *---------------------------------------------------------------------------- * * ImpersonateDo -- * * Impersonate as user. Can be nested if impersonated as that same user * each time. Can switch back to root temporarily regardless of nesting * level via Impersonate_ForceRoot. Calling Impersonate_UnforceRoot will * return to original impersonation at the same nesting level. * * Results: * TRUE if impersonation succeeds, FALSE otherwise. * * Side effects: * imp.impersonatedUser may be updated. * *---------------------------------------------------------------------------- */ Bool ImpersonateDo(const char *user, // IN AuthToken token) // IN { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; int error; if ((error = Posix_Getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } Warning("Failed to get password entry for : %s. Reason: %s\n", user, Err_Errno2String(error)); return FALSE; } return ImpersonateDoPosix(ppw); } /* *---------------------------------------------------------------------------- * * ImpersonateForceRoot -- * * Go back to base impersonate level (LocalSystem/root) for a brief * period of time. * Should only be used when already impersonated. This call is not nestable. * No other impersonation is permitted before calling Impersonate_UnforceRoot. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * imp.forceRoot is set to TRUE on success. * *---------------------------------------------------------------------------- */ Bool ImpersonateForceRoot(void) { return TRUE; } /* *---------------------------------------------------------------------------- * * ImpersonateUnforceRoot -- * * Unforce from root to original impersonation context * * Results: * TRUE on success, FALSE otherwise. * * Side effects: * imp.forceRoot is set to FALSE on success * *---------------------------------------------------------------------------- */ Bool ImpersonateUnforceRoot(void) { return TRUE; } open-vm-tools-10.0.7-3227872/lib/impersonate/Makefile.am0000644000000000000000000000210512660700526021002 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libImpersonate.la libImpersonate_la_SOURCES = libImpersonate_la_SOURCES += impersonate.c libImpersonate_la_SOURCES += impersonatePosix.c AM_CFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ open-vm-tools-10.0.7-3227872/lib/impersonate/impersonateInt.h0000644000000000000000000000376412660700526022134 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * impersonateInt.h -- * * Header file shared by impersonate code */ #ifndef _IMPERSONATE_INT_H_ #define _IMPERSONATE_INT_H_ #include "vmware.h" #include "msg.h" #include "impersonate.h" #include "auth.h" //#define IMP_VERBOSE 1 #define INVALID_PTHREAD_KEY_VALUE (-1) #ifdef IMP_VERBOSE #define IMPWARN(x) Warning x #else #define IMPWARN(x) #endif typedef struct ImpersonationState { const char *impersonatedUser; // the user we are currently impersonating int refCount; // # of times we are impersonating as same user #ifdef _WIN32 HANDLE impersonatedToken; // the access token currently impersonated with Bool forceRoot; // are we temporarily switching back to root? #endif } ImpersonationState; void ImpersonateInit(void); ImpersonationState *ImpersonateGetTLS(void); Bool ImpersonateRunas(const char *cfg, const char *caller, AuthToken callerToken); Bool ImpersonateOwner(const char *file); Bool ImpersonateDo(const char *user, AuthToken token); Bool ImpersonateUndo(void); Bool ImpersonateForceRoot(void); Bool ImpersonateUnforceRoot(void); #endif // ImpersonateInt.h open-vm-tools-10.0.7-3227872/lib/impersonate/Makefile.in0000644000000000000000000004065112660700526021023 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/impersonate DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libImpersonate_la_LIBADD = am_libImpersonate_la_OBJECTS = impersonate.lo impersonatePosix.lo libImpersonate_la_OBJECTS = $(am_libImpersonate_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libImpersonate_la_SOURCES) DIST_SOURCES = $(libImpersonate_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libImpersonate.la libImpersonate_la_SOURCES = impersonate.c impersonatePosix.c AM_CFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/impersonate/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/impersonate/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libImpersonate.la: $(libImpersonate_la_OBJECTS) $(libImpersonate_la_DEPENDENCIES) $(LINK) $(libImpersonate_la_OBJECTS) $(libImpersonate_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/impersonate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/impersonatePosix.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/impersonate/impersonate.c0000644000000000000000000002352512660700526021451 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * impersonate.c -- * * Description: * Code to impersonate as a user when running under a privileged account. * Nested impersonation is not supported. */ #include #include "vmware.h" #include "auth.h" #include "userlock.h" #include "mutexRankLib.h" #include "impersonateInt.h" static Atomic_Ptr impersonateLockStorage; Bool impersonationEnabled = FALSE; /* *---------------------------------------------------------------------- * * ImpersonateGetLock -- * * Get/create the impersonate lock. * * Results: * See above. * * Side effects: * See above. * *---------------------------------------------------------------------- */ static INLINE MXUserRecLock * ImpersonateGetLock(void) { MXUserRecLock *lock = MXUser_CreateSingletonRecLock(&impersonateLockStorage, "impersonateLock", RANK_impersonateLock); VERIFY(lock); return lock; } /* *---------------------------------------------------------------------- * * ImpersonateLock -- * * Acquire or release the impersonate lock. Protects access to * the library's static and TLS states. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE void ImpersonateLock(Bool lock) // IN { MXUserRecLock *impersonateLock = ImpersonateGetLock(); if (lock) { MXUser_AcquireRecLock(impersonateLock); } else { MXUser_ReleaseRecLock(impersonateLock); } } /* *---------------------------------------------------------------------- * * Impersonate_Init -- * * Initialize the impersonation module. On windows also load * userenv.dll. * Without calling this, code calling into this module will * essentially be noops. * * Call when single-threaded. * * Side effects: * * Loads the library. We keep the library loaded thereafter. * *---------------------------------------------------------------------- */ void Impersonate_Init(void) { if (!impersonationEnabled) { ImpersonateInit(); impersonationEnabled = TRUE; } } /* *---------------------------------------------------------------------------- * * Impersonate_Runas -- * * Impersonate as the appropriate runas user. In linux this is always * the config file owner regardless the calling context. In windows, the * runas user is the caller passed into the method, except when the VM has * a preconfigured runas user, in which case we will impersonate using his * credentials instead. * * In windows, if caller is not set, fail if preconfigured runas user is * not found. * * Results: * TRUE if impersonation succeeds, FALSE otherwise. * * Side effects: * imp.impersonatedUser may be updated. * *---------------------------------------------------------------------------- */ Bool Impersonate_Runas(const char *cfg, // IN const char *caller, // IN AuthToken callerToken) // IN { Bool res; if (!impersonationEnabled) { return TRUE; } ImpersonateLock(TRUE); res = ImpersonateRunas(cfg, caller, callerToken); ImpersonateLock(FALSE); return res; } /* *---------------------------------------------------------------------------- * * Impersonate_Owner -- * * Impersonate as the owner of the specified file. * * Results: * TRUE if impersonation succeeds, FALSE otherwise. * * Side effects: * imp.impersonatedUser may be updated. * *---------------------------------------------------------------------------- */ Bool Impersonate_Owner(const char *file) // IN { Bool res; if (!impersonationEnabled) { return TRUE; } ImpersonateLock(TRUE); res = ImpersonateOwner(file); ImpersonateLock(FALSE); return res; } /* *---------------------------------------------------------------------------- * * Impersonate_Do -- * * Impersonate as user. Can be nested if impersonated as that same user * each time. Can switch back to root temporarily regardless of nesting * level via Impersonate_ForceRoot. Calling Impersonate_UnforceRoot will * return to original impersonation at the same nesting level. * * Results: * TRUE if impersonation succeeds, FALSE otherwise. * * Side effects: * imp.impersonatedUser may be updated. * imp.impersonatedToken(Win32 only) may be updated. * *---------------------------------------------------------------------------- */ Bool Impersonate_Do(const char *user, // IN AuthToken token) // IN { Bool res; if (!impersonationEnabled) { return TRUE; } ImpersonateLock(TRUE); res = ImpersonateDo(user, token); ImpersonateLock(FALSE); return res; } /* *---------------------------------------------------------------------------- * * Impersonate_Undo -- * * Undoes a previous impersonation. When we undo the last in the nesting * of impersonation ops, switch back to root. * * Results: * TRUE on success, FALSE otherwise * * Side effects: * On reverting back to root, * imp.impersonatedUser is freed. * imp.impersonatedToken (win32) is invalid. * *---------------------------------------------------------------------------- */ Bool Impersonate_Undo(void) { Bool res; ImpersonationState *imp = NULL; if (!impersonationEnabled) { return TRUE; } ImpersonateLock(TRUE); imp = ImpersonateGetTLS(); ASSERT(imp); WIN32_ONLY(ASSERT(!imp->forceRoot)); imp->refCount--; POSIX_ONLY(IMPWARN(("Impersonate_Undo (%x %x) drop refcount to %d\n", getpid(), imp, imp->refCount))); WIN32_ONLY(IMPWARN(("Impersonate_Undo (%x) drop refcount to %d\n", (int) imp, imp->refCount))); if (imp->refCount > 0) { ImpersonateLock(FALSE); return TRUE; } res = ImpersonateUndo(); ImpersonateLock(FALSE); return res; } /* *---------------------------------------------------------------------------- * * Impersonate_Who -- * * Returns currently impersonated user name. If not impersonated, * returns NULL. * * Results: * Currently impersonated user name. NULL if not impersonated. * * Side effects: * None. * *---------------------------------------------------------------------------- */ char * Impersonate_Who(void) { char *impUser; ImpersonationState *imp = NULL; if (!impersonationEnabled) { return strdup(""); } ImpersonateLock(TRUE); imp = ImpersonateGetTLS(); ASSERT(imp); impUser = strdup(imp->impersonatedUser); VERIFY(impUser); ImpersonateLock(FALSE); return impUser; } /* *---------------------------------------------------------------------------- * * Impersonate_ForceRoot -- * * Go back to base impersonate level (LocalSystem/root) for a brief period * of time. Doesnt do anything on linux. * Should only be used when already impersonated. This call is not nestable. * No other impersonation is permitted before calling Impersonate_UnforceRoot. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * imp.forceRoot is set to TRUE on success. * *---------------------------------------------------------------------------- */ Bool Impersonate_ForceRoot(void) { Bool res; if (!impersonationEnabled) { return TRUE; } ImpersonateLock(TRUE); res = ImpersonateForceRoot(); ImpersonateLock(FALSE); return res; } /* *---------------------------------------------------------------------------- * * Impersonate_UnforceRoot -- * * Go back to impersonate the user that we switched to root from. * See Impersonate_ForceRoot. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * imp.forceRoot is set to FALSE on success. * *---------------------------------------------------------------------------- */ Bool Impersonate_UnforceRoot(void) { Bool res; if (!impersonationEnabled) { return TRUE; } ImpersonateLock(TRUE); res = ImpersonateUnforceRoot(); ImpersonateLock(FALSE); return res; } #ifdef _WIN32 /* *---------------------------------------------------------------------------- * * Impersonate_CfgRunasOnly -- * * Impersonate as the preconfigured runas user for the VM. * Fails if runas user credentials are not found. * * Results: * TRUE if preconfigured runas user is found impersonation succeeds, * FALSE otherwise. * * Side effects: * imp.impersonatedUser may be updated. * *---------------------------------------------------------------------------- */ Bool Impersonate_CfgRunasOnly(const char *cfg) // IN { Bool res; ImpersonateLock(TRUE); res = Impersonate_Runas(cfg, NULL, NULL); ImpersonateLock(FALSE); return res; } #endif //_WIN32 open-vm-tools-10.0.7-3227872/lib/vmCheck/0000755000000000000000000000000012660700526016002 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/vmCheck/Makefile.am0000644000000000000000000000173512660700526020044 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libVmCheck.la libVmCheck_la_SOURCES = libVmCheck_la_SOURCES += vmcheck.c open-vm-tools-10.0.7-3227872/lib/vmCheck/vmcheck.c0000644000000000000000000001550612660700526017575 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * vmcheck.c -- * * Utility functions for discovering our virtualization status. */ #include #include #ifdef WINNT_DDK # include #endif #include "vmware.h" #include "vm_version.h" #include "vm_tools_version.h" #if !defined(WINNT_DDK) # include "hostinfo.h" #endif /* * backdoor.h includes some files which redefine constants in ntddk.h. Ignore * warnings about these redefinitions for WIN32 platform. */ #ifdef WINNT_DDK #pragma warning (push) // Warning: Conditional expression is constant. #pragma warning( disable:4127 ) #endif #include "backdoor.h" #ifdef WINNT_DDK #pragma warning (pop) #endif #include "backdoor_def.h" #include "debug.h" typedef Bool (*SafeCheckFn)(void); #if !defined(_WIN32) # include "vmsignal.h" # include "setjmp.h" static sigjmp_buf jmpBuf; static Bool jmpIsSet; /* *---------------------------------------------------------------------- * * VmCheckSegvHandler -- * * Signal handler for segv. Return to the program state saved * by a previous call to sigsetjmp, or Panic if sigsetjmp hasn't * been called yet. This function never returns; * * Return Value: * None. * * Side effects: * See the manpage for sigsetjmp for details. * *---------------------------------------------------------------------- */ static void VmCheckSegvHandler(int clientData) // UNUSED { if (jmpIsSet) { siglongjmp(jmpBuf, 1); } else { Panic("Received SEGV, exiting."); } } #endif /* *---------------------------------------------------------------------- * * VmCheckSafe -- * * Calls a potentially unsafe function, trapping possible exceptions. * * Results: * * Return value of the passed function, or FALSE in case of exception. * * Side effects: * * Temporarily suppresses signals / SEH exceptions * *---------------------------------------------------------------------- */ static Bool VmCheckSafe(SafeCheckFn checkFn) { Bool result = FALSE; /* * On a real host this call should cause a GP and we catch * that and set result to FALSE. */ #if defined(_WIN32) __try { result = checkFn(); } __except(EXCEPTION_EXECUTE_HANDLER) { /* no op */ } #else do { int signals[] = { SIGILL, SIGSEGV, }; struct sigaction olds[ARRAYSIZE(signals)]; if (Signal_SetGroupHandler(signals, olds, ARRAYSIZE(signals), VmCheckSegvHandler) == 0) { Warning("%s: Failed to set signal handlers.\n", __FUNCTION__); break; } if (sigsetjmp(jmpBuf, TRUE) == 0) { jmpIsSet = TRUE; result = checkFn(); } else { jmpIsSet = FALSE; } if (Signal_ResetGroupHandler(signals, olds, ARRAYSIZE(signals)) == 0) { Warning("%s: Failed to reset signal handlers.\n", __FUNCTION__); } } while (0); #endif return result; } /* *---------------------------------------------------------------------- * * VmCheck_GetVersion -- * * Retrieve the version of VMware that's running on the * other side of the backdoor. * * Return value: * TRUE on success * *version contains the VMX version * *type contains the VMX type * FALSE on failure * * Side effects: * None * *---------------------------------------------------------------------- */ Bool VmCheck_GetVersion(uint32 *version, // OUT uint32 *type) // OUT { Backdoor_proto bp; ASSERT(version); ASSERT(type); /* Make sure EBX does not contain BDOOR_MAGIC */ bp.in.size = ~BDOOR_MAGIC; /* Make sure ECX does not contain any known VMX type */ bp.in.cx.halfs.high = 0xFFFF; bp.in.cx.halfs.low = BDOOR_CMD_GETVERSION; Backdoor(&bp); if (bp.out.ax.word == 0xFFFFFFFF) { /* * No backdoor device there. This code is not executing in a VMware * virtual machine. --hpreg */ return FALSE; } if (bp.out.bx.word != BDOOR_MAGIC) { return FALSE; } *version = bp.out.ax.word; /* * Old VMXs (workstation and express) didn't set their type. In that case, * our special pattern will still be there. --hpreg */ /* * Need to expand this out since the toolchain's gcc doesn't like mixing * integral types and enums in the same trinary operator. */ if (bp.in.cx.halfs.high == 0xFFFF) *type = VMX_TYPE_UNSET; else *type = bp.out.cx.word; return TRUE; } /* *---------------------------------------------------------------------- * * VmCheck_IsVirtualWorld -- * * Verify that we're running in a VM & we're version compatible with our * environment. * * Return value: * TRUE if we're in a virtual machine, FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool VmCheck_IsVirtualWorld(void) { uint32 version; uint32 dummy; #if !defined(WINNT_DDK) if (VmCheckSafe(Hostinfo_TouchXen)) { Debug("%s: detected Xen.\n", __FUNCTION__); return FALSE; } if (VmCheckSafe(Hostinfo_TouchVirtualPC)) { Debug("%s: detected Virtual PC.\n", __FUNCTION__); return FALSE; } if (!VmCheckSafe(Hostinfo_TouchBackDoor)) { Debug("%s: backdoor not detected.\n", __FUNCTION__); return FALSE; } /* It should be safe to use the backdoor without a crash handler now. */ VmCheck_GetVersion(&version, &dummy); #else /* * The Win32 vmwvaudio driver uses this function, so keep the old, * VMware-only check. */ __try { VmCheck_GetVersion(&version, &dummy); } __except (GetExceptionCode() == STATUS_PRIVILEGED_INSTRUCTION) { return FALSE; } #endif if (version != VERSION_MAGIC) { Debug("The version of this program is incompatible with your %s.\n" "For information on updating your VMware Tools please see\n" "http://www.vmware.com/info?id=99\n" "\n", PRODUCT_LINE_NAME); return FALSE; } return TRUE; } open-vm-tools-10.0.7-3227872/lib/vmCheck/Makefile.in0000644000000000000000000004027612660700526020060 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/vmCheck DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libVmCheck_la_LIBADD = am_libVmCheck_la_OBJECTS = vmcheck.lo libVmCheck_la_OBJECTS = $(am_libVmCheck_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libVmCheck_la_SOURCES) DIST_SOURCES = $(libVmCheck_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libVmCheck.la libVmCheck_la_SOURCES = vmcheck.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/vmCheck/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/vmCheck/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libVmCheck.la: $(libVmCheck_la_OBJECTS) $(libVmCheck_la_DEPENDENCIES) $(LINK) $(libVmCheck_la_OBJECTS) $(libVmCheck_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmcheck.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/hgfsServerPolicyGuest/0000755000000000000000000000000012660700525020727 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/hgfsServerPolicyGuest/Makefile.am0000644000000000000000000000202512660700525022762 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libHgfsServerPolicyGuest.la libHgfsServerPolicyGuest_la_SOURCES = libHgfsServerPolicyGuest_la_SOURCES += hgfsServerPolicyGuest.c open-vm-tools-10.0.7-3227872/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c0000644000000000000000000004672112660700525025413 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsServerPolicyGuest.c -- * * Implementation of access policy for hgfs server running in a * VM. All access is allowed. */ #ifdef sun # include # include #elif defined(__FreeBSD__) # include #endif #include "vmware.h" #include "hgfsServerPolicy.h" #define LOGLEVEL_MODULE hgfs #include "loglevel_user.h" typedef struct HgfsServerPolicyState { /* * An empty list means that the policy server enforces the "deny all access * requests" policy --hpreg */ DblLnkLst_Links shares; } HgfsServerPolicyState; static HgfsServerPolicyState myState; static void * HgfsServerPolicyEnumSharesInit(void); static Bool HgfsServerPolicyEnumSharesGet(void *data, char const **name, size_t *len, Bool *done); static Bool HgfsServerPolicyEnumSharesExit(void *data); /* *----------------------------------------------------------------------------- * * HgfsServerPolicyDestroyShare -- * * Destroy the internal representation of a share --hpreg * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerPolicyDestroyShare(HgfsSharedFolder *share) // IN { ASSERT(share); free(share); } /* *----------------------------------------------------------------------------- * * HgfsServerPolicyDestroyShares -- * * Destroy the internal representation of all shares. The function is * idempotent --hpreg * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static void HgfsServerPolicyDestroyShares(DblLnkLst_Links *head) // IN { ASSERT(head); while (head->next != head) { HgfsSharedFolder *share; share = DblLnkLst_Container(head->next, HgfsSharedFolder, links); ASSERT(share); DblLnkLst_Unlink1(&share->links); HgfsServerPolicyDestroyShare(share); } } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_Init -- * * Initialize the HGFS security server state. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerPolicy_Init(HgfsInvalidateObjectsFunc invalidateObjects, // Unused HgfsRegisterSharedFolderFunc registerFolder, // Unused HgfsServerResEnumCallbacks *enumResources) // OUT enum callbacks { HgfsSharedFolder *rootShare; /* * Currently these callbacks are not used, so make sure our caller doesn't pass * it in. */ ASSERT(invalidateObjects == NULL); ASSERT(registerFolder == NULL); DblLnkLst_Init(&myState.shares); /* For the guest, we hard code a "root" share */ rootShare = (HgfsSharedFolder *)malloc(sizeof *rootShare); if (!rootShare) { LOG(4, ("HgfsServerPolicy_Init: memory allocation failed\n")); return FALSE; } DblLnkLst_Init(&rootShare->links); /* * A path = "" has special meaning; it indicates that access is * granted to the root of the server filesystem, and in Win32 * causes everything after the share name in the request to be * interpreted as either a drive letter or UNC name. [bac] */ rootShare->path = ""; rootShare->name = HGFS_SERVER_POLICY_ROOT_SHARE_NAME; rootShare->readAccess = TRUE; rootShare->writeAccess = TRUE; /* These are strictly optimizations to save work later */ rootShare->pathLen = strlen(rootShare->path); rootShare->nameLen = strlen(rootShare->name); rootShare->handle = HGFS_INVALID_FOLDER_HANDLE; /* Add the root node to the end of the list */ DblLnkLst_LinkLast(&myState.shares, &rootShare->links); /* * Fill the share enumeration callback table. */ enumResources->init = HgfsServerPolicyEnumSharesInit; enumResources->get = HgfsServerPolicyEnumSharesGet; enumResources->exit = HgfsServerPolicyEnumSharesExit; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_Cleanup -- * * Cleanup the HGFS security server state. * * Results: * TRUE on success * FALSE on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerPolicy_Cleanup(void) { HgfsServerPolicyDestroyShares(&myState.shares); return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicyGetShare -- * * Get the share whose name matches the given name (if any). * * Results: * The share, if a match is found. * NULL otherwise * * Side effects: * None * *----------------------------------------------------------------------------- */ static HgfsSharedFolder * HgfsServerPolicyGetShare(HgfsServerPolicyState *state, // IN char const *nameIn, // IN: Name to check size_t nameInLen) // IN: Length of nameIn { DblLnkLst_Links *l; ASSERT(state); ASSERT(nameIn); /* * First try to find a share that matches the given name exactly. * This is to handle the case where 2 share names differ in case only. */ for (l = state->shares.next; l != &state->shares; l = l->next) { HgfsSharedFolder *share; share = DblLnkLst_Container(l, HgfsSharedFolder, links); ASSERT(share); if (nameInLen == share->nameLen && !memcmp(nameIn, share->name, nameInLen)) { return share; } } /* * There was no match. As a fall back try a case insensitive match. * This is because some Windows applications uppercase or lowercase the * entire path before sending the request. */ for (l = state->shares.next; l != &state->shares; l = l->next) { HgfsSharedFolder *share; char *tempName; /* * Null terminate the input name before a case insensitive comparison. * This is just to protect against bad implementations of strnicmp. */ if (!(tempName = (char *)malloc(nameInLen + 1))) { LOG(4, ("HgfsServerPolicyGetShare: couldn't allocate tempName\n")); return NULL; } memcpy(tempName, nameIn, nameInLen); tempName[nameInLen] = 0; share = DblLnkLst_Container(l, HgfsSharedFolder, links); ASSERT(share); if (nameInLen == share->nameLen && #ifdef _WIN32 !strnicmp(tempName, share->name, nameInLen)) { #else !strncasecmp(tempName, share->name, nameInLen)) { #endif free(tempName); return share; } free(tempName); } return NULL; } /* State used by HgfsServerPolicyEnumSharesGet and friends */ typedef struct State { DblLnkLst_Links *next; } GetSharesState; /* *----------------------------------------------------------------------------- * * HgfsServerPolicyEnumSharesInit -- * * Setup state for HgfsServerPolicyEnumSharesGet * * Results: * Pointer to state on success. * NULL on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void * HgfsServerPolicyEnumSharesInit(void) { GetSharesState *that; that = malloc(sizeof *that); if (!that) { LOG(4, ("HgfsServerPolicyEnumSharesInit: couldn't allocate state\n")); return NULL; } that->next = myState.shares.next; return that; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicyEnumSharesGet -- * * Enumerate share names one at a time. * * When finished, sets "done" to TRUE. * * Should be called with the results obtained by calling * HgfsServerPolicyEnumSharesInit. * * Results: * TRUE on success. * FALSE on failure (never happens). * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsServerPolicyEnumSharesGet(void *data, // IN: Callback data char const **name, // OUT: Share name size_t *len, // OUT: Name length Bool *done) // OUT: Completion status { GetSharesState *that; HgfsSharedFolder *share; that = (GetSharesState *)data; ASSERT(that); ASSERT(name); ASSERT(len); ASSERT(done); if (that->next == &myState.shares) { /* No more shares */ *done = TRUE; return TRUE; } share = DblLnkLst_Container(that->next, HgfsSharedFolder, links); ASSERT(share); that->next = share->links.next; *name = share->name; *len = share->nameLen; LOG(4, ("HgfsServerPolicyEnumSharesGet: Share name is \"%s\"\n", *name)); *done = FALSE; return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicyEnumSharesExit -- * * Cleanup state from HgfsServerPolicyEnumSharesGet * * Results: * TRUE on success. * FALSE on failure (never happens). * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool HgfsServerPolicyEnumSharesExit(void *data) // IN: Callback data { GetSharesState *that; that = (GetSharesState *)data; ASSERT(that); free(that); return TRUE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_GetSharePath -- * * Get the local path for a share name by looking at the requested * name, finding the matching share (if any), checking access * permissions, and returning the share's local path. * * Results: * An HgfsNameStatus value indicating the result is returned. * * The local path for the shareName is also returned if a match is found and * access is permitted. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsNameStatus HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: Name to check size_t nameInLen, // IN: Length of nameIn HgfsOpenMode mode, // IN: Requested access mode size_t *sharePathLen, // OUT: Length of share path char const **sharePath) // OUT: Share path { HgfsSharedFolder *myShare; ASSERT(nameIn); ASSERT(sharePathLen); ASSERT(sharePath); myShare = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); if (!myShare) { LOG(4, ("HgfsServerPolicy_GetSharePath: No matching share name\n")); return HGFS_NAME_STATUS_DOES_NOT_EXIST; } /* * See if access is allowed in the requested mode. * * XXX Yeah, this is retarded. We should be using bits instead of * an enum for HgfsOpenMode. Add it to the todo list. [bac] */ switch (HGFS_OPEN_MODE_ACCMODE(mode)) { case HGFS_OPEN_MODE_READ_ONLY: if (!myShare->readAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Read access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } break; case HGFS_OPEN_MODE_WRITE_ONLY: if (!myShare->writeAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Write access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } break; case HGFS_OPEN_MODE_READ_WRITE: if (!myShare->readAccess || !myShare->writeAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Read/write access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } break; default: LOG(0, ("HgfsServerPolicy_GetSharePath: Invalid mode\n")); return HGFS_NAME_STATUS_FAILURE; break; } *sharePathLen = myShare->pathLen; *sharePath = myShare->path; return HGFS_NAME_STATUS_COMPLETE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_ProcessCPName -- * * Get the local path for a share name by looking at the requested * name, finding the matching share (if any) and returning the share's * local path local path and permissions. * * Results: * An HgfsNameStatus value indicating the result is returned. * * The local path for the shareName is also returned if a match is found. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsNameStatus HgfsServerPolicy_ProcessCPName(char const *nameIn, // IN: name in CPName form size_t nameInLen, // IN: length of the name Bool *readAccess, // OUT: Read permissions Bool *writeAccess, // OUT: Write permissions HgfsSharedFolderHandle *handle,// OUT: folder handle char const **shareBaseDir) // OUT: Shared directory { HgfsSharedFolder *myShare; ASSERT(nameIn); ASSERT(shareBaseDir); myShare = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); if (!myShare) { LOG(4, ("%s: No matching share name\n", __FUNCTION__)); return HGFS_NAME_STATUS_DOES_NOT_EXIST; } *readAccess = myShare->readAccess; *writeAccess = myShare->writeAccess; *shareBaseDir = myShare->path; *handle = myShare->handle; return HGFS_NAME_STATUS_COMPLETE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_GetShareOptions -- * * Get the HGFS share config options by looking at the requested name, * finding the matching share (if any). * * Results: * HGFS_NAME_STATUS_COMPLETE on success, and HGFS_NAME_STATUS_DOES_NOT_EXIST * if no matching share. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsNameStatus HgfsServerPolicy_GetShareOptions(char const *nameIn, // IN: Share name size_t nameInLen, // IN: Share name length HgfsShareOptions *configOptions)// OUT: Config options { HgfsSharedFolder *share; char const *inEnd; char *next; int len; ASSERT(nameIn); ASSERT(configOptions); inEnd = nameIn + nameInLen; len = CPName_GetComponent(nameIn, inEnd, (char const **) &next); if (len < 0) { LOG(4, ("HgfsServerPolicy_GetShareOptions: get first component failed\n")); return HGFS_NAME_STATUS_FAILURE; } share = HgfsServerPolicyGetShare(&myState, nameIn, len); if (!share) { LOG(4, ("HgfsServerPolicy_GetShareOptions: No matching share name.\n")); return HGFS_NAME_STATUS_DOES_NOT_EXIST; } *configOptions = share->configOptions; return HGFS_NAME_STATUS_COMPLETE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_IsShareOptionSet -- * * Check if the specified config option is set. * * Results: * TRUE if set. * FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerPolicy_IsShareOptionSet(HgfsShareOptions configOptions, // IN: config options uint32 option) // IN: option to check { return (configOptions & option) == option; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_GetShareMode -- * * Get the access mode for a share by looking at the requested * name, finding the matching share (if any), and returning * the share's access mode. * * Results: * An HgfsNameStatus value indicating the result is returned. * * The access mode for the shareName is also returned if a match is found. * * Side effects: * None * *----------------------------------------------------------------------------- */ HgfsNameStatus HgfsServerPolicy_GetShareMode(char const *nameIn, // IN: Share name to retrieve size_t nameInLen, // IN: Length of Share name HgfsOpenMode *mode) // OUT: Share's access mode { HgfsSharedFolder *share; ASSERT(nameIn); ASSERT(mode); share = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); if (!share) { LOG(4, ("HgfsServerPolicy_GetShareMode: No matching share name\n")); return HGFS_NAME_STATUS_DOES_NOT_EXIST; } /* * Get the access mode. */ if (share->readAccess && share->writeAccess) { *mode = HGFS_OPEN_MODE_READ_WRITE; } else if (share->readAccess) { *mode = HGFS_OPEN_MODE_READ_ONLY; } else if (share->writeAccess) { *mode = HGFS_OPEN_MODE_WRITE_ONLY; } else { /* Share should be at least read or write access. */ ASSERT(FALSE); LOG(4, ("HgfsServerPolicy_GetShareMode: Invalid access mode\n")); return HGFS_NAME_STATUS_FAILURE; } return HGFS_NAME_STATUS_COMPLETE; } /* *----------------------------------------------------------------------------- * * HgfsServerPolicy_CheckMode -- * * Checks if the requested mode may be granted depending on read/write permissions. * * Results: * TRUE if the requested mode can be granted, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool HgfsServerPolicy_CheckMode(HgfsOpenMode mode, // IN: mode to check Bool writePermissions, // IN: callers write permissions Bool readPermissions) // IN: callers read permissions { /* * See if access is allowed in the requested mode. * * XXX Yeah, this is retarded. We should be using bits instead of * an enum for HgfsOpenMode. Add it to the todo list. [bac] */ switch (HGFS_OPEN_MODE_ACCMODE(mode)) { case HGFS_OPEN_MODE_READ_ONLY: if (!readPermissions) { LOG(4, ("HgfsServerPolicyCheckMode: Read access denied\n")); return FALSE; } break; case HGFS_OPEN_MODE_WRITE_ONLY: if (!writePermissions) { LOG(4, ("HgfsServerPolicyCheckMode: Write access denied\n")); return FALSE; } break; case HGFS_OPEN_MODE_READ_WRITE: if (!readPermissions || !writePermissions) { LOG(4, ("HgfsServerPolicyCheckMode: Read/write access denied\n")); return FALSE; } break; default: LOG(0, ("HgfsServerPolicyCheckMode: Invalid mode\n")); ASSERT(FALSE); return FALSE; } return TRUE; } open-vm-tools-10.0.7-3227872/lib/hgfsServerPolicyGuest/Makefile.in0000644000000000000000000004071412660700525023002 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/hgfsServerPolicyGuest DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libHgfsServerPolicyGuest_la_LIBADD = am_libHgfsServerPolicyGuest_la_OBJECTS = hgfsServerPolicyGuest.lo libHgfsServerPolicyGuest_la_OBJECTS = \ $(am_libHgfsServerPolicyGuest_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libHgfsServerPolicyGuest_la_SOURCES) DIST_SOURCES = $(libHgfsServerPolicyGuest_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libHgfsServerPolicyGuest.la libHgfsServerPolicyGuest_la_SOURCES = hgfsServerPolicyGuest.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/hgfsServerPolicyGuest/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/hgfsServerPolicyGuest/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libHgfsServerPolicyGuest.la: $(libHgfsServerPolicyGuest_la_OBJECTS) $(libHgfsServerPolicyGuest_la_DEPENDENCIES) $(LINK) $(libHgfsServerPolicyGuest_la_OBJECTS) $(libHgfsServerPolicyGuest_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsServerPolicyGuest.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/lock/0000755000000000000000000000000012660700526015352 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/lock/ulRec.c0000644000000000000000000006475612660700526016612 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include "vmware.h" #include "str.h" #include "util.h" #include "userlock.h" #include "hostinfo.h" #include "ulInt.h" struct MXUserRecLock { MXUserHeader header; MXRecLock recursiveLock; Atomic_Ptr heldStatsMem; Atomic_Ptr acquireStatsMem; Atomic_uint32 refCount; /* * This is the MX recursive lock override pointer. It is used within the * VMX only. * * NULL Use the MXRecLock within this structure * MXUser_CreateRecLock was used to create the lock * * !NULL Use the MX_MutexRec pointed to by vmmLock * MXUser_BindMXMutexRec was used to create the lock */ struct MX_MutexRec *vmmLock; }; /* *----------------------------------------------------------------------------- * * MXUserStatsActionRec -- * * Perform the statistics action for the specified lock. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserStatsActionRec(MXUserHeader *header) // IN: { MXUserRecLock *lock = (MXUserRecLock *) header; MXUserHeldStats *heldStats = Atomic_ReadPtr(&lock->heldStatsMem); MXUserAcquireStats *acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); if (UNLIKELY(heldStats != NULL)) { MXUserDumpBasicStats(&heldStats->data, header); if (Atomic_ReadPtr(&heldStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&heldStats->histo), header); } } if (LIKELY(acquireStats != NULL)) { Bool isHot; Bool doLog; double contentionRatio; /* * Dump the statistics for the specified lock. */ MXUserDumpAcquisitionStats(&acquireStats->data, header); if (Atomic_ReadPtr(&acquireStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&acquireStats->histo), header); } /* * Has the lock gone "hot"? If so, implement the hot actions. */ MXUserKitchen(&acquireStats->data, &contentionRatio, &isHot, &doLog); if (UNLIKELY(isHot)) { MXUserForceAcquisitionHisto(&lock->acquireStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); if (UNLIKELY(heldStats != NULL)) { MXUserForceHeldHisto(&lock->heldStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); } if (doLog) { Log("HOT LOCK (%s); contention ratio %f\n", lock->header.name, contentionRatio); } } } } /* *----------------------------------------------------------------------------- * * MXUser_EnableStatsRecLock * * Enable basic stats on the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_EnableStatsRecLock(MXUserRecLock *lock, // IN/OUT: Bool trackAcquisitionTime, // IN: Bool trackHeldTime) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); if (vmx86_stats) { MXUserEnableStats(trackAcquisitionTime ? &lock->acquireStatsMem : NULL, trackHeldTime ? &lock->heldStatsMem : NULL); } return vmx86_stats; } /* *----------------------------------------------------------------------------- * * MXUser_DisableStatsRecLock -- * * Disable basic stats on the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_DisableStatsRecLock(MXUserRecLock *lock) // IN/OUT: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); if (vmx86_stats) { MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); } return vmx86_stats; } /* *----------------------------------------------------------------------------- * * MXUser_SetContentionRatioFloorRecLock -- * * Set the contention ratio floor for the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_SetContentionRatioFloorRecLock(MXUserRecLock *lock, // IN/OUT: double ratio) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); if (vmx86_stats) { result = MXUserSetContentionRatioFloor(&lock->acquireStatsMem, ratio); } else { result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * MXUser_SetContentionCountFloorRecLock -- * * Set the contention count floor for the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_SetContentionCountFloorRecLock(MXUserRecLock *lock, // IN/OUT: uint64 count) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); if (vmx86_stats) { result = MXUserSetContentionCountFloor(&lock->acquireStatsMem, count); } else { result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * MXUser_SetContentionDurationFloorRecLock -- * * Set the contention count floor for the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_SetContentionDurationFloorRecLock(MXUserRecLock *lock, // IN/OUT: uint64 duration) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); if (vmx86_stats) { result = MXUserSetContentionDurationFloor(&lock->acquireStatsMem, duration); } else { result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * MXUserDumpRecLock -- * * Dump a recursive lock. * * Results: * A dump. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserDumpRecLock(MXUserHeader *header) // IN: { MXUserRecLock *lock = (MXUserRecLock *) header; Warning("%s: Recursive lock @ %p\n", __FUNCTION__, lock); Warning("\tsignature 0x%X\n", lock->header.signature); Warning("\tname %s\n", lock->header.name); Warning("\trank 0x%X\n", lock->header.rank); Warning("\tserial number %u\n", lock->header.bits.serialNumber); Warning("\treference count %u\n", Atomic_Read(&lock->refCount)); if (lock->vmmLock == NULL) { Warning("\tlock count %d\n", MXRecLockCount(&lock->recursiveLock)); Warning("\taddress of owner data %p\n", &lock->recursiveLock.nativeThreadID); } else { Warning("\tvmmLock %p\n", lock->vmmLock); } } /* *----------------------------------------------------------------------------- * * MXUser_CreateRecLock -- * * Create a recursive lock specifying if the lock must always be * silent. * * Only the owner (thread) of a recursive lock may recurse on it. * * Results: * NULL Creation failed * !NULL Creation succeeded * * Side effects: * None * *----------------------------------------------------------------------------- */ MXUserRecLock * MXUser_CreateRecLock(const char *userName, // IN: MX_Rank rank) // IN: { uint32 statsMode; char *properName; MXUserRecLock *lock = Util_SafeCalloc(1, sizeof *lock); if (userName == NULL) { properName = Str_SafeAsprintf(NULL, "R-%p", GetReturnAddress()); } else { properName = Util_SafeStrdup(userName); } if (!MXRecLockInit(&lock->recursiveLock)) { free(properName); free(lock); return NULL; } lock->vmmLock = NULL; Atomic_Write(&lock->refCount, 1); lock->header.signature = MXUserGetSignature(MXUSER_TYPE_REC); lock->header.name = properName; lock->header.rank = rank; lock->header.bits.serialNumber = MXUserAllocSerialNumber(); lock->header.dumpFunc = MXUserDumpRecLock; statsMode = MXUserStatsMode(); switch (statsMode) { case 0: MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); lock->header.statsFunc = NULL; break; case 1: MXUserEnableStats(&lock->acquireStatsMem, NULL); lock->header.statsFunc = MXUserStatsActionRec; break; case 2: MXUserEnableStats(&lock->acquireStatsMem, &lock->heldStatsMem); lock->header.statsFunc = MXUserStatsActionRec; break; default: Panic("%s: unknown stats mode: %d!\n", __FUNCTION__, statsMode); } MXUserAddToList(&lock->header); return lock; } /* *----------------------------------------------------------------------------- * * MXUserCondDestroyRecLock -- * * Destroy a recursive lock -- but only if its reference count is zero. * * When the lock is bound to a MX lock, only the MXUser "wrapper" is * freed. The caller is responsible for calling MX_DestroyLockRec() on * the MX lock before calling this routine. * * Results: * Lock is destroyed upon correct reference count. Don't use the * pointer again. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserCondDestroyRecLock(MXUserRecLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(Atomic_Read(&lock->refCount) > 0); if (Atomic_ReadDec32(&lock->refCount) == 1) { if (lock->vmmLock == NULL) { if (MXRecLockCount(&lock->recursiveLock) > 0) { MXUserDumpAndPanic(&lock->header, "%s: Destroy of an acquired recursive lock\n", __FUNCTION__); } MXRecLockDestroy(&lock->recursiveLock); MXUserRemoveFromList(&lock->header); if (vmx86_stats) { MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); } } lock->header.signature = 0; // just in case... free(lock->header.name); lock->header.name = NULL; free(lock); } } void MXUser_DestroyRecLock(MXUserRecLock *lock) // IN: { if (lock != NULL) { MXUserCondDestroyRecLock(lock); } } /* *----------------------------------------------------------------------------- * * MXUser_AcquireRecLock -- * * An acquisition is made (lock is taken) on the specified recursive lock. * * Only the owner (thread) of a recursive lock may recurse on it. * * Results: * The lock is acquired (locked). * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_AcquireRecLock(MXUserRecLock *lock) // IN/OUT: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(Atomic_Read(&lock->refCount) > 0); if (UNLIKELY(lock->vmmLock != NULL)) { ASSERT(MXUserMX_LockRec); (*MXUserMX_LockRec)(lock->vmmLock); } else { /* Rank checking is only done on the first acquisition */ MXUserAcquisitionTracking(&lock->header, TRUE); if (vmx86_stats) { VmTimeType value = 0; MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); MXRecLockAcquire(&lock->recursiveLock, (acquireStats == NULL) ? NULL : &value); if (LIKELY(acquireStats != NULL)) { if (MXRecLockCount(&lock->recursiveLock) == 1) { MXUserHeldStats *heldStats; MXUserHisto *histo; MXUserAcquisitionSample(&acquireStats->data, TRUE, value > acquireStats->data.contentionDurationFloor, value); histo = Atomic_ReadPtr(&acquireStats->histo); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (UNLIKELY(heldStats != NULL)) { heldStats->holdStart = Hostinfo_SystemTimerNS(); } } } } else { MXRecLockAcquire(&lock->recursiveLock, NULL); // non-stats } } } /* *----------------------------------------------------------------------------- * * MXUser_ReleaseRecLock -- * * Release (unlock) a recursive lock. * * Results: * The lock is released. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_ReleaseRecLock(MXUserRecLock *lock) // IN/OUT: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(Atomic_Read(&lock->refCount) > 0); if (UNLIKELY(lock->vmmLock != NULL)) { ASSERT(MXUserMX_UnlockRec); (*MXUserMX_UnlockRec)(lock->vmmLock); } else { if (vmx86_stats) { MXUserHeldStats *heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (LIKELY(heldStats != NULL)) { if (MXRecLockCount(&lock->recursiveLock) == 1) { MXUserHeldStats *heldStats; heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (UNLIKELY(heldStats != NULL)) { VmTimeType value; MXUserHisto *histo = Atomic_ReadPtr(&heldStats->histo); value = Hostinfo_SystemTimerNS() - heldStats->holdStart; MXUserBasicStatsSample(&heldStats->data, value); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } } } } } if (vmx86_debug) { if (MXRecLockCount(&lock->recursiveLock) == 0) { MXUserDumpAndPanic(&lock->header, "%s: Release of an unacquired recursive lock\n", __FUNCTION__); } if (!MXRecLockIsOwner(&lock->recursiveLock)) { MXUserDumpAndPanic(&lock->header, "%s: Non-owner release of an recursive lock\n", __FUNCTION__); } } MXUserReleaseTracking(&lock->header); MXRecLockRelease(&lock->recursiveLock); } } /* *----------------------------------------------------------------------------- * * MXUser_TryAcquireRecLock -- * * An attempt is made to conditionally acquire (lock) a recursive lock. * * Only the owner (thread) of a recursive lock may recurse on it. * * Results: * TRUE Acquired (locked) * FALSE Not acquired * * Side effects: * None * * NOTE: * A "TryAcquire" does not rank check should the acquisition succeed. * This duplicates the behavor of MX locks. * *----------------------------------------------------------------------------- */ Bool MXUser_TryAcquireRecLock(MXUserRecLock *lock) // IN/OUT: { Bool success; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(Atomic_Read(&lock->refCount) > 0); if (UNLIKELY(lock->vmmLock != NULL)) { ASSERT(MXUserMX_TryLockRec); success = (*MXUserMX_TryLockRec)(lock->vmmLock); } else { if (MXUserTryAcquireFail(lock->header.name)) { success = FALSE; goto bail; } success = MXRecLockTryAcquire(&lock->recursiveLock); if (success) { MXUserAcquisitionTracking(&lock->header, FALSE); } if (vmx86_stats) { MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { MXUserAcquisitionSample(&acquireStats->data, success, !success, 0ULL); } } } bail: return success; } /* *----------------------------------------------------------------------------- * * MXUser_IsCurThreadHoldingRecLock -- * * Is a recursive lock held by the calling thread? * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_IsCurThreadHoldingRecLock(MXUserRecLock *lock) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(Atomic_Read(&lock->refCount) > 0); if (UNLIKELY(lock->vmmLock != NULL)) { ASSERT(MXUserMX_IsLockedByCurThreadRec); result = (*MXUserMX_IsLockedByCurThreadRec)(lock->vmmLock); } else { result = MXRecLockIsOwner(&lock->recursiveLock); } return result; } /* *----------------------------------------------------------------------------- * * MXUser_CreateSingletonRecLock -- * * Ensures that the specified backing object (Atomic_Ptr) contains a * recursive lock. This is useful for modules that need to protect * something with a lock but don't have an existing Init() entry point * where a lock can be created. * * Results: * A pointer to the requested lock. * * Side effects: * Generally the lock's resources are intentionally leaked (by design). * *----------------------------------------------------------------------------- */ MXUserRecLock * MXUser_CreateSingletonRecLock(Atomic_Ptr *lockStorage, // IN/OUT: const char *name, // IN: MX_Rank rank) // IN: { MXUserRecLock *lock; ASSERT(lockStorage); lock = Atomic_ReadPtr(lockStorage); if (UNLIKELY(lock == NULL)) { MXUserRecLock *newLock = MXUser_CreateRecLock(name, rank); lock = Atomic_ReadIfEqualWritePtr(lockStorage, NULL, (void *) newLock); if (lock) { MXUser_DestroyRecLock(newLock); } else { lock = Atomic_ReadPtr(lockStorage); } } return lock; } /* *----------------------------------------------------------------------------- * * MXUser_CreateCondVarRecLock -- * * Create a condition variable for use with the specified recurisve lock. * * Results: * As above. * * Side effects: * The created condition variable will cause a run-time error if it is * used with a lock other than the one it was created for. * *----------------------------------------------------------------------------- */ MXUserCondVar * MXUser_CreateCondVarRecLock(MXUserRecLock *lock) { MXUserCondVar *condVar; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(lock->vmmLock == NULL); // only unbound locks condVar = MXUserCreateCondVar(&lock->header, &lock->recursiveLock); return condVar; } /* *----------------------------------------------------------------------------- * * MXUser_WaitCondVarRecLock -- * * Block (sleep) on the specified condition variable. The specified lock * is released upon blocking and is reacquired before returning from this * function. * * Results: * As above. * * Side effects: * It is possible to return from this routine without the condtion * variable having been signalled (spurious wake up); code accordingly! * *----------------------------------------------------------------------------- */ void MXUser_WaitCondVarRecLock(MXUserRecLock *lock, // IN: MXUserCondVar *condVar) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(lock->vmmLock == NULL); // only unbound locks MXUserWaitCondVar(&lock->header, &lock->recursiveLock, condVar, MXUSER_WAIT_INFINITE); } /* *----------------------------------------------------------------------------- * * MXUser_TimedWaitCondVarRecLock -- * * Block (sleep) on the specified condition variable for no longer than * the specified amount of time. The specified lock is released upon * blocking and is reacquired before returning from this function. * * Results: * As above * * Side effects: * It is possible to return from this routine without the condtion * variable having been signalled (spurious wake up); code accordingly! * *----------------------------------------------------------------------------- */ void MXUser_TimedWaitCondVarRecLock(MXUserRecLock *lock, // IN: MXUserCondVar *condVar, // IN: uint32 msecWait) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(lock->vmmLock == NULL); // only unbound locks MXUserWaitCondVar(&lock->header, &lock->recursiveLock, condVar, msecWait); } /* *----------------------------------------------------------------------------- * * MXUser_DumpRecLock -- * * Dump a recursive lock. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void MXUser_DumpRecLock(MXUserRecLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); MXUserDumpRecLock(&lock->header); } /* *----------------------------------------------------------------------------- * * MXUser_GetRecLockVmm -- * * Return lock->vmmLock. Perhaps this lock is bound to an MX lock. * * Results: * lock->vmmLock is returned. * * Side effects: * None * *----------------------------------------------------------------------------- */ struct MX_MutexRec * MXUser_GetRecLockVmm(MXUserRecLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); return lock->vmmLock; } /* *----------------------------------------------------------------------------- * * MXUser_GetRecLockRank -- * * Return the rank of the specified recursive lock. * * Results: * The rank of the specified recursive lock is returned. * * Side effects: * None * *----------------------------------------------------------------------------- */ MX_Rank MXUser_GetRecLockRank(MXUserRecLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); return lock->header.rank; } /* *----------------------------------------------------------------------------- * * MXUser_BindMXMutexRec -- * * Create an MXUserRecLock that is bound to an (already) initialized * MX_MutexRec. * * Results: * NULL Creation failed * !NULL Creation succeeded * * Side effects: * None * *----------------------------------------------------------------------------- */ MXUserRecLock * MXUser_BindMXMutexRec(struct MX_MutexRec *mutex, // IN: MX_Rank rank) // IN: { char *name; MXUserRecLock *lock; ASSERT(mutex); /* * Cannot perform a binding unless MX_Init has been called. As a side * effect it registers these hook functions. */ if ((MXUserMX_LockRec == NULL) || (MXUserMX_UnlockRec == NULL) || (MXUserMX_TryLockRec == NULL) || (MXUserMX_IsLockedByCurThreadRec == NULL) || (MXUserMX_NameRec == NULL)) { return NULL; } /* * Initialize the header (so it looks correct in memory) but don't connect * this lock to the MXUser statistics or debugging tracking - the MX lock * system will take care of this. */ lock = Util_SafeCalloc(1, sizeof *lock); lock->header.signature = MXUserGetSignature(MXUSER_TYPE_REC); name = (*MXUserMX_NameRec)(mutex); if (name == NULL) { lock->header.name = Str_SafeAsprintf(NULL, "MX_%p", mutex); } else { lock->header.name = Str_SafeAsprintf(NULL, "%s *", name); } lock->header.rank = rank; lock->header.bits.serialNumber = MXUserAllocSerialNumber(); lock->header.dumpFunc = NULL; lock->header.statsFunc = NULL; Atomic_WritePtr(&lock->acquireStatsMem, NULL); Atomic_WritePtr(&lock->heldStatsMem, NULL); Atomic_Write(&lock->refCount, 1); lock->vmmLock = mutex; return lock; } /* *----------------------------------------------------------------------------- * * MXUser_IncRefRecLock -- * * Add a reference to the lock to prevent an immediate destory from * succeeding. * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_IncRefRecLock(MXUserRecLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); ASSERT(Atomic_Read(&lock->refCount) > 0); Atomic_Inc(&lock->refCount); } /* *----------------------------------------------------------------------------- * * MXUser_DecRefRecLock -- * * Remove a reference to the lock. If the reference count is zero, * the lock is destroyed. * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_DecRefRecLock(MXUserRecLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_REC); MXUserCondDestroyRecLock(lock); } open-vm-tools-10.0.7-3227872/lib/lock/ul.c0000644000000000000000000005757612660700526016162 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include "vmware.h" #include "str.h" #include "util.h" #include "userlock.h" #include "ulInt.h" #include "ulIntShared.h" #include "hashTable.h" #include "random.h" static Bool mxInPanic = FALSE; // track when involved in a panic static Bool mxUserCollectLockingTree = FALSE; Bool (*MXUserTryAcquireForceFail)() = NULL; static MX_Rank (*MXUserMxCheckRank)(void) = NULL; static void (*MXUserMxLockLister)(void) = NULL; void (*MXUserMX_LockRec)(struct MX_MutexRec *lock) = NULL; void (*MXUserMX_UnlockRec)(struct MX_MutexRec *lock) = NULL; Bool (*MXUserMX_TryLockRec)(struct MX_MutexRec *lock) = NULL; Bool (*MXUserMX_IsLockedByCurThreadRec)(const struct MX_MutexRec *lock) = NULL; char *(*MXUserMX_NameRec)(const struct MX_MutexRec *lock) = NULL; static void (*MXUserMX_SetInPanic)(void) = NULL; static Bool (*MXUserMX_InPanic)(void) = NULL; #define MXUSER_MAX_LOOP 5 /* *----------------------------------------------------------------------------- * * MXUser_IsLockingTreeAvailable * * Is the lock tracking tree available for reporting? * * Results: * TRUE MXuser lock tree tracking is enabled * FALSE MXUser lock tree tracking is disabled * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_IsLockingTreeAvailable(void) { return mxUserCollectLockingTree; } /* *----------------------------------------------------------------------------- * * MXUser_LockingTreeCollection * * Enable or disable locking tree data collection. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_LockingTreeCollection(Bool enabled) // IN: { mxUserCollectLockingTree = vmx86_devel && vmx86_debug && enabled; } /* *----------------------------------------------------------------------------- * * MXUserInternalSingleton -- * * A "singleton" function for the MXUser internal recursive lock. * * Internal MXUser recursive locks have no statistics gathering or * tracking abilities. They need to used with care and rarely. * * Results: * NULL Failure * !NULL A pointer to an initialized MXRecLock * * Side effects: * Manifold. * *----------------------------------------------------------------------------- */ MXRecLock * MXUserInternalSingleton(Atomic_Ptr *storage) // IN: { MXRecLock *lock = Atomic_ReadPtr(storage); if (UNLIKELY(lock == NULL)) { MXRecLock *newLock = Util_SafeMalloc(sizeof *newLock); if (MXRecLockInit(newLock)) { lock = Atomic_ReadIfEqualWritePtr(storage, NULL, (void *) newLock); if (lock) { MXRecLockDestroy(newLock); free(newLock); } else { lock = Atomic_ReadPtr(storage); } } else { free(newLock); lock = Atomic_ReadPtr(storage); // maybe another thread succeeded } } return lock; } /* *----------------------------------------------------------------------------- * * MXUserSydrome -- * * Generate the syndrome bits for this MXUser library. * * Each MXUser library has unique syndrome bits enabling the run time * detection of locks created with one copy of the MXUser library and * passed to another copy of the MXUser library. * * The syndrome bits are important as they prevent incompatible versions * of the MXUser library from trashing each other. * * The bits are generated by using a source of bits that is external to * a program and its libraries. This way no code or data based scheme * can be spoofed or aliased. * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ static uint32 MXUserSyndrome(void) { uint32 syndrome; static Atomic_uint32 syndromeMem; // implicitly zero -- mbellon syndrome = Atomic_Read(&syndromeMem); if (syndrome == 0) { #if defined(_WIN32) syndrome = GetTickCount(); #else syndrome = time(NULL) & 0xFFFFFFFF; #endif /* * Protect against a total failure. */ if (syndrome == 0) { syndrome++; } /* blind write; if racing one thread or the other will do */ Atomic_ReadIfEqualWrite(&syndromeMem, 0, syndrome); syndrome = Atomic_Read(&syndromeMem); } ASSERT(syndrome); return syndrome; } /* *----------------------------------------------------------------------------- * * MXUserGetSignature -- * * Return a signature appropriate for the specified object type. * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ uint32 MXUserGetSignature(MXUserObjectType objectType) // IN: { uint32 signature; ASSERT((objectType >= 0) && (objectType < 16) && (objectType != MXUSER_TYPE_NEVER_USE)); /* * Use a random syndrome combined with a unique bit pattern mapping * of objectType to bits in a nibble. The random portion of the signature * can be used to catch multiple copies of lib/lock that are "leaking" * locks between them (which may be incompatible due to internal changes). */ signature = (MXUserSyndrome() & 0x0FFFFFFF) | (objectType << 28); ASSERT(signature); return signature; } /* *--------------------------------------------------------------------- * * MXUser_SetInPanic -- * * Notify the locking system that a panic is occurring. * * Results: * Set the "in a panic" state in userland locks and, when possible, * MX locks. * * Side effects: * None * *--------------------------------------------------------------------- */ void MXUser_SetInPanic(void) { mxInPanic = TRUE; if (MXUserMX_SetInPanic != NULL) { MXUserMX_SetInPanic(); } } /* *----------------------------------------------------------------------------- * * MXUserDumpAndPanic -- * * Dump a lock, print a message and die * * Results: * A panic. * * Side effects: * Manifold. * *----------------------------------------------------------------------------- */ void MXUserDumpAndPanic(MXUserHeader *header, // IN: const char *fmt, // IN: ...) // IN: { char *msg; va_list ap; static uint32 loopCounter = 0; // Is panic looping through there? ASSERT((header != NULL) && (header->dumpFunc != NULL)); if (++loopCounter > MXUSER_MAX_LOOP) { /* * Panic is looping through MXUser to here - no progress is being made. * Switch to panic mode in the hopes that this will allow some progress. */ MXUser_SetInPanic(); } (*header->dumpFunc)(header); va_start(ap, fmt); msg = Str_SafeVasprintf(NULL, fmt, ap); va_end(ap); Panic("%s", msg); } /* *--------------------------------------------------------------------- * * MXUser_InPanic -- * * Is the caller in the midst of a panic? * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *--------------------------------------------------------------------- */ Bool MXUser_InPanic(void) { return mxInPanic || (MXUserMX_InPanic != NULL && MXUserMX_InPanic()); } /* *----------------------------------------------------------------------------- * * MXUserInstallMxHooks -- * * The MX facility may notify the MXUser facility that it is place and * that MXUser should check with it. This function should be called from * MX_Init. * * Results: * As Above. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void MXUserInstallMxHooks(void (*theLockListFunc)(void), MX_Rank (*theRankFunc)(void), void (*theLockFunc)(struct MX_MutexRec *lock), void (*theUnlockFunc)(struct MX_MutexRec *lock), Bool (*theTryLockFunc)(struct MX_MutexRec *lock), Bool (*theIsLockedFunc)(const struct MX_MutexRec *lock), char *(*theNameFunc)(const struct MX_MutexRec *lock), void (*theSetInPanicFunc)(void), Bool (*theInPanicFunc)(void)) { /* * This function can be called more than once but the second and later * invocations must be attempting to install the same hook functions as * the first invocation. */ if ((MXUserMxLockLister == NULL) && (MXUserMxCheckRank == NULL) && (MXUserMX_LockRec == NULL) && (MXUserMX_UnlockRec == NULL) && (MXUserMX_TryLockRec == NULL) && (MXUserMX_IsLockedByCurThreadRec == NULL) && (MXUserMX_NameRec == NULL) && (MXUserMX_SetInPanic == NULL) && (MXUserMX_InPanic == NULL) ) { MXUserMxLockLister = theLockListFunc; MXUserMxCheckRank = theRankFunc; MXUserMX_LockRec = theLockFunc; MXUserMX_UnlockRec = theUnlockFunc; MXUserMX_TryLockRec = theTryLockFunc; MXUserMX_IsLockedByCurThreadRec = theIsLockedFunc; MXUserMX_NameRec = theNameFunc; MXUserMX_SetInPanic = theSetInPanicFunc; MXUserMX_InPanic = theInPanicFunc; } else { ASSERT((MXUserMxLockLister == theLockListFunc) && (MXUserMxCheckRank == theRankFunc) && (MXUserMX_LockRec == theLockFunc) && (MXUserMX_UnlockRec == theUnlockFunc) && (MXUserMX_TryLockRec == theTryLockFunc) && (MXUserMX_IsLockedByCurThreadRec == theIsLockedFunc) && (MXUserMX_NameRec == theNameFunc) && (MXUserMX_SetInPanic == theSetInPanicFunc) && (MXUserMX_InPanic == theInPanicFunc) ); } } #if defined(MXUSER_DEBUG) #define MXUSER_MAX_LOCKS_PER_THREAD (2 * MXUSER_MAX_REC_DEPTH) typedef struct MXUserPerThread { struct MXUserPerThread *next; uint32 locksHeld; MXUserHeader *lockArray[MXUSER_MAX_LOCKS_PER_THREAD]; } MXUserPerThread; static Atomic_Ptr perThreadLockMem; static MXUserPerThread *perThreadFreeList = NULL; static Atomic_Ptr hashTableMem; /* *----------------------------------------------------------------------------- * * MXUserAllocPerThread -- * * Allocate a perThread structure. * * Memory is allocated for the specified thread as necessary. Use a * victim cache in front of malloc to provide a slight performance * advantage. The lock here is equivalent to the lock buried inside * malloc but no complex calculations are necessary to perform an * allocation most of the time. * * The maximum size of the list will be roughly the maximum number of * threads having taken locks at the same time - a bounded number less * than or equal to the maximum of threads created. * * Results: * As above. * * Side effects: * Memory may be allocated. * *----------------------------------------------------------------------------- */ static MXUserPerThread * MXUserAllocPerThread(void) { MXUserPerThread *perThread; MXRecLock *perThreadLock = MXUserInternalSingleton(&perThreadLockMem); ASSERT(perThreadLock); MXRecLockAcquire(perThreadLock, NULL); // non-stats if (perThreadFreeList == NULL) { perThread = Util_SafeMalloc(sizeof *perThread); } else { perThread = perThreadFreeList; perThreadFreeList = perThread->next; } MXRecLockRelease(perThreadLock); ASSERT(perThread); memset(perThread, 0, sizeof *perThread); // ensure all zeros return perThread; } /* *----------------------------------------------------------------------------- * * MXUserFreePerThread -- * * Free a perThread structure. * * The structure is placed on the free list -- for "later". * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserFreePerThread(MXUserPerThread *perThread) // IN: { MXRecLock *perThreadLock; ASSERT(perThread); ASSERT(perThread->next == NULL); perThreadLock = MXUserInternalSingleton(&perThreadLockMem); ASSERT(perThreadLock); MXRecLockAcquire(perThreadLock, NULL); // non-stats perThread->next = perThreadFreeList; perThreadFreeList = perThread; MXRecLockRelease(perThreadLock); } /* *----------------------------------------------------------------------------- * * MXUserGetPerThread -- * * Return a pointer to the per thread data for the specified thread. * * Memory is allocated for the specified thread as necessary. This memory * is never released since it it is highly likely a thread will use a * lock and need to record data in the perThread. * * Results: * NULL mayAlloc was FALSE and the thread doesn't have a perThread * !NULL the perThread of the specified thread * * Side effects: * Memory may be allocated. * *----------------------------------------------------------------------------- */ static MXUserPerThread * MXUserGetPerThread(Bool mayAlloc) // IN: alloc perThread if not present? { HashTable *hash; MXUserPerThread *perThread = NULL; void *tid = MXUserCastedThreadID(); hash = HashTable_AllocOnce(&hashTableMem, 1024, HASH_INT_KEY | HASH_FLAG_ATOMIC, NULL); if (!HashTable_Lookup(hash, tid, (void **) &perThread)) { /* No entry for this tid was found, allocate one? */ if (mayAlloc) { MXUserPerThread *newEntry = MXUserAllocPerThread(); /* * Attempt to (racey) insert a perThread on behalf of the specified * thread. If yet another thread takes care of this first, clean up * the mess. */ perThread = HashTable_LookupOrInsert(hash, tid, newEntry); ASSERT(perThread); if (perThread != newEntry) { MXUserFreePerThread(newEntry); } } else { perThread = NULL; } } return perThread; } /* *----------------------------------------------------------------------------- * * MXUserListLocks * * Allow a caller to list, via warnings, the list of locks the caller * has acquired. Ensure that no memory for lock tracking is allocated * if no locks have been taken. * * Results: * None * * Side effects: * The list is printed. * *----------------------------------------------------------------------------- */ void MXUserListLocks(void) { MXUserPerThread *perThread = MXUserGetPerThread(FALSE); if (perThread != NULL) { uint32 i; for (i = 0; i < perThread->locksHeld; i++) { MXUserHeader *hdr = perThread->lockArray[i]; Warning("\tMXUser lock %s (@0x%p) rank 0x%x\n", hdr->name, hdr, hdr->rank); } } } /* *----------------------------------------------------------------------------- * * MXUser_IsCurThreadHoldingLocks -- * * Are any MXUser locks held by the calling thread? * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_IsCurThreadHoldingLocks(void) { MXUserPerThread *perThread = MXUserGetPerThread(FALSE); return (perThread == NULL) ? FALSE : (perThread->locksHeld != 0); } /* *----------------------------------------------------------------------------- * * MXUserThreadRank -- * * Return the highest rank held by the specified thread via MXUser locks. * * Results: * As above * * Side effects: * Can optionally determine if a lock has been locked before. * *----------------------------------------------------------------------------- */ static MX_Rank MXUserThreadRank(MXUserPerThread *perThread, // IN: MXUserHeader *header, // IN: Bool *firstUse) // OUT: { uint32 i; Bool foundOnce = TRUE; MX_Rank maxRank = RANK_UNRANKED; ASSERT(perThread); /* * Determine the maximum rank held. Note if the lock being acquired * was previously entered into the tracking system. */ for (i = 0; i < perThread->locksHeld; i++) { MXUserHeader *chkHdr = perThread->lockArray[i]; maxRank = MAX(chkHdr->rank, maxRank); if (chkHdr == header) { foundOnce = FALSE; } } if (firstUse) { *firstUse = foundOnce; } return maxRank; } /* *----------------------------------------------------------------------------- * * MXUserCurrentRank -- * * Return the highest rank held by the current thread via MXUser locks. * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ MX_Rank MXUserCurrentRank(void) { MX_Rank maxRank; MXUserPerThread *perThread = MXUserGetPerThread(FALSE); if (perThread == NULL) { maxRank = RANK_UNRANKED; } else { maxRank = MXUserThreadRank(perThread, NULL, NULL); } return maxRank; } /* *----------------------------------------------------------------------------- * * MXUserAcquisitionTracking -- * * Perform the appropriate tracking for lock acquisition. * * Results: * Panic when a rank violation is detected (checkRank is TRUE). * Add a lock instance to perThread lock list. * * Side effects: * Manifold. * *----------------------------------------------------------------------------- */ void MXUserAcquisitionTracking(MXUserHeader *header, // IN: Bool checkRank) // IN: { MXUserPerThread *perThread = MXUserGetPerThread(TRUE); VERIFY(perThread->locksHeld < MXUSER_MAX_LOCKS_PER_THREAD); /* * Rank checking anyone? * * Rank checking is abandoned once we're in a panic situation. This will * improve the chances of obtaining a good log and/or coredump. */ if (checkRank && (header->rank != RANK_UNRANKED) && !MXUser_InPanic()) { MX_Rank maxRank; Bool firstInstance = TRUE; /* * Determine the highest rank held by the calling thread. Check for * MX locks if they are present. */ maxRank = MXUserThreadRank(perThread, header, &firstInstance); if (MXUserMxCheckRank) { maxRank = MAX(maxRank, (*MXUserMxCheckRank)()); } /* * Perform rank checking when a lock is entered into the tracking * system for the first time. This works out well because: * * Recursive locks are rank checked only upon their first acquisition... * just like MX locks. * * Exclusive locks will have a second entry added into the tracking * system but will immediately panic due to the run time checking - no * (real) harm done. */ if (firstInstance && (header->rank <= maxRank)) { Warning("%s: lock rank violation by thread %s\n", __FUNCTION__, VThread_CurName()); Warning("%s: locks held:\n", __FUNCTION__); if (MXUserMxLockLister) { (*MXUserMxLockLister)(); } MXUserListLocks(); MXUserDumpAndPanic(header, "%s: rank violation maxRank=0x%x\n", __FUNCTION__, maxRank); } } /* Add a lock instance to the calling threads perThread information */ perThread->lockArray[perThread->locksHeld++] = header; /* * Maintain the lock tracking tree when approporiate. */ if (vmx86_devel && vmx86_debug && mxUserCollectLockingTree) { uint32 i; MXUserLockTreeNode *node = NULL; MXUserLockTreeAcquire(); for (i = 0; i < perThread->locksHeld; i++) { header = perThread->lockArray[i]; node = MXUserLockTreeAdd(node, header->name, header->bits.serialNumber, header->rank); } MXUserLockTreeRelease(); } } /* *----------------------------------------------------------------------------- * * MXUserReleaseTracking -- * * Perform the appropriate tracking for lock release. * * Results: * A panic. * * Side effects: * Manifold. * *----------------------------------------------------------------------------- */ void MXUserReleaseTracking(MXUserHeader *header) // IN: lock, via its header { uint32 i; uint32 lastEntry; MXUserPerThread *perThread = MXUserGetPerThread(FALSE); /* MXUserAcquisitionTracking should have already created a perThread */ if (UNLIKELY(perThread == NULL)) { MXUserDumpAndPanic(header, "%s: perThread not found! (thread 0x%p)\n", __FUNCTION__, MXUserCastedThreadID()); } /* Search the perThread for the argument lock */ for (i = 0; i < perThread->locksHeld; i++) { if (perThread->lockArray[i] == header) { break; } } /* The argument lock had better be in the perThread */ if (UNLIKELY(i >= perThread->locksHeld)) { MXUserDumpAndPanic(header, "%s: lock not found! (thread 0x%p; count %u)\n", __FUNCTION__, MXUserCastedThreadID(), perThread->locksHeld); } /* Remove the argument lock from the perThread */ lastEntry = perThread->locksHeld - 1; if (i < lastEntry) { uint32 j; for (j = i + 1; j < perThread->locksHeld; j++) { perThread->lockArray[i++] = perThread->lockArray[j]; } } perThread->lockArray[lastEntry] = NULL; // tidy up memory perThread->locksHeld--; } /* *----------------------------------------------------------------------------- * * MXUser_TryAcquireFailureControl -- * * Should a TryAcquire operation fail, no matter "what", sometimes? * * Failures occur statistically in debug builds to force our code down * all of its paths. * * Results: * Unknown * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_TryAcquireFailureControl(Bool (*func)(const char *name)) // IN: { MXUserTryAcquireForceFail = func; } /* *----------------------------------------------------------------------------- * * MXUserValidateHeader -- * * Validate an MXUser object header. * * Results: * Return All is well * Panic All is NOT well * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserValidateHeader(MXUserHeader *header, // IN: MXUserObjectType objectType) // IN: { uint32 expected = MXUserGetSignature(objectType); if (header->bits.badHeader == 1) { return; // No need to panic on a bad header repeatedly... } if (header->signature != expected) { header->bits.badHeader = 1; MXUserDumpAndPanic(header, "%s: signature failure! expected 0x%X observed 0x%X\n", __FUNCTION__, expected, header->signature); } if (header->bits.serialNumber == 0) { header->bits.badHeader = 1; MXUserDumpAndPanic(header, "%s: Invalid serial number!\n", __FUNCTION__); } } #endif open-vm-tools-10.0.7-3227872/lib/lock/Makefile.am0000644000000000000000000000231512660700526017407 0ustar rootroot################################################################################ ### Copyright (C) 2010-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libLock.la libLock_la_SOURCES = libLock_la_SOURCES += ul.c libLock_la_SOURCES += ulCondVar.c libLock_la_SOURCES += ulExcl.c libLock_la_SOURCES += ulRec.c libLock_la_SOURCES += ulRW.c libLock_la_SOURCES += ulSema.c libLock_la_SOURCES += ulBarrier.c libLock_la_SOURCES += ulStats.c AM_CFLAGS = @LIB_USER_CPPFLAGS@ open-vm-tools-10.0.7-3227872/lib/lock/ulBarrier.c0000644000000000000000000002237112660700526017452 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include "vmware.h" #include "str.h" #include "util.h" #include "userlock.h" #include "ulInt.h" struct BarrierContext { uint32 count; // Number of threads currently in this context MXUserCondVar *condVar; // Threads within this context are parked here }; typedef struct BarrierContext BarrierContext; struct MXUserBarrier { MXUserHeader header; // Barrier's ID information MXUserExclLock *lock; // Barrier's (internal) lock uint32 configCount; // Hold until this many threads arrive volatile uint32 curContext; // Arrivals go to this context BarrierContext contexts[2]; // The normal and abnormal contexts }; /* *----------------------------------------------------------------------------- * * MXUserDumpBarrier -- * * Dump a barrier. * * Results: * A dump. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserDumpBarrier(MXUserHeader *header) // IN: { uint32 curContext; MXUserBarrier *barrier = (MXUserBarrier *) header; Warning("%s: Barrier @ 0x%p\n", __FUNCTION__, barrier); Warning("\tsignature 0x%X\n", barrier->header.signature); Warning("\tname %s\n", barrier->header.name); Warning("\trank 0x%X\n", barrier->header.rank); Warning("\tserial number %u\n", barrier->header.bits.serialNumber); Warning("\tlock 0x%p\n", barrier->lock); Warning("\tconfigured count %u\n", barrier->configCount); curContext = barrier->curContext; Warning("\tcurrent context %u\n", curContext); Warning("\tcontext[%u] count %u\n", curContext, barrier->contexts[curContext].count); Warning("\tcontext[%u] condVar 0x%p\n", curContext, &barrier->contexts[curContext].condVar); curContext = (curContext + 1) & 0x1; Warning("\tcontext[%u] count %u\n", curContext, barrier->contexts[curContext].count); Warning("\tcontext[%u] condVar 0x%p\n", curContext, &barrier->contexts[curContext].condVar); } /* *----------------------------------------------------------------------------- * * MXUser_CreateBarrier -- * * Create a computational barrier. * * The barriers are self regenerating - they do not need to be * initialized or reset after creation. * * Results: * A pointer to a barrier. * * Side effects: * None * *----------------------------------------------------------------------------- */ MXUserBarrier * MXUser_CreateBarrier(const char *userName, // IN: shall be known as MX_Rank rank, // IN: internal lock's rank uint32 count) // IN: { char *properName; MXUserBarrier *barrier; ASSERT(count); barrier = Util_SafeCalloc(1, sizeof *barrier); if (userName == NULL) { properName = Str_SafeAsprintf(NULL, "Barrier-%p", GetReturnAddress()); } else { properName = Util_SafeStrdup(userName); } barrier->lock = MXUser_CreateExclLock(properName, rank); if (barrier->lock == NULL) { free(properName); free(barrier); return NULL; } barrier->contexts[0].condVar = MXUser_CreateCondVarExclLock(barrier->lock); barrier->contexts[1].condVar = MXUser_CreateCondVarExclLock(barrier->lock); if ((barrier->contexts[0].condVar == NULL) || (barrier->contexts[1].condVar == NULL)) { MXUser_DestroyCondVar(barrier->contexts[0].condVar); MXUser_DestroyCondVar(barrier->contexts[1].condVar); MXUser_DestroyExclLock(barrier->lock); free(properName); free(barrier); return NULL; } barrier->configCount = count; barrier->curContext = 0; barrier->header.signature = MXUserGetSignature(MXUSER_TYPE_BARRIER); barrier->header.name = properName; barrier->header.rank = rank; barrier->header.bits.serialNumber = MXUserAllocSerialNumber(); barrier->header.dumpFunc = MXUserDumpBarrier; barrier->header.statsFunc = NULL; MXUserAddToList(&barrier->header); return barrier; } /* *----------------------------------------------------------------------------- * * MXUser_DestroyBarrier -- * * Destroy a barrier. * * Results: * The barrier is destroyed. Don't try to use the pointer again. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_DestroyBarrier(MXUserBarrier *barrier) // IN/OUT: { if (LIKELY(barrier != NULL)) { MXUserValidateHeader(&barrier->header, MXUSER_TYPE_BARRIER); if ((barrier->contexts[0].count != 0) || (barrier->contexts[1].count != 0)) { MXUserDumpAndPanic(&barrier->header, "%s: Attempted destroy on barrier while in use\n", __FUNCTION__); } barrier->header.signature = 0; // just in case... MXUserRemoveFromList(&barrier->header); MXUser_DestroyCondVar(barrier->contexts[0].condVar); MXUser_DestroyCondVar(barrier->contexts[1].condVar); MXUser_DestroyExclLock(barrier->lock); free(barrier->header.name); barrier->header.name = NULL; free(barrier); } } /* *----------------------------------------------------------------------------- * * MXUser_EnterBarrier -- * * Enter a barrier * * All threads entering the barrier will be suspended until the number * threads that have entered reaches the configured number upon which * time all of the threads will return from this routine. * * "Nobody comes out until everyone goes in." * * Results: * None * * Side effects: * The caller may sleep. * *----------------------------------------------------------------------------- */ void MXUser_EnterBarrier(MXUserBarrier *barrier) // IN/OUT: { BarrierContext *ptr; uint32 context; ASSERT(barrier); MXUserValidateHeader(&barrier->header, MXUSER_TYPE_BARRIER); MXUser_AcquireExclLock(barrier->lock); context = barrier->curContext; ptr = &barrier->contexts[context]; ptr->count++; if (ptr->count == barrier->configCount) { /* * The last thread has entered; release the other threads * * Flip the current context. Should a thread leave the barrier and * enter the barrier while the barrier is "emptying" the thread will * park on the condVar that is not "emptying". Eventually everything * will "work out" and all of the threads will be parked on the opposite * context's condVar. */ barrier->curContext = (context + 1) & 0x1; ASSERT(barrier->contexts[barrier->curContext].count == 0); /* Wake up all of the waiting threads. */ MXUser_BroadcastCondVar(ptr->condVar); } else { /* * Not the last thread in... wait/sleep until the last thread appears. * Protect against spurious wakeups. */ while (barrier->curContext == context) { MXUser_WaitCondVarExclLock(barrier->lock, ptr->condVar); } } ptr->count--; MXUser_ReleaseExclLock(barrier->lock); } /* *----------------------------------------------------------------------------- * * MXUser_CreateSingletonBarrier -- * * Ensures that the specified backing object (Atomic_Ptr) contains a * barrier. This is useful for modules that need to protect something * with a barrier but don't have an existing Init() entry point where a * barrier can be created. * * Results: * A pointer to the requested barrier. * * Side effects: * Generally the barrier's resources are intentionally leaked (by design). * *----------------------------------------------------------------------------- */ MXUserBarrier * MXUser_CreateSingletonBarrier(Atomic_Ptr *barrierStorage, // IN/OUT: const char *name, // IN: MX_Rank rank, // IN: uint32 count) // IN: { MXUserBarrier *barrier; ASSERT(barrierStorage); barrier = Atomic_ReadPtr(barrierStorage); if (UNLIKELY(barrier == NULL)) { MXUserBarrier *newBarrier = MXUser_CreateBarrier(name, rank, count); barrier = Atomic_ReadIfEqualWritePtr(barrierStorage, NULL, (void *) newBarrier); if (barrier) { MXUser_DestroyBarrier(newBarrier); } else { barrier = Atomic_ReadPtr(barrierStorage); } } return barrier; } open-vm-tools-10.0.7-3227872/lib/lock/ulIntShared.h0000644000000000000000000000414112660700526017745 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _ULINTSHARED_H_ #define _ULINTSHARED_H_ #if defined(MXUSER_DEBUG) extern void MXUserListLocks(void); #else static INLINE void MXUserListLocks(void) { return; } #endif MX_Rank MXUserCurrentRank(void); extern void MXUserInstallMxHooks(void (*theLockListFunc)(void), MX_Rank (*theRankFunc)(void), void (*theLockFunc)(struct MX_MutexRec *lock), void (*theUnlockFunc)(struct MX_MutexRec *lock), Bool (*theTryLockFunc)(struct MX_MutexRec *lock), Bool (*theIsLockedFunc)(const struct MX_MutexRec *lock), char *(*theNameFunc)(const struct MX_MutexRec *lock), void (*theSetInPanicFunc)(void), Bool (*theInPanicFunc)(void)); typedef struct MXUserLockTreeNode MXUserLockTreeNode; void MXUserLockTreeAcquire(void); void MXUserLockTreeRelease(void); MXUserLockTreeNode *MXUserLockTreeAdd(MXUserLockTreeNode *searchNode, const char *name, uint32 serialNumber, MX_Rank rank); #endif open-vm-tools-10.0.7-3227872/lib/lock/ulStats.c0000644000000000000000000010266212660700526017164 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include // for sqrt; should be removed soon #if defined(_WIN32) #include #endif #include "vmware.h" #include "str.h" #include "util.h" #include "userlock.h" #include "ulInt.h" #include "hostinfo.h" #include "log.h" #include "logFixed.h" #define BINS_PER_DECADE 100 static double mxUserContentionRatioFloor = 0.0; // always "off" static uint64 mxUserContentionCountFloor = 0; // always "off" static uint64 mxUserContentionDurationFloor = 0; // always "off" static Atomic_Ptr mxLockMemPtr; // internal singleton lock static ListItem *mxUserLockList; // list of all MXUser locks typedef struct { void *address; uint64 timeValue; } TopOwner; #define TOPOWNERS 10 struct MXUserHisto { char *typeName; // Type (name) of histogram uint64 *binData; // Hash table bins uint64 totalSamples; // Population sample size uint64 minValue; // Min value allowed uint64 maxValue; // Max value allowed uint32 numBins; // Number of histogram bins TopOwner ownerArray[TOPOWNERS]; // List of top owners }; static Bool mxUserTrackHeldTimes = FALSE; static char *mxUserHistoLine = NULL; static uint32 mxUserMaxLineLength = 0; static void *mxUserStatsContext = NULL; static void (*mxUserStatsFunc)(void *context, const char *fmt, va_list ap) = NULL; /* *----------------------------------------------------------------------------- * * MXUserAddToList -- * * Add a newly created lock to the list of all userland locks. * * Results: * The lock is added to the list. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserAddToList(MXUserHeader *header) // IN/OUT: { MXRecLock *listLock = MXUserInternalSingleton(&mxLockMemPtr); /* Tolerate a failure. This is too low down to log */ if (listLock) { MXRecLockAcquire(listLock, NULL); // non-stats LIST_QUEUE(&header->item, &mxUserLockList); MXRecLockRelease(listLock); } } /* *----------------------------------------------------------------------------- * * MXUserRemoveFromList -- * * Remove a lock from the list of all userland locks. * * Results: * The lock is removed from the list. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserRemoveFromList(MXUserHeader *header) // IN/OUT: { MXRecLock *listLock = MXUserInternalSingleton(&mxLockMemPtr); /* Tolerate a failure. This is too low down to log */ if (listLock) { MXRecLockAcquire(listLock, NULL); // non-stats LIST_DEL(&header->item, &mxUserLockList); MXRecLockRelease(listLock); } } /* *----------------------------------------------------------------------------- * * MXUserHistoIndex -- * * Return the index into the histogram bins. This makes use of a * fixed point approximation method. * * Results: * (uint32) (BINS_PER_DECADE * log10(value)) * * Side effects: * The computed value may actually be larger than expected by a tiny * amount - the log10 method is a ratio of two integers. * *----------------------------------------------------------------------------- */ static uint32 MXUserHistoIndex(uint64 value) // IN: { uint32 index; if (value == 0) { index = 0; } else { uint32 numerator = 0; uint32 denominator = 0; LogFixed_Base10(value, &numerator, &denominator); index = (BINS_PER_DECADE * numerator) / denominator; } return index; } /* *----------------------------------------------------------------------------- * * MXUserHistoSetup -- * * Set up a histogram object using the specified minimum value and * decade coverage. The minimum value must be 1 or a power of 10. * * These histograms coverage values from the minimum to * minimum * 10^decades with BINS_PER_DECADE bins for each decade * covered. * * Results: * NULL Failure * !NULL Success (a histogram object pointer is returned) * * Side effects: * None * *----------------------------------------------------------------------------- */ MXUserHisto * MXUserHistoSetUp(char *typeName, // type (name) of histogram uint64 minValue, // IN: ns; 1, 10, 100, 1000... uint32 decades) // IN: decimal decades to cover from min { MXUserHisto *histo; ASSERT(decades > 0); ASSERT((minValue != 0) && ((minValue == 1) || ((minValue % 10) == 0))); histo = Util_SafeCalloc(1, sizeof *histo); histo->typeName = Util_SafeStrdup(typeName); histo->numBins = BINS_PER_DECADE * decades; histo->binData = Util_SafeCalloc(histo->numBins, sizeof(uint64)); histo->totalSamples = 0; histo->minValue = minValue; histo->maxValue = histo->minValue; while (decades--) { histo->maxValue *= 10; } return histo; } /* *----------------------------------------------------------------------------- * * MXUserHistoTearDown -- * * Tear down a histogram object; * * Results: * The histogram object is torn down. Don't use it after this. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserHistoTearDown(MXUserHisto *histo) // IN/OUT: { if (histo != NULL) { free(histo->typeName); free(histo->binData); free(histo); } } /* *----------------------------------------------------------------------------- * * MXUserHistoSample -- * * Add a sample to the specified histogram. * * Out-of-bounds on the low end are summed in bin[0]. * Out-of-bounds on the high end are summed in bin[numBins - 1]. * * Results: * As expected. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserHistoSample(MXUserHisto *histo, // IN/OUT: uint64 durationNS, // IN: void *ownerRetAddr) // IN: { uint32 i; uint32 index; ASSERT(histo); histo->totalSamples++; if (durationNS < histo->minValue) { index = 0; } else { index = MXUserHistoIndex(durationNS / histo->minValue); if (index > histo->numBins - 1) { index = histo->numBins - 1; } } ASSERT(index < histo->numBins); histo->binData[index]++; index = 0; for (i = 0; i < TOPOWNERS; i++) { if (histo->ownerArray[i].address == ownerRetAddr) { index = i; break; } if (histo->ownerArray[i].timeValue < histo->ownerArray[index].timeValue) { index = i; } } if (durationNS > histo->ownerArray[index].timeValue) { histo->ownerArray[index].address = ownerRetAddr; histo->ownerArray[index].timeValue = durationNS; } } /* *----------------------------------------------------------------------------- * * MXUserStatsLog -- * * Output the statistics data * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void MXUserStatsLog(const char *fmt, // IN: ...) // IN: { va_list ap; ASSERT(mxUserStatsFunc); va_start(ap, fmt); (*mxUserStatsFunc)(mxUserStatsContext, fmt, ap); va_end(ap); } /* *----------------------------------------------------------------------------- * * MXUserHistoDump -- * * Dump the specified histogram for the specified lock. * * Results: * The histogram is dumped to the statistics log. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserHistoDump(MXUserHisto *histo, // IN: MXUserHeader *header) // IN: { ASSERT(header); ASSERT(histo); if (histo->totalSamples) { char *p; uint32 i; uint32 spaceLeft; ASSERT(mxUserHistoLine); i = Str_Sprintf(mxUserHistoLine, mxUserMaxLineLength, "MXUser: h l=%u t=%s min=%"FMT64"u max=%"FMT64"u\n", header->bits.serialNumber, histo->typeName, histo->minValue, histo->maxValue); /* * The terminating "\n\0" will be overwritten each time a histogram * bin is added to the line. This will ensure that the line is always * properly terminated no matter what happens. */ p = &mxUserHistoLine[i - 1]; spaceLeft = mxUserMaxLineLength - i - 2; /* Add as many histogram bins as possible within the line limitations */ for (i = 0; i < histo->numBins; i++) { if (histo->binData[i] != 0) { uint32 len; char binEntry[32]; len = Str_Sprintf(binEntry, sizeof binEntry, " %u-%"FMT64"u\n", i, histo->binData[i]); if (len < spaceLeft) { /* * Append the bin number, bin count pair to the end of the * string. This includes the terminating "\n\0". Update the * pointer to the next free place to point to the '\n'. If * another entry is made, things work out properly. If not * the string is properly terminated as a line. */ Str_Strcpy(p, binEntry, len + 1); p += len - 1; spaceLeft -= len; } else { break; } } } MXUserStatsLog("%s", mxUserHistoLine); i = Str_Sprintf(mxUserHistoLine, mxUserMaxLineLength, "MXUser: ht l=%u t=%s\n", header->bits.serialNumber, histo->typeName); p = &mxUserHistoLine[i - 1]; spaceLeft = mxUserMaxLineLength - i - 2; for (i = 0; i < TOPOWNERS; i++) { if (histo->ownerArray[i].address != NULL) { uint32 len; char binEntry[32]; /* Use a debugger to change the address to a symbol */ len = Str_Sprintf(binEntry, sizeof binEntry, " %p-%"FMT64"u\n", histo->ownerArray[i].address, histo->ownerArray[i].timeValue); if (len < spaceLeft) { /* * Append the address, time value pair to the end of the * string. This includes the terminating "\n\0". Update the * pointer to the next free place to point to the '\n'. If * another entry is made, things work out properly. If not * the string is properly terminated as a line. */ Str_Strcpy(p, binEntry, len + 1); p += len - 1; spaceLeft -= len; } else { break; } } } MXUserStatsLog("%s", mxUserHistoLine); } } /* *----------------------------------------------------------------------------- * * MXUserBasicStatsSample -- * * Add a sample to the "pure" statistics object. * * Results: * The sample is added. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserBasicStatsSample(MXUserBasicStats *stats, // IN/OUT: uint64 durationNS) // IN: { stats->numSamples++; if (durationNS < stats->minTime) { stats->minTime = durationNS; } if (durationNS > stats->maxTime) { stats->maxTime = durationNS; } stats->timeSum += durationNS; /* Do things in floating point to avoid uint64 overflow */ stats->timeSquaredSum += ((double) durationNS) * ((double) durationNS); } /* *----------------------------------------------------------------------------- * * MXUserBasicStatsSetUp -- * * Set up the "pure" statistics object. * * Results: * The statistics are set up. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserBasicStatsSetUp(MXUserBasicStats *stats, // IN/OUT: char *typeName) // IN: { stats->typeName = Util_SafeStrdup(typeName); stats->numSamples = 0; stats->minTime = ~CONST64U(0); stats->maxTime = 0; stats->timeSum = 0; stats->timeSquaredSum = 0.0; } /* *----------------------------------------------------------------------------- * * MXUserDumpBasicStats -- * * Dump the basic statistics. This routine may run during concurrent * locking activity so explicit checks are necessary to deal with * jittering data. * * Results: * Interesting data is added to the statistics log. * * Side effects: * None * *----------------------------------------------------------------------------- */ static double MXUserSqrt(double x) // IN: hack until next round when FP goes away { double xn; double xn1 = x; if (x == 0.0) { return 0.0; } do { xn = xn1; xn1 = (xn + x/xn) / 2.0; } while (fabs(xn1 - xn) > 1E-10); return xn1; } void MXUserDumpBasicStats(MXUserBasicStats *stats, // IN: MXUserHeader *header) // IN: { uint64 stdDev; if (stats->numSamples < 2) { /* * It's possible to get a request to dump statistics when there * aren't any (e.g. a lock has been acquired but never released so * there are no "held" statistics yet). Ignore requests to dump * statistics when there aren't any. */ if (stats->numSamples == 0) { return; } stdDev = 0; } else { double num; double mean; double variance; num = (double) stats->numSamples; mean = ((double) stats->timeSum) / num; variance = (stats->timeSquaredSum - (num*mean*mean)) / (num - 1.0); stdDev = (variance < 0.0) ? 0 : (uint64) (MXUserSqrt(variance) + 0.5); } MXUserStatsLog("MXUser: e l=%u t=%s c=%"FMT64"u min=%"FMT64"u " "max=%"FMT64"u mean=%"FMT64"u sd=%"FMT64"u\n", header->bits.serialNumber, stats->typeName, stats->numSamples, stats->minTime, stats->maxTime, stats->timeSum/stats->numSamples, stdDev); } /* *----------------------------------------------------------------------------- * * MXUserBasicStatsTearDown -- * * Tear down an basic statistics object. * * Results: * The statistics are set up. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserBasicStatsTearDown(MXUserBasicStats *stats) // IN/OUT: { free(stats->typeName); stats->typeName = NULL; } /* *----------------------------------------------------------------------------- * * MXUserAcquisitionStatsSetUp -- * * Set up an acquisition statistics object. * * Results: * The statistics are set up. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserAcquisitionStatsSetUp(MXUserAcquisitionStats *stats) // IN/OUT: { MXUserBasicStatsSetUp(&stats->basicStats, MXUSER_STAT_CLASS_ACQUISITION); stats->contentionRatioFloor = mxUserContentionRatioFloor; stats->contentionCountFloor = mxUserContentionCountFloor; stats->contentionDurationFloor = mxUserContentionDurationFloor; stats->numAttempts = 0; stats->numSuccesses = 0; stats->numSuccessesContended = 0; stats->totalContentionTime = 0; stats->successContentionTime = 0; } /* *----------------------------------------------------------------------------- * * MXUserAcquisitionSample -- * * Track the acquisition specific statistical data. * * Results: * Much CPU time may be used. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserAcquisitionSample(MXUserAcquisitionStats *stats, // IN/OUT: Bool wasAcquired, // IN: Bool wasContended, // IN: uint64 elapsedTime) // IN: { stats->numAttempts++; if (wasAcquired) { stats->numSuccesses++; if (wasContended) { stats->numSuccessesContended++; stats->totalContentionTime += elapsedTime; stats->successContentionTime += elapsedTime; } MXUserBasicStatsSample(&stats->basicStats, elapsedTime); } else { ASSERT(wasContended); stats->totalContentionTime += elapsedTime; } } /* *----------------------------------------------------------------------------- * * MXUserDumpAcquisitionStats -- * * Dump the acquisition statistics for the specified lock. * * Results: * Much CPU time may be used. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserDumpAcquisitionStats(MXUserAcquisitionStats *stats, // IN: MXUserHeader *header) // IN: { if (stats->numAttempts > 0) { if (stats->numSuccesses > 0) { MXUserDumpBasicStats(&stats->basicStats, header); } MXUserStatsLog("MXUser: ce l=%u a=%"FMT64"u s=%"FMT64"u sc=%"FMT64"u " "sct=%"FMT64"u t=%"FMT64"u\n", header->bits.serialNumber, stats->numAttempts, stats->numSuccesses, stats->numSuccessesContended, stats->successContentionTime, stats->totalContentionTime); } } /* *----------------------------------------------------------------------------- * * MXUserAcquisitionStatsTearDown -- * * Tear down an acquisition statistics object. * * Results: * The statistics are set up. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserAcquisitionStatsTearDown(MXUserAcquisitionStats *stats) // IN/OUT: { MXUserBasicStatsTearDown(&stats->basicStats); } /* *----------------------------------------------------------------------------- * * MXUserKitchen -- * * If you can't take the heat, get out of the kitchen! Report on the * heat generated by the specified lock's acquisition statistics. * * Results: * Data is returned. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserKitchen(MXUserAcquisitionStats *stats, // IN: double *contentionRatio, // OUT: Bool *isHot, // OUT: Bool *doLog) // OUT: { /* * How much "heat" is this lock generating? */ if (stats->numAttempts < stats->contentionCountFloor) { *contentionRatio = 0.0; } else { double basic; double acquisition; /* * Contention shows up in two ways - failed attempts to acquire * and detected contention while acquiring. Determine which is * the largest and use that as the contention ratio for the * specified statistics. */ basic = ((double) stats->numAttempts - stats->numSuccesses) / ((double) stats->numAttempts); acquisition = ((double) stats->numSuccessesContended) / ((double) stats->numSuccesses); *contentionRatio = (basic < acquisition) ? acquisition : basic; } /* * Handle the explicit control cases. * * An mxUserContentionCountFloor value of zero (0) forces all locks to be * considered "cold", regardless of their activity. * * An mxUserContentionCountFloor value of ~((uint64) 0) (all Fs) forces all * locks to be considered "hot" regardless of their activity, with the * side effect that no logging of "temperature changes" is done. */ if (stats->contentionCountFloor == 0) { // never "hot" *isHot = FALSE; *doLog = FALSE; return; } if (stats->contentionCountFloor == ~((uint64) 0)) { // always "hot"; no logging *isHot = TRUE; *doLog = FALSE; return; } /* * Did the thermostat trip? */ if (*contentionRatio > stats->contentionRatioFloor) { // Yes *isHot = TRUE; *doLog = TRUE; } else { // No *doLog = FALSE; *isHot = FALSE; } } /* *----------------------------------------------------------------------------- * * MXUser_StatisticsControl -- * * Specify the settings for automatic "hot locks" operation. * * Results: * Enhanced statistics will be used or never used, depending on these * values; * * Side effects: * Unknown... * *----------------------------------------------------------------------------- */ void MXUser_StatisticsControl(double contentionRatioFloor, // IN: uint64 minAccessCountFloor, // IN: uint64 contentionDurationFloor) // IN: ns { ASSERT((contentionRatioFloor > 0.0) && (contentionRatioFloor <= 1.0)); mxUserContentionRatioFloor = contentionRatioFloor; mxUserContentionCountFloor = minAccessCountFloor; mxUserContentionDurationFloor = contentionDurationFloor; } /* *----------------------------------------------------------------------------- * * MXUserForceHisto -- * * Force histogram taking for the specified histogram. * * Results: * As above. * * Side effects: * Memory is allocated. * *----------------------------------------------------------------------------- */ static INLINE void MXUserForceHisto(Atomic_Ptr *histoPtr, // IN/OUT: char *typeName, // IN: uint64 minValue, // IN: uint32 decades) // IN: { MXUserHisto *ptr = Atomic_ReadPtr(histoPtr); if (ptr == NULL) { MXUserHisto *before; ptr = MXUserHistoSetUp(typeName, minValue, decades); before = Atomic_ReadIfEqualWritePtr(histoPtr, NULL, (void *) ptr); if (before) { MXUserHistoTearDown(ptr); } } } /* *----------------------------------------------------------------------------- * * MXUserForceAcquisitionHisto -- * * Force acquisition histogram taking. * * Results: * As above. * * Side effects: * Memory is allocated. * *----------------------------------------------------------------------------- */ Bool MXUserForceAcquisitionHisto(Atomic_Ptr *mem, // IN/OUT: uint64 minValue, // IN: uint32 decades) // IN: { MXUserAcquireStats *acquireStats = Atomic_ReadPtr(mem); if (LIKELY(acquireStats != NULL)) { MXUserForceHisto(&acquireStats->histo, MXUSER_STAT_CLASS_ACQUISITION, minValue, decades); } return (acquireStats != NULL); } /* *----------------------------------------------------------------------------- * * MXUserForceHeldHisto -- * * Force held histogram taking. * * Results: * As above. * * Side effects: * Memory is allocated. * *----------------------------------------------------------------------------- */ Bool MXUserForceHeldHisto(Atomic_Ptr *mem, // IN/OUT: uint64 minValue, // IN: uint32 decades) // IN: { MXUserHeldStats *heldStats = Atomic_ReadPtr(mem); if (LIKELY(heldStats != NULL)) { MXUserForceHisto(&heldStats->histo, MXUSER_STAT_CLASS_HELD, minValue, decades); } return (heldStats != NULL); } /* *----------------------------------------------------------------------------- * * MXUserStatsMode -- * * What's to be done with statistics? * * Results: * 0 Statistics are disabled * 1 Collect statistics without tracking held times * 2 Collect statistics with track held times * * Side effects: * None * *----------------------------------------------------------------------------- */ uint32 MXUserStatsMode(void) { if (vmx86_stats && (mxUserStatsFunc != NULL) && (mxUserMaxLineLength > 0)) { return mxUserTrackHeldTimes ? 2 : 1; } else { return 0; } } /* *----------------------------------------------------------------------------- * * MXUser_SetStatsFunc -- * * Establish statistics taking and reporting. This is done by registering * a statistics context, a reporting function and a maximum line length. * * A maxLineLength of zero (0) and/or a statsFunc of NULL will * disable/prevent statistics gathering. * * Results: * As above * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_SetStatsFunc(void *context, // IN: uint32 maxLineLength, // IN: Bool trackHeldTimes, // IN: void (*statsFunc)(void *context, // IN: const char *fmt, va_list ap)) { ASSERT(maxLineLength >= 1024); // assert a rational minimum free(mxUserHistoLine); mxUserHistoLine = Util_SafeMalloc(maxLineLength); mxUserStatsContext = context; mxUserMaxLineLength = maxLineLength; mxUserStatsFunc = statsFunc; mxUserTrackHeldTimes = trackHeldTimes; } /* *----------------------------------------------------------------------------- * * MXUser_PerLockData -- * * Perform the statistics logging duties. * * The dumping is done on active locks so the data is, at best, * approximate. This is OK for statistics builds since things should * be "close enough". * * This routine is called from within the statistics collection framework. * It is called, periodically, at the end of each statistical "epoch". * * Results: * Lots of statistics in statistics (obj/opt/stats) builds. * * Side effects: * The overhead of the statistics process may affect the timing of * events and expose bugs. Be prepared! * *----------------------------------------------------------------------------- */ void MXUser_PerLockData(void) { MXRecLock *listLock = MXUserInternalSingleton(&mxLockMemPtr); if (mxUserStatsFunc == NULL) { return; } if (listLock && MXRecLockTryAcquire(listLock)) { ListItem *entry; uint32 highestSerialNumber; static uint32 lastReportedSerialNumber = 0; highestSerialNumber = lastReportedSerialNumber; LIST_SCAN(entry, mxUserLockList) { MXUserHeader *header = LIST_CONTAINER(entry, MXUserHeader, item); /* Log the ID information for a lock that did exist previously */ if (header->bits.serialNumber > lastReportedSerialNumber) { MXUserStatsLog("MXUser: n n=%s l=%d r=0x%x\n", header->name, header->bits.serialNumber, header->rank); if (header->bits.serialNumber > highestSerialNumber) { highestSerialNumber = header->bits.serialNumber; } } /* * Perform the statistics action for any lock that has one. */ if (header->statsFunc) { (*header->statsFunc)(header); } } lastReportedSerialNumber = highestSerialNumber; MXRecLockRelease(listLock); } } /* *----------------------------------------------------------------------------- * * MXUserAllocSerialNumber -- * * Allocate and return an MXUser serial number. * * MXUser serial numbers are never recycled. * * Results: * As above. * * Side effects: * Panic if too many serial numbers are generated (PR 1309544). * *----------------------------------------------------------------------------- */ uint32 MXUserAllocSerialNumber(void) { uint32 value; static Atomic_uint32 firstFreeSerialNumber = { 1 }; // must start not zero value = Atomic_ReadInc32(&firstFreeSerialNumber); /* * The serial number must be able to fit into the serial number field * (see ulInt.h). */ if (value > 0xFFFFFF) { Panic("%s: too many locks!\n", __FUNCTION__); } return value; } /* *----------------------------------------------------------------------------- * * MXUserSetContentionRatioFloor * * Set acquisition tracking contention ratio floor. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUserSetContentionRatioFloor(Atomic_Ptr *mem, // IN/OUT: double ratio) // IN: { MXUserAcquireStats *acquireStats = Atomic_ReadPtr(mem); if (LIKELY(acquireStats != NULL)) { acquireStats->data.contentionRatioFloor = ratio; } return (acquireStats != NULL); } /* *----------------------------------------------------------------------------- * * MXUserSetContentionCountFloor * * Set acquisition tracking contention count floor. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUserSetContentionCountFloor(Atomic_Ptr *mem, // IN/OUT: uint64 count) // IN: { MXUserAcquireStats *acquireStats = Atomic_ReadPtr(mem); if (LIKELY(acquireStats != NULL)) { acquireStats->data.contentionCountFloor = count; } return (acquireStats != NULL); } /* *----------------------------------------------------------------------------- * * MXUserSetContentionDurationFloor * * Set acquisition tracking contention duration floor. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUserSetContentionDurationFloor(Atomic_Ptr *mem, // IN/OUT: uint64 count) // IN: { MXUserAcquireStats *acquireStats = Atomic_ReadPtr(mem); if (LIKELY(acquireStats != NULL)) { acquireStats->data.contentionDurationFloor = count; } return (acquireStats != NULL); } /* *----------------------------------------------------------------------------- * * MXUserDisableStats * * Disable any statisitics collection. This should only be used * immediately after a lock is created. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserDisableStats(Atomic_Ptr *acquisitionMem, // IN/OPT: Atomic_Ptr *heldMem) // IN/OPT: { if (acquisitionMem != NULL) { MXUserAcquireStats *acquireStats = Atomic_ReadPtr(acquisitionMem); if (UNLIKELY(acquireStats != NULL)) { MXUserAcquisitionStatsTearDown(&acquireStats->data); MXUserHistoTearDown(Atomic_ReadPtr(&acquireStats->histo)); free(acquireStats); } Atomic_WritePtr(acquisitionMem, NULL); } if (heldMem != NULL) { MXUserHeldStats *heldStats = Atomic_ReadPtr(heldMem); if (UNLIKELY(heldStats != NULL)) { MXUserBasicStatsTearDown(&heldStats->data); MXUserHistoTearDown(Atomic_ReadPtr(&heldStats->histo)); free(heldStats); } Atomic_WritePtr(heldMem, NULL); } } /* *----------------------------------------------------------------------------- * * MXUserEnableStats * * Enable statisitics collection * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserEnableStats(Atomic_Ptr *acquisitionMem, // IN/OPT: Atomic_Ptr *heldMem) // IN/OPT: { if (acquisitionMem != NULL) { MXUserAcquireStats *acquireStats = Atomic_ReadPtr(acquisitionMem); if (LIKELY(acquireStats == NULL)) { MXUserAcquireStats *before; acquireStats = Util_SafeCalloc(1, sizeof *acquireStats); MXUserAcquisitionStatsSetUp(&acquireStats->data); before = Atomic_ReadIfEqualWritePtr(acquisitionMem, NULL, (void *) acquireStats); if (before) { free(acquireStats); } } } if (heldMem != NULL) { MXUserHeldStats *heldStats = Atomic_ReadPtr(heldMem); if (LIKELY(heldStats == NULL)) { MXUserHeldStats *before; heldStats = Util_SafeCalloc(1, sizeof *heldStats); MXUserBasicStatsSetUp(&heldStats->data, MXUSER_STAT_CLASS_HELD); before = Atomic_ReadIfEqualWritePtr(heldMem, NULL, (void *) heldStats); if (before) { free(heldStats); } } } } open-vm-tools-10.0.7-3227872/lib/lock/ulRW.c0000644000000000000000000005656412660700526016427 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #if defined(_WIN32) #include #endif #include "vmware.h" #include "vm_basic_asm.h" #include "str.h" #include "util.h" #include "hashTable.h" #include "userlock.h" #include "hostinfo.h" #include "ulInt.h" /* * Environment specific implementations of portable read-write locks. * * There are 5 environment specific primitives: * * MXUserNativeRWSupported Are native read-write locks supported? * MXUserNativeRWInit Allocate and initialize a native read-write lock * MXUserNativeRWDestroy Destroy a native read-write lock * MXUserNativeRWAcquire Acquire a native read-write lock * MXUserNativeRWRelease Release a native read-write lock */ #if defined(_WIN32) typedef SRWLOCK NativeRWLock; typedef VOID (WINAPI *InitializeSRWLockFn)(PSRWLOCK lock); typedef VOID (WINAPI *AcquireSRWLockSharedFn)(PSRWLOCK lock); typedef VOID (WINAPI *ReleaseSRWLockSharedFn)(PSRWLOCK lock); typedef VOID (WINAPI *AcquireSRWLockExclusiveFn)(PSRWLOCK lock); typedef VOID (WINAPI *ReleaseSRWLockExclusiveFn)(PSRWLOCK lock); static InitializeSRWLockFn pInitializeSRWLock; static AcquireSRWLockSharedFn pAcquireSRWLockShared; static ReleaseSRWLockSharedFn pReleaseSRWLockShared; static AcquireSRWLockExclusiveFn pAcquireSRWLockExclusive; static ReleaseSRWLockExclusiveFn pReleaseSRWLockExclusive; static Bool MXUserNativeRWSupported(void) { static Bool result; static Bool done = FALSE; if (!done) { HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); if (kernel32) { pInitializeSRWLock = (InitializeSRWLockFn) GetProcAddress(kernel32, "InitializeSRWLock"); pAcquireSRWLockShared = (AcquireSRWLockSharedFn) GetProcAddress(kernel32, "AcquireSRWLockShared"); pReleaseSRWLockShared = (ReleaseSRWLockSharedFn) GetProcAddress(kernel32, "ReleaseSRWLockShared"); pAcquireSRWLockExclusive = (AcquireSRWLockExclusiveFn) GetProcAddress(kernel32, "AcquireSRWLockExclusive"); pReleaseSRWLockExclusive = (ReleaseSRWLockExclusiveFn) GetProcAddress(kernel32, "ReleaseSRWLockExclusive"); COMPILER_MEM_BARRIER(); result = ((pInitializeSRWLock != NULL) && (pAcquireSRWLockShared != NULL) && (pReleaseSRWLockShared != NULL) && (pAcquireSRWLockExclusive != NULL) && (pReleaseSRWLockExclusive != NULL)); COMPILER_MEM_BARRIER(); } else { result = FALSE; } done = TRUE; } return result; } static Bool MXUserNativeRWInit(NativeRWLock *lock) // IN: { ASSERT(pInitializeSRWLock); (*pInitializeSRWLock)(lock); return TRUE; } static int MXUserNativeRWDestroy(NativeRWLock *lock) // IN: { return 0; // nothing to do } static INLINE Bool MXUserNativeRWAcquire(NativeRWLock *lock, // IN: Bool forRead, // IN: int *err) // OUT: { if (forRead) { ASSERT(pAcquireSRWLockShared); (*pAcquireSRWLockShared)(lock); } else { ASSERT(pAcquireSRWLockExclusive); (*pAcquireSRWLockExclusive)(lock); } *err = 0; return FALSE; } static INLINE int MXUserNativeRWRelease(NativeRWLock *lock, // IN: Bool forRead) // IN: { if (forRead) { ASSERT(pReleaseSRWLockShared); (*pReleaseSRWLockShared)(lock); } else { ASSERT(pReleaseSRWLockExclusive); (*pReleaseSRWLockExclusive)(lock); } return 0; } #else // _WIN32 #if defined(PTHREAD_RWLOCK_INITIALIZER) typedef pthread_rwlock_t NativeRWLock; #else typedef int NativeRWLock; #endif static Bool MXUserNativeRWSupported(void) { #if defined(PTHREAD_RWLOCK_INITIALIZER) return TRUE; #else return FALSE; #endif } static Bool MXUserNativeRWInit(NativeRWLock *lock) // IN: { #if defined(PTHREAD_RWLOCK_INITIALIZER) return (pthread_rwlock_init(lock, NULL) == 0); #else return FALSE; #endif } static int MXUserNativeRWDestroy(NativeRWLock *lock) // IN: { #if defined(PTHREAD_RWLOCK_INITIALIZER) return pthread_rwlock_destroy(lock); #else return ENOSYS; #endif } static INLINE Bool MXUserNativeRWAcquire(NativeRWLock *lock, // IN: Bool forRead, // IN: int *err) // OUT: { Bool contended; #if defined(PTHREAD_RWLOCK_INITIALIZER) *err = (forRead) ? pthread_rwlock_tryrdlock(lock) : pthread_rwlock_trywrlock(lock); contended = (*err != 0); if (*err == EBUSY) { *err = (forRead) ? pthread_rwlock_rdlock(lock) : pthread_rwlock_wrlock(lock); } #else *err = ENOSYS; contended = FALSE; #endif return contended; } static INLINE int MXUserNativeRWRelease(NativeRWLock *lock, // IN: Bool forRead) // IN: { #if defined(PTHREAD_RWLOCK_INITIALIZER) return pthread_rwlock_unlock(lock); #else return ENOSYS; #endif } #endif // _WIN32 typedef enum { RW_UNLOCKED, RW_LOCKED_FOR_READ, RW_LOCKED_FOR_WRITE } HolderState; typedef struct { HolderState state; VmTimeType holdStart; } HolderContext; struct MXUserRWLock { MXUserHeader header; Bool useNative; NativeRWLock nativeLock; MXRecLock recursiveLock; Atomic_uint32 holderCount; HashTable *holderTable; Atomic_Ptr heldStatsMem; Atomic_Ptr acquireStatsMem; }; /* *----------------------------------------------------------------------------- * * MXUserStatsActionRW -- * * Perform the statistics action for the specified lock. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserStatsActionRW(MXUserHeader *header) // IN: { MXUserRWLock *lock = (MXUserRWLock *) header; MXUserHeldStats *heldStats = Atomic_ReadPtr(&lock->heldStatsMem); MXUserAcquireStats *acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); if (heldStats) { MXUserDumpBasicStats(&heldStats->data, header); if (Atomic_ReadPtr(&heldStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&heldStats->histo), header); } } if (acquireStats) { Bool isHot; Bool doLog; double contentionRatio; /* * Dump the statistics for the specified lock. */ MXUserDumpAcquisitionStats(&acquireStats->data, header); if (Atomic_ReadPtr(&acquireStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&acquireStats->histo), header); } /* * Has the lock gone "hot"? If so, implement the hot actions. */ MXUserKitchen(&acquireStats->data, &contentionRatio, &isHot, &doLog); if (isHot) { MXUserForceAcquisitionHisto(&lock->acquireStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); if (heldStats) { MXUserForceHeldHisto(&lock->heldStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); } if (doLog) { Log("HOT LOCK (%s); contention ratio %f\n", lock->header.name, contentionRatio); } } } } /* *----------------------------------------------------------------------------- * * MXUserDumpRWLock -- * * Dump an read-write lock. * * Results: * A dump. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserDumpRWLock(MXUserHeader *header) // IN: { MXUserRWLock *lock = (MXUserRWLock *) header; Warning("%s: Read-write lock @ 0x%p\n", __FUNCTION__, lock); Warning("\tsignature 0x%X\n", lock->header.signature); Warning("\tname %s\n", lock->header.name); Warning("\trank 0x%X\n", lock->header.rank); Warning("\tserial number %u\n", lock->header.bits.serialNumber); if (LIKELY(lock->useNative)) { Warning("\taddress of native lock 0x%p\n", &lock->nativeLock); } else { Warning("\tcount %d\n", MXRecLockCount(&lock->recursiveLock)); } Warning("\tholderCount %d\n", Atomic_Read(&lock->holderCount)); } /* *----------------------------------------------------------------------------- * * MXUser_CreateRWLock -- * * Create a read/write lock. * * If native read-write locks are not available, a recursive lock will * be used to provide one reader or one writer access... which is * better than nothing. * * Results: * A pointer to a read/write lock. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserFreeHashEntry(void *data) // IN: { free(data); } MXUserRWLock * MXUser_CreateRWLock(const char *userName, // IN: MX_Rank rank) // IN: { Bool lockInited; char *properName; Bool useNative = MXUserNativeRWSupported(); MXUserRWLock *lock = Util_SafeCalloc(1, sizeof *lock); if (userName == NULL) { if (LIKELY(useNative)) { properName = Str_SafeAsprintf(NULL, "RW-%p", GetReturnAddress()); } else { /* emulated */ properName = Str_SafeAsprintf(NULL, "RWemul-%p", GetReturnAddress()); } } else { properName = Util_SafeStrdup(userName); } lock->header.signature = MXUserGetSignature(MXUSER_TYPE_RW); lock->header.name = properName; lock->header.rank = rank; lock->header.bits.serialNumber = MXUserAllocSerialNumber(); lock->header.dumpFunc = MXUserDumpRWLock; /* * Always attempt to use native locks when they are available. If, for some * reason, a native lock should be available but isn't, fall back to using * an internal recursive lock - something is better than nothing. */ lock->useNative = useNative && MXUserNativeRWInit(&lock->nativeLock); lockInited = MXRecLockInit(&lock->recursiveLock); if (LIKELY(lockInited)) { uint32 statsMode; lock->holderTable = HashTable_Alloc(256, HASH_INT_KEY | HASH_FLAG_ATOMIC, MXUserFreeHashEntry); statsMode = MXUserStatsMode(); switch (MXUserStatsMode()) { case 0: MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); lock->header.statsFunc = NULL; break; case 1: MXUserEnableStats(&lock->acquireStatsMem, NULL); lock->header.statsFunc = MXUserStatsActionRW; break; case 2: MXUserEnableStats(&lock->acquireStatsMem, &lock->heldStatsMem); lock->header.statsFunc = MXUserStatsActionRW; break; default: Panic("%s: unknown stats mode: %d!\n", __FUNCTION__, statsMode); } MXUserAddToList(&lock->header); } else { if (lock->useNative) { MXUserNativeRWDestroy(&lock->nativeLock); } free(properName); free(lock); lock = NULL; } return lock; } /* *----------------------------------------------------------------------------- * * MXUser_DestroyRWLock -- * * Destroy a read-write lock. * * Results: * The lock is destroyed. Don't try to use the pointer again. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_DestroyRWLock(MXUserRWLock *lock) // IN: { if (LIKELY(lock != NULL)) { MXUserValidateHeader(&lock->header, MXUSER_TYPE_RW); if (Atomic_Read(&lock->holderCount) != 0) { MXUserDumpAndPanic(&lock->header, "%s: Destroy on an acquired read-write lock\n", __FUNCTION__); } if (LIKELY(lock->useNative)) { int err = MXUserNativeRWDestroy(&lock->nativeLock); if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&lock->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } } MXRecLockDestroy(&lock->recursiveLock); MXUserRemoveFromList(&lock->header); if (vmx86_stats) { MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); } HashTable_FreeUnsafe(lock->holderTable); lock->header.signature = 0; // just in case... free(lock->header.name); lock->header.name = NULL; free(lock); } } /* *----------------------------------------------------------------------------- * * MXUserGetHolderContext -- * * Look up the context of the calling thread with respect to the * specified lock and return it. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static HolderContext * MXUserGetHolderContext(MXUserRWLock *lock) // IN: { HolderContext *result; void *threadID = MXUserCastedThreadID(); ASSERT(lock->holderTable); if (!HashTable_Lookup(lock->holderTable, threadID, (void **) &result)) { HolderContext *newContext = Util_SafeMalloc(sizeof *newContext); newContext->holdStart = 0; newContext->state = RW_UNLOCKED; result = HashTable_LookupOrInsert(lock->holderTable, threadID, (void *) newContext); if (result != newContext) { free(newContext); } } return result; } /* *----------------------------------------------------------------------------- * * MXUserAcquisition -- * * Acquire a read-write lock in the specified mode. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void MXUserAcquisition(MXUserRWLock *lock, // IN/OUT: Bool forRead) // IN: { HolderContext *myContext; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_RW); MXUserAcquisitionTracking(&lock->header, TRUE); myContext = MXUserGetHolderContext(lock); if (UNLIKELY(myContext->state != RW_UNLOCKED)) { MXUserDumpAndPanic(&lock->header, "%s: AcquireFor%s after AcquireFor%s\n", __FUNCTION__, forRead ? "Read" : "Write", (myContext->state == RW_LOCKED_FOR_READ) ? "Read" : "Write"); } if (vmx86_stats) { VmTimeType value; MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); if (lock->useNative) { int err = 0; Bool contended; VmTimeType begin = Hostinfo_SystemTimerNS(); contended = MXUserNativeRWAcquire(&lock->nativeLock, forRead, &err); value = contended ? Hostinfo_SystemTimerNS() - begin : 0; if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&lock->header, "%s: Error %d: contended %d\n", __FUNCTION__, err, contended); } } else { value = 0; MXRecLockAcquire(&lock->recursiveLock, (acquireStats == NULL) ? NULL : &value); } if (LIKELY(acquireStats != NULL)) { MXUserHisto *histo; MXUserHeldStats *heldStats; /* * The statistics are not atomically safe so protect them when * necessary. */ if (forRead && lock->useNative) { MXRecLockAcquire(&lock->recursiveLock, NULL); // non-stats } MXUserAcquisitionSample(&acquireStats->data, TRUE, value > acquireStats->data.contentionDurationFloor, value); histo = Atomic_ReadPtr(&acquireStats->histo); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } if (forRead && lock->useNative) { MXRecLockRelease(&lock->recursiveLock); } heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (UNLIKELY(heldStats != NULL)) { myContext->holdStart = Hostinfo_SystemTimerNS(); } } } else { if (LIKELY(lock->useNative)) { int err = 0; MXUserNativeRWAcquire(&lock->nativeLock, forRead, &err); if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&lock->header, "%s: Error %d\n", __FUNCTION__, err); } } else { MXRecLockAcquire(&lock->recursiveLock, NULL); // non-stats } } if (!forRead || !lock->useNative) { ASSERT(Atomic_Read(&lock->holderCount) == 0); } Atomic_Inc(&lock->holderCount); myContext->state = forRead ? RW_LOCKED_FOR_READ : RW_LOCKED_FOR_WRITE; } /* *----------------------------------------------------------------------------- * * MXUser_AcquireForRead -- * * Acquire a read-write lock for read-shared access. A thread may have * only one read lock outstanding on a read-write lock - no recursive * access. * * Results: * The lock is acquired. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_AcquireForRead(MXUserRWLock *lock) // IN/OUT: { MXUserAcquisition(lock, TRUE); } /* *----------------------------------------------------------------------------- * * MXUser_AcquireForWrite -- * * Acquire a read-write lock for write-exclusive access. A thread may * have only a single write lock outstanding on a read-write lock. * * Results: * The lock is acquired. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_AcquireForWrite(MXUserRWLock *lock) // IN/OUT: { MXUserAcquisition(lock, FALSE); } /* *----------------------------------------------------------------------------- * * MXUser_IsCurThreadHolding -- * * Is the read-write lock held in the mode queried? * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_IsCurThreadHoldingRWLock(MXUserRWLock *lock, // IN: uint32 queryType) // IN: { HolderContext *myContext; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_RW); myContext = MXUserGetHolderContext(lock); switch (queryType) { case MXUSER_RW_FOR_READ: return myContext->state == RW_LOCKED_FOR_READ; case MXUSER_RW_FOR_WRITE: return myContext->state == RW_LOCKED_FOR_WRITE; case MXUSER_RW_LOCKED: return myContext->state != RW_UNLOCKED; default: Panic("%s: unknown query type %d\n", __FUNCTION__, queryType); } } /* *----------------------------------------------------------------------------- * * MXUser_ReleaseRWLock -- * * A read-write lock is released (unlocked). * * Results: * The lock is released (unlocked). * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_ReleaseRWLock(MXUserRWLock *lock) // IN/OUT: { HolderContext *myContext; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_RW); myContext = MXUserGetHolderContext(lock); if (vmx86_stats) { MXUserHeldStats *heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (UNLIKELY(heldStats != NULL)) { MXUserHisto *histo; VmTimeType duration = Hostinfo_SystemTimerNS() - myContext->holdStart; /* * The statistics are not always atomically safe so protect them * when necessary */ if ((myContext->state == RW_LOCKED_FOR_READ) && lock->useNative) { MXRecLockAcquire(&lock->recursiveLock, NULL); // non-stats } MXUserBasicStatsSample(&heldStats->data, duration); histo = Atomic_ReadPtr(&heldStats->histo); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, duration, GetReturnAddress()); } if ((myContext->state == RW_LOCKED_FOR_READ) && lock->useNative) { MXRecLockRelease(&lock->recursiveLock); } } } if (UNLIKELY(myContext->state == RW_UNLOCKED)) { MXUserDumpAndPanic(&lock->header, "%s: Release of an unacquired read-write lock\n", __FUNCTION__); } MXUserReleaseTracking(&lock->header); Atomic_Dec(&lock->holderCount); if (LIKELY(lock->useNative)) { int err = MXUserNativeRWRelease(&lock->nativeLock, myContext->state == RW_LOCKED_FOR_READ); if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&lock->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } } else { ASSERT(Atomic_Read(&lock->holderCount) == 0); MXRecLockRelease(&lock->recursiveLock); } myContext->state = RW_UNLOCKED; } /* *----------------------------------------------------------------------------- * * MXUser_CreateSingletonRWLock -- * * Ensures that the specified backing object (Atomic_Ptr) contains a * RW lock. This is useful for modules that need to protect something * with a lock but don't have an existing Init() entry point where a * lock can be created. * * Results: * A pointer to the requested lock. * * Side effects: * Generally the lock's resources are intentionally leaked (by design). * *----------------------------------------------------------------------------- */ MXUserRWLock * MXUser_CreateSingletonRWLock(Atomic_Ptr *lockStorage, // IN/OUT: const char *name, // IN: MX_Rank rank) // IN: { MXUserRWLock *lock; ASSERT(lockStorage); lock = Atomic_ReadPtr(lockStorage); if (UNLIKELY(lock == NULL)) { MXUserRWLock *newLock = MXUser_CreateRWLock(name, rank); lock = Atomic_ReadIfEqualWritePtr(lockStorage, NULL, (void *) newLock); if (lock) { MXUser_DestroyRWLock(newLock); } else { lock = Atomic_ReadPtr(lockStorage); } } return lock; } open-vm-tools-10.0.7-3227872/lib/lock/ulExcl.c0000644000000000000000000004666612660700526016774 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include "vmware.h" #include "str.h" #include "util.h" #include "userlock.h" #include "hostinfo.h" #include "ulInt.h" struct MXUserExclLock { MXUserHeader header; MXRecLock recursiveLock; Atomic_Ptr heldStatsMem; Atomic_Ptr acquireStatsMem; }; /* *----------------------------------------------------------------------------- * * MXUserStatsActionExcl -- * * Perform the statistics action for the specified lock. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserStatsActionExcl(MXUserHeader *header) // IN: { MXUserExclLock *lock = (MXUserExclLock *) header; MXUserHeldStats *heldStats = Atomic_ReadPtr(&lock->heldStatsMem); MXUserAcquireStats *acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); if (UNLIKELY(heldStats != NULL)) { MXUserDumpBasicStats(&heldStats->data, header); if (Atomic_ReadPtr(&heldStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&heldStats->histo), header); } } if (LIKELY(acquireStats != NULL)) { Bool isHot; Bool doLog; double contentionRatio; /* * Dump the statistics for the specified lock. */ MXUserDumpAcquisitionStats(&acquireStats->data, header); if (Atomic_ReadPtr(&acquireStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&acquireStats->histo), header); } /* * Has the lock gone "hot"? If so, implement the hot actions. */ MXUserKitchen(&acquireStats->data, &contentionRatio, &isHot, &doLog); if (UNLIKELY(isHot)) { MXUserForceAcquisitionHisto(&lock->acquireStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); if (UNLIKELY(heldStats != NULL)) { MXUserForceHeldHisto(&lock->heldStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); } if (doLog) { Log("HOT LOCK (%s); contention ratio %f\n", lock->header.name, contentionRatio); } } } } /* *----------------------------------------------------------------------------- * * MXUser_EnableStatsExclLock * * Enable basic stats on the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_EnableStatsExclLock(MXUserExclLock *lock, // IN/OUT: Bool trackAcquisitionTime, // IN: Bool trackHeldTime) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (vmx86_stats) { MXUserEnableStats(trackAcquisitionTime ? &lock->acquireStatsMem : NULL, trackHeldTime ? &lock->heldStatsMem : NULL); } return vmx86_stats; } /* *----------------------------------------------------------------------------- * * MXUser_DisableStatsExclLock -- * * Disable basic stats on the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_DisableStatsExclLock(MXUserExclLock *lock) // IN/OUT: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (vmx86_stats) { MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); } return vmx86_stats; } /* *----------------------------------------------------------------------------- * * MXUser_SetContentionRatioFloorExclLock -- * * Set the contention ratio floor for the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_SetContentionRatioFloorExclLock(MXUserExclLock *lock, // IN/OUT: double ratio) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (vmx86_stats) { result = MXUserSetContentionRatioFloor(&lock->acquireStatsMem, ratio); } else { result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * MXUser_SetContentionCountFloorExclLock -- * * Set the contention count floor for the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_SetContentionCountFloorExclLock(MXUserExclLock *lock, // IN/OUT: uint64 count) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (vmx86_stats) { result = MXUserSetContentionCountFloor(&lock->acquireStatsMem, count); } else { result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * MXUser_SetContentionDurationFloorExclLock -- * * Set the contention count floor for the specified lock. * * Results: * TRUE succeeded * FALSE failed * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_SetContentionDurationFloorExclLock(MXUserExclLock *lock, // IN/OUT: uint64 duration) // IN: { Bool result; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (vmx86_stats) { result = MXUserSetContentionDurationFloor(&lock->acquireStatsMem, duration); } else { result = FALSE; } return result; } /* *----------------------------------------------------------------------------- * * MXUserDumpExclLock -- * * Dump an exclusive lock. * * Results: * A dump. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserDumpExclLock(MXUserHeader *header) // IN: { MXUserExclLock *lock = (MXUserExclLock *) header; Warning("%s: Exclusive lock @ %p\n", __FUNCTION__, lock); Warning("\tsignature 0x%X\n", lock->header.signature); Warning("\tname %s\n", lock->header.name); Warning("\trank 0x%X\n", lock->header.rank); Warning("\tserial number %u\n", lock->header.bits.serialNumber); Warning("\tlock count %d\n", MXRecLockCount(&lock->recursiveLock)); Warning("\taddress of owner data %p\n", &lock->recursiveLock.nativeThreadID); } /* *----------------------------------------------------------------------------- * * MXUser_CreateExclLock -- * * Create an exclusive lock. * * Results: * NULL Creation failed * !NULL Creation succeeded * * Side effects: * None * *----------------------------------------------------------------------------- */ MXUserExclLock * MXUser_CreateExclLock(const char *userName, // IN: MX_Rank rank) // IN: { uint32 statsMode; char *properName; MXUserExclLock *lock = Util_SafeCalloc(1, sizeof *lock); if (userName == NULL) { properName = Str_SafeAsprintf(NULL, "X-%p", GetReturnAddress()); } else { properName = Util_SafeStrdup(userName); } if (!MXRecLockInit(&lock->recursiveLock)) { free(properName); free(lock); return NULL; } lock->header.signature = MXUserGetSignature(MXUSER_TYPE_EXCL); lock->header.name = properName; lock->header.rank = rank; lock->header.bits.serialNumber = MXUserAllocSerialNumber(); lock->header.dumpFunc = MXUserDumpExclLock; statsMode = MXUserStatsMode(); switch (MXUserStatsMode()) { case 0: MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); lock->header.statsFunc = NULL; break; case 1: MXUserEnableStats(&lock->acquireStatsMem, NULL); lock->header.statsFunc = MXUserStatsActionExcl; break; case 2: MXUserEnableStats(&lock->acquireStatsMem, &lock->heldStatsMem); lock->header.statsFunc = MXUserStatsActionExcl; break; default: Panic("%s: unknown stats mode: %d!\n", __FUNCTION__, statsMode); } MXUserAddToList(&lock->header); return lock; } /* *----------------------------------------------------------------------------- * * MXUser_DestroyExclLock -- * * Destroy an exclusive lock. * * Results: * Lock is destroyed. Don't use the pointer again. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_DestroyExclLock(MXUserExclLock *lock) // IN: { if (lock != NULL) { MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (MXRecLockCount(&lock->recursiveLock) > 0) { MXUserDumpAndPanic(&lock->header, "%s: Destroy of an acquired exclusive lock\n", __FUNCTION__); } MXRecLockDestroy(&lock->recursiveLock); MXUserRemoveFromList(&lock->header); if (vmx86_stats) { MXUserDisableStats(&lock->acquireStatsMem, &lock->heldStatsMem); } lock->header.signature = 0; // just in case... free(lock->header.name); lock->header.name = NULL; free(lock); } } /* *----------------------------------------------------------------------------- * * MXUser_AcquireExclLock -- * * An acquisition is made (lock is taken) on the specified exclusive lock. * * Results: * The lock is acquired (locked). * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_AcquireExclLock(MXUserExclLock *lock) // IN/OUT: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); MXUserAcquisitionTracking(&lock->header, TRUE); if (vmx86_stats) { VmTimeType value = 0; MXUserHeldStats *heldStats; MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); MXRecLockAcquire(&lock->recursiveLock, (acquireStats == NULL) ? NULL : &value); if (LIKELY(acquireStats != NULL)) { MXUserHisto *histo; MXUserAcquisitionSample(&acquireStats->data, TRUE, value > acquireStats->data.contentionDurationFloor, value); histo = Atomic_ReadPtr(&acquireStats->histo); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (UNLIKELY(heldStats != NULL)) { heldStats->holdStart = Hostinfo_SystemTimerNS(); } } } else { MXRecLockAcquire(&lock->recursiveLock, NULL); // non-stats } if (vmx86_debug && (MXRecLockCount(&lock->recursiveLock) > 1)) { MXUserDumpAndPanic(&lock->header, "%s: Acquire on an acquired exclusive lock\n", __FUNCTION__); } } /* *----------------------------------------------------------------------------- * * MXUser_ReleaseExclLock -- * * Release (unlock) an exclusive lock. * * Results: * The lock is released. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_ReleaseExclLock(MXUserExclLock *lock) // IN/OUT: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (vmx86_stats) { MXUserHeldStats *heldStats = Atomic_ReadPtr(&lock->heldStatsMem); if (UNLIKELY(heldStats != NULL)) { VmTimeType value = Hostinfo_SystemTimerNS() - heldStats->holdStart; MXUserHisto *histo = Atomic_ReadPtr(&heldStats->histo); MXUserBasicStatsSample(&heldStats->data, value); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } } } if (vmx86_debug) { if (MXRecLockCount(&lock->recursiveLock) == 0) { MXUserDumpAndPanic(&lock->header, "%s: Release of an unacquired exclusive lock\n", __FUNCTION__); } if (!MXRecLockIsOwner(&lock->recursiveLock)) { MXUserDumpAndPanic(&lock->header, "%s: Non-owner release of a exclusive lock\n", __FUNCTION__); } } MXUserReleaseTracking(&lock->header); MXRecLockRelease(&lock->recursiveLock); } /* *----------------------------------------------------------------------------- * * MXUser_TryAcquireExclLock -- * * An attempt is made to conditionally acquire (lock) an exclusive lock. * * Results: * TRUE Acquired (locked) * FALSE Not acquired * * Side effects: * None * * NOTE: * A "TryAcquire" does not rank check should the acquisition succeed. * This duplicates the behavor of MX locks. * *----------------------------------------------------------------------------- */ Bool MXUser_TryAcquireExclLock(MXUserExclLock *lock) // IN/OUT: { Bool success; ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); if (MXUserTryAcquireFail(lock->header.name)) { return FALSE; } success = MXRecLockTryAcquire(&lock->recursiveLock); if (success) { MXUserAcquisitionTracking(&lock->header, FALSE); if (vmx86_debug && (MXRecLockCount(&lock->recursiveLock) > 1)) { MXUserDumpAndPanic(&lock->header, "%s: Acquire on an acquired exclusive lock\n", __FUNCTION__); } } if (vmx86_stats) { MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&lock->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { MXUserAcquisitionSample(&acquireStats->data, success, !success, 0ULL); } } return success; } /* *----------------------------------------------------------------------------- * * MXUser_IsCurThreadHoldingExclLock -- * * Is an exclusive lock held by the calling thread? * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool MXUser_IsCurThreadHoldingExclLock(MXUserExclLock *lock) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); return MXRecLockIsOwner(&lock->recursiveLock); } /* *----------------------------------------------------------------------------- * * MXUser_CreateSingletonExclLock -- * * Ensures that the specified backing object (Atomic_Ptr) contains a * exclusive lock. This is useful for modules that need to protect * something with a lock but don't have an existing Init() entry point * where a lock can be created. * * Results: * A pointer to the requested lock. * * Side effects: * Generally the lock's resources are intentionally leaked (by design). * *----------------------------------------------------------------------------- */ MXUserExclLock * MXUser_CreateSingletonExclLock(Atomic_Ptr *lockStorage, // IN/OUT: const char *name, // IN: MX_Rank rank) // IN: { MXUserExclLock *lock; ASSERT(lockStorage); lock = Atomic_ReadPtr(lockStorage); if (UNLIKELY(lock == NULL)) { MXUserExclLock *newLock = MXUser_CreateExclLock(name, rank); lock = Atomic_ReadIfEqualWritePtr(lockStorage, NULL, (void *) newLock); if (lock) { MXUser_DestroyExclLock(newLock); } else { lock = Atomic_ReadPtr(lockStorage); } } return lock; } /* *----------------------------------------------------------------------------- * * MXUser_CreateCondVarExclLock -- * * Create a condition variable for use with the specified exclusive lock. * * Results: * As above. * * Side effects: * The created condition variable will cause a run-time error if it is * used with a lock other than the one it was created for. * *----------------------------------------------------------------------------- */ MXUserCondVar * MXUser_CreateCondVarExclLock(MXUserExclLock *lock) { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); return MXUserCreateCondVar(&lock->header, &lock->recursiveLock); } /* *----------------------------------------------------------------------------- * * MXUser_WaitCondVarExclLock -- * * Block (sleep) on the specified condition variable. The specified lock * is released upon blocking and is reacquired before returning from this * function. * * Results: * As above. * * Side effects: * It is possible to return from this routine without the condtion * variable having been signalled (spurious wake up); code accordingly! * *----------------------------------------------------------------------------- */ void MXUser_WaitCondVarExclLock(MXUserExclLock *lock, // IN: MXUserCondVar *condVar) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); MXUserWaitCondVar(&lock->header, &lock->recursiveLock, condVar, MXUSER_WAIT_INFINITE); } /* *----------------------------------------------------------------------------- * * MXUser_TimedWaitCondVarExclLock -- * * Block (sleep) on the specified condition variable for no longer than * the specified amount of time. The specified lock is released upon * blocking and is reacquired before returning from this function. * * Results: * As above * * Side effects: * It is possible to return from this routine without the condtion * variable having been signalled (spurious wake up); code accordingly! * *----------------------------------------------------------------------------- */ void MXUser_TimedWaitCondVarExclLock(MXUserExclLock *lock, // IN: MXUserCondVar *condVar, // IN: uint32 msecWait) // IN: { ASSERT(lock); MXUserValidateHeader(&lock->header, MXUSER_TYPE_EXCL); MXUserWaitCondVar(&lock->header, &lock->recursiveLock, condVar, msecWait); } open-vm-tools-10.0.7-3227872/lib/lock/ulSema.c0000644000000000000000000005400612660700526016751 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #if defined(_WIN32) #include #else #if defined(__APPLE__) #include #else #if (_XOPEN_SOURCE < 600) && !defined(__FreeBSD__) && !defined(sun) #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #endif #include #include #endif #endif #include "vmware.h" #include "str.h" #include "util.h" #include "userlock.h" #include "ulInt.h" #include "hostinfo.h" #if defined(_WIN32) #include "win32u.h" #endif #define MXUSER_A_BILLION (1000 * 1000 * 1000) #if defined(_WIN32) typedef HANDLE NativeSemaphore; #else #if defined(__APPLE__) /* * The Mac OS implementation uses dispatch_semaphore_t instead of * semaphore_t due to better performance in the uncontended case, by * avoiding a system call. It, also, avoids weird error cases that * resulted in bug 916600. */ typedef dispatch_semaphore_t NativeSemaphore; #else typedef sem_t NativeSemaphore; #endif #endif struct MXUserSemaphore { MXUserHeader header; Atomic_uint32 activeUserCount; NativeSemaphore nativeSemaphore; Atomic_Ptr acquireStatsMem; }; /* *----------------------------------------------------------------------------- * * Environment specific implementations of portable semaphores. * * All of these functions return zero (0) for success and non-zero upon * failure. The non-zero value is a host specified error code. * * All down operations return a boolean which indicates if the down * operation actually occurred (the counting variable was decremented; * a sleep may have occurred). This boolean is valid regardless of the * value returned from the down functions. * * Timed operations always wait for the length of time specified. Should * the native system allow interruptions/signals, retries will be performed * until the specified amount of time has elapsed. * * There are 6 environment specific primitives: * * MXUserInit Initialize a native semaphore * MXUserDestroy Destroy a native semaphore * MXUserDown Perform a down (P) operation * MXUserTimedDown Perform a down (P) operation with a timeout * MXUserTryDown Perform a try down (P) operation * MXUserUp Perform an up (V) operation * *----------------------------------------------------------------------------- */ #if defined(_WIN32) static int MXUserInit(NativeSemaphore *sema) // OUT: { *sema = Win32U_CreateSemaphore(NULL, 0, INT_MAX, NULL); return (*sema == NULL) ? GetLastError() : 0; } static int MXUserDestroy(NativeSemaphore *sema) // IN: { return CloseHandle(*sema) ? 0 : GetLastError(); } static int MXUserTimedDown(NativeSemaphore *sema, // IN: uint32 msecWait, // IN: Bool *downOccurred) // OUT: { int err; DWORD status; status = WaitForSingleObject(*sema, msecWait); switch (status) { case WAIT_OBJECT_0: // The down (decrement) occurred *downOccurred = TRUE; err = 0; break; case WAIT_TIMEOUT: // Timed out; the down (decrement) did not occur *downOccurred = FALSE; err = 0; break; default: // Something really terrible has happened... Panic("%s: WaitForSingleObject return value %x\n", __FUNCTION__, status); } return err; } static int MXUserDown(NativeSemaphore *sema) // IN: { int err; Bool downOccurred; /* * Use an infinite timed wait to implement down. If the timed down * succeeds, assert that the down actually occurred. */ err = MXUserTimedDown(sema, INFINITE, &downOccurred); if (err == 0) { ASSERT(downOccurred); } return err; } static int MXUserTryDown(NativeSemaphore *sema, // IN: Bool *downOccurred) // OUT: { /* * Use a wait for zero time to implement the try operation. This timed * down will either succeed immediately (down occurred), fail (something * terrible happened) or time out immediately (the down could not be * performed and that is OK). */ return MXUserTimedDown(sema, 0, downOccurred); } static int MXUserUp(NativeSemaphore *sema) // IN: { return ReleaseSemaphore(*sema, 1, NULL) ? 0 : GetLastError(); } #elif defined(__APPLE__) static int MXUserInit(NativeSemaphore *sema) // OUT: { *sema = dispatch_semaphore_create(0); return *sema == NULL; } static int MXUserDestroy(NativeSemaphore *sema) // IN: { dispatch_release(*sema); return 0; } static int MXUserTimedDown(NativeSemaphore *sema, // IN: uint32 msecWait, // IN: Bool *downOccurred) // OUT: { int64 nsecWait = 1000000LL * (int64)msecWait; dispatch_time_t deadline = dispatch_time(DISPATCH_TIME_NOW, nsecWait); *downOccurred = dispatch_semaphore_wait(*sema, deadline) == 0; return 0; } static int MXUserDown(NativeSemaphore *sema) // IN: { dispatch_semaphore_wait(*sema, DISPATCH_TIME_FOREVER); return 0; } static int MXUserTryDown(NativeSemaphore *sema, // IN: Bool *downOccurred) // OUT: { /* * Provide 'try' semantics by requesting an immediate timeout. */ *downOccurred = dispatch_semaphore_wait(*sema, DISPATCH_TIME_NOW) == 0; return 0; } static int MXUserUp(NativeSemaphore *sema) // IN: { dispatch_semaphore_signal(*sema); return 0; } #else static int MXUserInit(NativeSemaphore *sema) // OUT: { return (sem_init(sema, 0, 0) == -1) ? errno : 0; } static int MXUserDestroy(NativeSemaphore *sema) // IN: { return (sem_destroy(sema) == -1) ? errno : 0; } static int MXUserDown(NativeSemaphore *sema) // IN: { int err; /* Retry any interruptions (EINTR) */ do { err = (sem_wait(sema) == -1) ? errno : 0; } while (err == EINTR); return err; } static int MXUserTimedDown(NativeSemaphore *sema, // IN: uint32 msecWait, // IN: Bool *downOccurred) // OUT: { int err; uint64 endNS; struct timeval curTime; struct timespec endTime; /* * sem_timedwait takes an absolute time. Yes, this is beyond ridiculous, * and the justifications for this vs. relative time makes no sense, but * it is what it is... */ gettimeofday(&curTime, NULL); endNS = ((uint64) curTime.tv_sec * MXUSER_A_BILLION) + ((uint64) curTime.tv_usec * 1000) + ((uint64) msecWait * (1000 * 1000)); endTime.tv_sec = (time_t) (endNS / MXUSER_A_BILLION); endTime.tv_nsec = (long int) (endNS % MXUSER_A_BILLION); do { err = (sem_timedwait(sema, &endTime) == -1) ? errno : 0; if (err == 0) { *downOccurred = TRUE; } else { *downOccurred = FALSE; /* Really timed out; no down occurred, no error */ if (err == ETIMEDOUT) { err = 0; } } } while (err == EINTR); return err; } static int MXUserTryDown(NativeSemaphore *sema, // IN: Bool *downOccurred) // OUT: { int err = (sem_trywait(sema) == -1) ? errno : 0; if (err == 0) { *downOccurred = TRUE; } else { *downOccurred = FALSE; /* * If the error that occurred indicates that the try operation cannot * succeed (EAGAIN) or was interrupted (EINTR) suppress the error * indicator as these are considered "normal", non-error cases. * * It's OK to not loop on EINTR here since this is a try operation. */ if ((err == EAGAIN) || (err == EINTR)) { err = 0; // no error } } return err; } static int MXUserUp(NativeSemaphore *sema) // IN: { return (sem_post(sema) == -1) ? errno : 0; } #endif // _WIN32 /* *----------------------------------------------------------------------------- * * MXUserStatsActionSema -- * * Perform the statistics action for the specified semaphore. * * Results: * As above. * * Side effects: * None * *----------------------------------------------------------------------------- */ static void MXUserStatsActionSema(MXUserHeader *header) // IN: { MXUserSemaphore *sema = (MXUserSemaphore *) header; MXUserAcquireStats *acquireStats = Atomic_ReadPtr(&sema->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { Bool isHot; Bool doLog; double contentionRatio; /* * Dump the statistics for the specified semaphore. */ MXUserDumpAcquisitionStats(&acquireStats->data, header); if (Atomic_ReadPtr(&acquireStats->histo) != NULL) { MXUserHistoDump(Atomic_ReadPtr(&acquireStats->histo), header); } /* * Has the semaphore gone "hot"? If so, implement the hot actions. */ MXUserKitchen(&acquireStats->data, &contentionRatio, &isHot, &doLog); if (isHot) { MXUserForceAcquisitionHisto(&sema->acquireStatsMem, MXUSER_DEFAULT_HISTO_MIN_VALUE_NS, MXUSER_DEFAULT_HISTO_DECADES); if (doLog) { Log("HOT SEMAPHORE (%s); contention ratio %f\n", sema->header.name, contentionRatio); } } } } /* *----------------------------------------------------------------------------- * * MXUserDumpSemaphore -- * * Dump a semaphore. * * Results: * A dump. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUserDumpSemaphore(MXUserHeader *header) // IN: { MXUserSemaphore *sema = (MXUserSemaphore *) header; Warning("%s: semaphore @ %p\n", __FUNCTION__, sema); Warning("\tsignature 0x%X\n", sema->header.signature); Warning("\tname %s\n", sema->header.name); Warning("\trank 0x%X\n", sema->header.rank); Warning("\tserial number %u\n", sema->header.bits.serialNumber); Warning("\treference count %u\n", Atomic_Read(&sema->activeUserCount)); Warning("\taddress of native semaphore %p\n", &sema->nativeSemaphore); } /* *----------------------------------------------------------------------------- * * MXUser_CreateSemaphore -- * * Create a (counting) semaphore. * * The initial count of the semaphore is zero (0). The maximum count that * a semaphore handles is unknown but may be assumed to be large; the * largest signed 32-bit number is an acceptable choice. * * Results: * A pointer to a semaphore. * * Side effects: * None * *----------------------------------------------------------------------------- */ MXUserSemaphore * MXUser_CreateSemaphore(const char *userName, // IN: MX_Rank rank) // IN: { char *properName; MXUserSemaphore *sema = Util_SafeCalloc(1, sizeof *sema); if (userName == NULL) { properName = Str_SafeAsprintf(NULL, "Sema-%p", GetReturnAddress()); } else { properName = Util_SafeStrdup(userName); } if (LIKELY(MXUserInit(&sema->nativeSemaphore) == 0)) { uint32 statsMode; sema->header.signature = MXUserGetSignature(MXUSER_TYPE_SEMA); sema->header.name = properName; sema->header.rank = rank; sema->header.bits.serialNumber = MXUserAllocSerialNumber(); sema->header.dumpFunc = MXUserDumpSemaphore; statsMode = MXUserStatsMode(); switch (MXUserStatsMode()) { case 0: MXUserDisableStats(&sema->acquireStatsMem, NULL); sema->header.statsFunc = NULL; break; case 1: case 2: MXUserEnableStats(&sema->acquireStatsMem, NULL); sema->header.statsFunc = MXUserStatsActionSema; break; default: Panic("%s: unknown stats mode: %d!\n", __FUNCTION__, statsMode); } MXUserAddToList(&sema->header); } else { free(properName); free(sema); sema = NULL; } return sema; } /* *----------------------------------------------------------------------------- * * MXUser_DestroySemaphore -- * * Destroy a semaphore * * Results: * The semaphore is destroyed. Don't try to use the pointer again. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_DestroySemaphore(MXUserSemaphore *sema) // IN/OUT: { if (LIKELY(sema != NULL)) { int err; MXUserValidateHeader(&sema->header, MXUSER_TYPE_SEMA); if (Atomic_Read(&sema->activeUserCount) != 0) { MXUserDumpAndPanic(&sema->header, "%s: Attempted destroy on semaphore while in use\n", __FUNCTION__); } sema->header.signature = 0; // just in case... err = MXUserDestroy(&sema->nativeSemaphore); if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&sema->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } MXUserRemoveFromList(&sema->header); if (vmx86_stats) { MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&sema->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { MXUserAcquisitionStatsTearDown(&acquireStats->data); MXUserHistoTearDown(Atomic_ReadPtr(&acquireStats->histo)); free(acquireStats); } } free(sema->header.name); sema->header.name = NULL; free(sema); } } /* *----------------------------------------------------------------------------- * * MXUser_DownSemaphore -- * * Perform a down (P; probeer te verlagen; "try to reduce") operation * on a semaphore. * * Results: * The count will be decremented; a sleep may occur until the decrement * is possible. * * Side effects: * The caller may sleep. * *----------------------------------------------------------------------------- */ void MXUser_DownSemaphore(MXUserSemaphore *sema) // IN/OUT: { int err; ASSERT(sema); MXUserValidateHeader(&sema->header, MXUSER_TYPE_SEMA); Atomic_Inc(&sema->activeUserCount); MXUserAcquisitionTracking(&sema->header, TRUE); // rank checking if (vmx86_stats) { VmTimeType start = 0; Bool tryDownSuccess = FALSE; MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&sema->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { start = Hostinfo_SystemTimerNS(); } err = MXUserTryDown(&sema->nativeSemaphore, &tryDownSuccess); if (LIKELY(err == 0)) { if (!tryDownSuccess) { err = MXUserDown(&sema->nativeSemaphore); } } if (LIKELY((err == 0) && (acquireStats != NULL))) { MXUserHisto *histo; VmTimeType value = Hostinfo_SystemTimerNS() - start; MXUserAcquisitionSample(&acquireStats->data, TRUE, !tryDownSuccess, value); histo = Atomic_ReadPtr(&acquireStats->histo); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } } } else { err = MXUserDown(&sema->nativeSemaphore); } if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&sema->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } MXUserReleaseTracking(&sema->header); Atomic_Dec(&sema->activeUserCount); } /* *----------------------------------------------------------------------------- * * MXUser_TimedDownSemaphore -- * * Perform a down (P; probeer te verlagen; "try to reduce") operation * on a semaphore with a timeout. The wait time will always have elapsed * before the routine returns. * * Results: * TRUE Down operation occurred (count has been decremented) * FALSE Down operation did not occur (time out occurred) * * Side effects: * The caller may sleep. * *----------------------------------------------------------------------------- */ Bool MXUser_TimedDownSemaphore(MXUserSemaphore *sema, // IN/OUT: uint32 msecWait) // IN: { int err; Bool downOccurred = FALSE; ASSERT(sema); MXUserValidateHeader(&sema->header, MXUSER_TYPE_SEMA); Atomic_Inc(&sema->activeUserCount); MXUserAcquisitionTracking(&sema->header, TRUE); // rank checking if (vmx86_stats) { VmTimeType start = 0; Bool tryDownSuccess = FALSE; MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&sema->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { start = Hostinfo_SystemTimerNS(); } err = MXUserTryDown(&sema->nativeSemaphore, &tryDownSuccess); if (LIKELY(err == 0)) { if (tryDownSuccess) { downOccurred = TRUE; } else { err = MXUserTimedDown(&sema->nativeSemaphore, msecWait, &downOccurred); } } if (LIKELY((err == 0) && (acquireStats != NULL))) { VmTimeType value = Hostinfo_SystemTimerNS() - start; MXUserAcquisitionSample(&acquireStats->data, downOccurred, !tryDownSuccess, value); if (downOccurred) { MXUserHisto *histo = Atomic_ReadPtr(&acquireStats->histo); if (UNLIKELY(histo != NULL)) { MXUserHistoSample(histo, value, GetReturnAddress()); } } } } else { err = MXUserTimedDown(&sema->nativeSemaphore, msecWait, &downOccurred); } if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&sema->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } MXUserReleaseTracking(&sema->header); Atomic_Dec(&sema->activeUserCount); return downOccurred; } /* *----------------------------------------------------------------------------- * * MXUser_TryDownSemaphore -- * * Perform a try down (P; probeer te verlagen; "try to reduce") operation * on a semaphore. * * Results: * TRUE Down operation occurred (count has been decremented) * FALSE Down operation did not occur * * Side effects: * None * * NOTE: * A "TryAcquire" does not rank check should the down operation succeed. * This duplicates the behavior of MX semaphores. * *----------------------------------------------------------------------------- */ Bool MXUser_TryDownSemaphore(MXUserSemaphore *sema) // IN/OUT: { int err; Bool downOccurred = FALSE; ASSERT(sema); MXUserValidateHeader(&sema->header, MXUSER_TYPE_SEMA); Atomic_Inc(&sema->activeUserCount); err = MXUserTryDown(&sema->nativeSemaphore, &downOccurred); if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&sema->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } if (vmx86_stats) { MXUserAcquireStats *acquireStats; acquireStats = Atomic_ReadPtr(&sema->acquireStatsMem); if (LIKELY(acquireStats != NULL)) { MXUserAcquisitionSample(&acquireStats->data, downOccurred, !downOccurred, 0ULL); } } Atomic_Dec(&sema->activeUserCount); return downOccurred; } /* *----------------------------------------------------------------------------- * * MXUser_UpSemaphore -- * * Perform an up (V; verhogen; "increase") operation on a semaphore. * * Results: * The semaphore count is incremented. Any thread waiting on the * semaphore is awoken. * * Side effects: * None * *----------------------------------------------------------------------------- */ void MXUser_UpSemaphore(MXUserSemaphore *sema) // IN/OUT: { int err; ASSERT(sema); MXUserValidateHeader(&sema->header, MXUSER_TYPE_SEMA); /* * The purpose of the activeUserCount tracking is to help catch potentially * fatal cases of destroying an active semaphore; it is not expected to be * (nor it can be) perfect (with low overhead). In this case the time spent * in up is tiny and a decrement at the bottom might not be reached before * another thread comes out of down and does a destroy - so no * activeUserCount tracking here. */ err = MXUserUp(&sema->nativeSemaphore); if (UNLIKELY(err != 0)) { MXUserDumpAndPanic(&sema->header, "%s: Internal error (%d)\n", __FUNCTION__, err); } } /* *----------------------------------------------------------------------------- * * MXUser_CreateSingletonSemaphore -- * * Ensures that the specified backing object (Atomic_Ptr) contains a * semaphore. This is useful for modules that need to protect something * with a semaphore but don't have an existing Init() entry point where a * semaphore can be created. * * Results: * A pointer to the requested semaphore. * * Side effects: * Generally the semaphore's resources are intentionally leaked * (by design). * *----------------------------------------------------------------------------- */ MXUserSemaphore * MXUser_CreateSingletonSemaphore(Atomic_Ptr *semaStorage, // IN/OUT: const char *name, // IN: MX_Rank rank) // IN: { MXUserSemaphore *sema; ASSERT(semaStorage); sema = Atomic_ReadPtr(semaStorage); if (UNLIKELY(sema == NULL)) { MXUserSemaphore *newSema = MXUser_CreateSemaphore(name, rank); sema = Atomic_ReadIfEqualWritePtr(semaStorage, NULL, (void *) newSema); if (sema) { MXUser_DestroySemaphore(newSema); } else { sema = Atomic_ReadPtr(semaStorage); } } return sema; } open-vm-tools-10.0.7-3227872/lib/lock/ulInt.h0000644000000000000000000003732512660700526016630 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _ULINT_H_ #define _ULINT_H_ #if defined(_WIN32) #include #endif #include #include #include #include #if defined(__linux__) #include #endif #if defined(_WIN32) typedef DWORD MXUserThreadID; #define MXUSER_INVALID_OWNER 0xFFFFFFFF #else #include "safetime.h" #include typedef pthread_t MXUserThreadID; #endif #include "vm_basic_types.h" #include "vm_atomic.h" #include "vthreadBase.h" #include "hostinfo.h" #include "circList.h" #define MXUSER_STAT_CLASS_ACQUISITION "a" #define MXUSER_STAT_CLASS_HELD "h" /* * A portable recursive lock. */ #define MXUSER_MAX_REC_DEPTH 16 typedef struct { #if defined(_WIN32) CRITICAL_SECTION nativeLock; // Native lock object #else pthread_mutex_t nativeLock; // Native lock object #endif int referenceCount; // Acquisition count MXUserThreadID nativeThreadID; // Native thread ID } MXRecLock; /* * Environment specific implementations of portable recursive locks. * * A recursive lock is used throughput the MXUser locks because: * - it can be used recursively for recursive locks * - exclusive (non-recursive) locks catch the recursion and panic * rather than deadlock. * * There are 9 environment specific primitives: * * MXUserNativeThreadID Return native thread ID * MXRecLockCreateInternal Create lock before use * MXRecLockDestroyInternal Destroy lock after use * MXRecLockIsOwner Is lock owned by the caller? * MXRecLockSetNoOwner Set lock as owner by "nobody" * MXRecLockSetOwner Set lock owner * MXRecLockAcquireInternal Lock the lock * MXRecLockTryAcquireInternal Conditionally acquire the lock * MXRecLockReleaseInternal Unlock the lock * * Windows has a native recursive lock, the CRITICAL_SECTION. POSIXen, * unfortunately, do not ensure access to such a facility. The recursive * attribute of pthread_mutex_t is not implemented in all environments so * we create a recursive implementation using an exclusive pthread_mutex_t * and a few lines of code (most of which we need to do anyway). */ #if defined(_WIN32) static INLINE int MXRecLockCreateInternal(MXRecLock *lock) // IN/OUT: { Bool success; /* http://msdn.microsoft.com/en-us/library/ms682530(VS.85).aspx */ /* magic number - allocate resources immediately; spin 0x400 times */ success = InitializeCriticalSectionAndSpinCount(&lock->nativeLock, 0x80000400); return success ? 0 : GetLastError(); } static INLINE int MXRecLockDestroyInternal(MXRecLock *lock) // IN/OUT: { DeleteCriticalSection(&lock->nativeLock); return 0; } static INLINE MXUserThreadID MXUserNativeThreadID(void) { return GetCurrentThreadId(); } static INLINE Bool MXRecLockIsOwner(const MXRecLock *lock) // IN: { return lock->nativeThreadID == MXUserNativeThreadID(); } static INLINE void MXRecLockSetNoOwner(MXRecLock *lock) // IN: { lock->nativeThreadID = MXUSER_INVALID_OWNER; } static INLINE void MXRecLockSetOwner(MXRecLock *lock) // IN/OUT: { lock->nativeThreadID = MXUserNativeThreadID(); } static INLINE int MXRecLockAcquireInternal(MXRecLock *lock) // IN: { EnterCriticalSection(&lock->nativeLock); return 0; } static INLINE int MXRecLockTryAcquireInternal(MXRecLock *lock) // IN: { return TryEnterCriticalSection(&lock->nativeLock) ? 0 : EBUSY; } static INLINE int MXRecLockReleaseInternal(MXRecLock *lock) // IN: { LeaveCriticalSection(&lock->nativeLock); return 0; } #else static INLINE int MXRecLockCreateInternal(MXRecLock *lock) // IN/OUT: { return pthread_mutex_init(&lock->nativeLock, NULL); } static INLINE int MXRecLockDestroyInternal(MXRecLock *lock) // IN: { int err = pthread_mutex_destroy(&lock->nativeLock); #if defined(__GLIBC__) extern const char *gnu_get_libc_version(void) __attribute__ ((weak)); if (gnu_get_libc_version != NULL) { /* * Elision locking may be used but only on Haswell and newer (compatible) * processors and with glibc 2.18 or later. Unfortunately there is a * problem with the implemenation that requires ignoring any error here. * * TODO: Change the version checking to use a range once the issue is * fixed. * * See PR 1200129 for more information. */ const char *version = gnu_get_libc_version(); if (strcmp(version, "2.18") >= 0) { err = 0; } } #endif return err; } static INLINE MXUserThreadID MXUserNativeThreadID(void) { return pthread_self(); } static INLINE Bool MXRecLockIsOwner(const MXRecLock *lock) // IN: { return pthread_equal(lock->nativeThreadID, MXUserNativeThreadID()); } static INLINE void MXRecLockSetNoOwner(MXRecLock *lock) // IN/OUT: { /* a hack but it works portably */ memset(&lock->nativeThreadID, 0xFF, sizeof lock->nativeThreadID); } static INLINE void MXRecLockSetOwner(MXRecLock *lock) // IN: { lock->nativeThreadID = MXUserNativeThreadID(); } static INLINE int MXRecLockAcquireInternal(MXRecLock *lock) // IN: { return pthread_mutex_lock(&lock->nativeLock); } static INLINE int MXRecLockTryAcquireInternal(MXRecLock *lock) // IN: { return pthread_mutex_trylock(&lock->nativeLock); } static INLINE int MXRecLockReleaseInternal(MXRecLock *lock) // IN: { return pthread_mutex_unlock(&lock->nativeLock); } #endif static INLINE Bool MXRecLockInit(MXRecLock *lock) // IN/OUT: { Bool success = (MXRecLockCreateInternal(lock) == 0); if (success) { MXRecLockSetNoOwner(lock); lock->referenceCount = 0; } return success; } static INLINE void MXRecLockDestroy(MXRecLock *lock) // IN/OUT: { int err = MXRecLockDestroyInternal(lock); if (vmx86_debug && (err != 0)) { Panic("%s: MXRecLockDestroyInternal returned %d\n", __FUNCTION__, err); } } static INLINE int MXRecLockCount(const MXRecLock *lock) // IN: { ASSERT(lock->referenceCount >= 0); ASSERT(lock->referenceCount < MXUSER_MAX_REC_DEPTH); return lock->referenceCount; } static INLINE void MXRecLockIncCount(MXRecLock *lock, // IN/OUT: int count) // IN: { int newCount = (lock->referenceCount += count); ASSERT(count >= 0); if (LIKELY(newCount == count)) { MXRecLockSetOwner(lock); } } static INLINE void MXRecLockDecCount(MXRecLock *lock, // IN/OUT: int count) // IN: { int newCount = (lock->referenceCount -= count); ASSERT(count >= 0); if (LIKELY(newCount == 0)) { MXRecLockSetNoOwner(lock); } } static INLINE void MXRecLockAcquire(MXRecLock *lock, // IN/OUT: VmTimeType *duration) // OUT/OPT: { int err; if (UNLIKELY(MXRecLockCount(lock) > 0) && MXRecLockIsOwner(lock)) { MXRecLockIncCount(lock, 1); if (duration != NULL) { *duration = 0ULL; } return; // Uncontended } if (LIKELY(duration == NULL)) { err = MXRecLockAcquireInternal(lock); } else { VmTimeType start = Hostinfo_SystemTimerNS(); err = MXRecLockAcquireInternal(lock); *duration = Hostinfo_SystemTimerNS() - start; } if (vmx86_debug && (err != 0)) { Panic("%s: MXRecLockAcquireInternal error %d\n", __FUNCTION__, err); } ASSERT(MXRecLockCount(lock) == 0); MXRecLockIncCount(lock, 1); return; } static INLINE Bool MXRecLockTryAcquire(MXRecLock *lock) // IN/OUT: { int err; if (UNLIKELY(MXRecLockCount(lock) > 0) && MXRecLockIsOwner(lock)) { MXRecLockIncCount(lock, 1); return TRUE; // Was acquired } err = MXRecLockTryAcquireInternal(lock); if (LIKELY(err == 0)) { MXRecLockIncCount(lock, 1); return TRUE; // Was acquired } if (vmx86_debug && (err != EBUSY)) { Panic("%s: MXRecLockTryAcquireInternal error %d\n", __FUNCTION__, err); } return FALSE; // Was not acquired } static INLINE void MXRecLockRelease(MXRecLock *lock) // IN/OUT: { MXRecLockDecCount(lock, 1); if (LIKELY(MXRecLockCount(lock) == 0)) { int err = MXRecLockReleaseInternal(lock); if (vmx86_debug && (err != 0)) { Panic("%s: MXRecLockReleaseInternal returned %d\n", __FUNCTION__, err); } } } /* *----------------------------------------------------------------------------- * * MXUserCastedThreadID -- * * Obtains a unique thread identifier (ID) which can be stored in a * pointer; typically these thread ID values are used for tracking * purposes. * * These values are not typically used with the MXUser MXRecLock * implementation. Native constructs that are very low overhead are * used. * * Results: * As above * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void * MXUserCastedThreadID(void) { return (void *) (uintptr_t) VThread_CurID(); // unsigned } /* * MXUser object type ID values. */ typedef enum { MXUSER_TYPE_NEVER_USE = 0, MXUSER_TYPE_RW = 1, MXUSER_TYPE_REC = 2, MXUSER_TYPE_RANK = 3, MXUSER_TYPE_EXCL = 4, MXUSER_TYPE_SEMA = 5, MXUSER_TYPE_CONDVAR = 6, MXUSER_TYPE_BARRIER = 7, MXUSER_TYPE_EVENT = 8 } MXUserObjectType; /* * MXUser header - all MXUser objects start with this */ typedef struct MXUserHeader { uint32 signature; char *name; MX_Rank rank; struct { unsigned int serialNumber : 24; unsigned int badHeader: 1; } bits; void (*dumpFunc)(struct MXUserHeader *); void (*statsFunc)(struct MXUserHeader *); ListItem item; } MXUserHeader; /* * Internal functions */ void MXUserDumpAndPanic(MXUserHeader *header, const char *fmt, ...); MXRecLock *MXUserInternalSingleton(Atomic_Ptr *storage); uint32 MXUserGetSignature(MXUserObjectType objectType); #if defined(MXUSER_DEBUG) void MXUserAcquisitionTracking(MXUserHeader *header, Bool checkRank); void MXUserReleaseTracking(MXUserHeader *header); void MXUserValidateHeader(MXUserHeader *header, MXUserObjectType objectType); #else static INLINE void MXUserAcquisitionTracking(MXUserHeader *header, // IN: Bool checkRank) // IN: { return; } static INLINE void MXUserReleaseTracking(MXUserHeader *header) // IN: { return; } static INLINE void MXUserValidateHeader(MXUserHeader *header, // IN: MXUserObjectType objectType) // IN: { return; } #endif static INLINE Bool MXUserTryAcquireFail(const char *name) // IN: { extern Bool (*MXUserTryAcquireForceFail)(const char *name); return vmx86_debug && MXUserTryAcquireForceFail && (*MXUserTryAcquireForceFail)(name); } MXUserCondVar *MXUserCreateCondVar(MXUserHeader *header, MXRecLock *lock); void MXUserWaitCondVar(MXUserHeader *header, MXRecLock *lock, MXUserCondVar *condVar, uint32 msecWait); typedef struct { char *typeName; // Name uint64 numSamples; // Population sample size uint64 minTime; // Minimum uint64 maxTime; // Maximum uint64 timeSum; // Sum of times (for mean) double timeSquaredSum; // Sum of times^2 (for S.D.) } MXUserBasicStats; typedef struct { double contentionRatioFloor; uint64 contentionCountFloor; uint64 contentionDurationFloor; uint64 numAttempts; uint64 numSuccesses; uint64 numSuccessesContended; uint64 successContentionTime; uint64 totalContentionTime; MXUserBasicStats basicStats; } MXUserAcquisitionStats; typedef struct { MXUserBasicStats basicStats; // total held statistics } MXUserReleaseStats; typedef struct { MXUserAcquisitionStats data; Atomic_Ptr histo; } MXUserAcquireStats; typedef struct { VmTimeType holdStart; MXUserBasicStats data; Atomic_Ptr histo; } MXUserHeldStats; uint32 MXUserAllocSerialNumber(void); void MXUserAddToList(MXUserHeader *header); void MXUserRemoveFromList(MXUserHeader *header); uint32 MXUserStatsMode(void); typedef struct MXUserHisto MXUserHisto; MXUserHisto *MXUserHistoSetUp(char *typeName, uint64 minValue, uint32 decades); void MXUserHistoTearDown(MXUserHisto *histo); void MXUserHistoSample(MXUserHisto *histo, uint64 value, void *caller); void MXUserHistoDump(MXUserHisto *histo, MXUserHeader *header); void MXUserAcquisitionStatsSetUp(MXUserAcquisitionStats *stats); void MXUserAcquisitionSample(MXUserAcquisitionStats *stats, Bool wasAcquired, Bool wasContended, uint64 elapsedTime); void MXUserDumpAcquisitionStats(MXUserAcquisitionStats *stats, MXUserHeader *header); void MXUserAcquisitionStatsTearDown(MXUserAcquisitionStats *stats); void MXUserBasicStatsSetUp(MXUserBasicStats *stats, char *typeName); void MXUserBasicStatsSample(MXUserBasicStats *stats, uint64 value); void MXUserDumpBasicStats(MXUserBasicStats *stats, MXUserHeader *header); void MXUserBasicStatsTearDown(MXUserBasicStats *stats); void MXUserKitchen(MXUserAcquisitionStats *stats, double *contentionRatio, Bool *isHot, Bool *doLog); #define MXUSER_DEFAULT_HISTO_MIN_VALUE_NS 1000 // 1 usec #define MXUSER_DEFAULT_HISTO_DECADES 7 // 1 usec to 10 seconds Bool MXUserForceAcquisitionHisto(Atomic_Ptr *mem, uint64 minValue, uint32 decades); Bool MXUserForceHeldHisto(Atomic_Ptr *mem, uint64 minValue, uint32 decades); Bool MXUserSetContentionRatioFloor(Atomic_Ptr *mem, double ratio); Bool MXUserSetContentionCountFloor(Atomic_Ptr *mem, uint64 count); Bool MXUserSetContentionDurationFloor(Atomic_Ptr *mem, uint64 count); void MXUserEnableStats(Atomic_Ptr *acquisitionMem, Atomic_Ptr *heldMem); void MXUserDisableStats(Atomic_Ptr *acquisitionMem, Atomic_Ptr *heldMem); extern void (*MXUserMX_LockRec)(struct MX_MutexRec *lock); extern void (*MXUserMX_UnlockRec)(struct MX_MutexRec *lock); extern Bool (*MXUserMX_TryLockRec)(struct MX_MutexRec *lock); extern Bool (*MXUserMX_IsLockedByCurThreadRec)(const struct MX_MutexRec *lock); extern char *(*MXUserMX_NameRec)(const struct MX_MutexRec *lock); #endif open-vm-tools-10.0.7-3227872/lib/lock/Makefile.in0000644000000000000000000004144712660700526017431 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2010-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/lock DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libLock_la_LIBADD = am_libLock_la_OBJECTS = ul.lo ulCondVar.lo ulExcl.lo ulRec.lo ulRW.lo \ ulSema.lo ulBarrier.lo ulStats.lo libLock_la_OBJECTS = $(am_libLock_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libLock_la_SOURCES) DIST_SOURCES = $(libLock_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libLock.la libLock_la_SOURCES = ul.c ulCondVar.c ulExcl.c ulRec.c ulRW.c ulSema.c \ ulBarrier.c ulStats.c AM_CFLAGS = @LIB_USER_CPPFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/lock/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/lock/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libLock.la: $(libLock_la_OBJECTS) $(libLock_la_DEPENDENCIES) $(LINK) $(libLock_la_OBJECTS) $(libLock_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ul.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulBarrier.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulCondVar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulExcl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulRW.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulRec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulSema.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ulStats.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/lock/ulCondVar.c0000644000000000000000000004752512660700526017430 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #if defined(_WIN32) #include #else #include #endif #include "vmware.h" #include "vm_basic_asm.h" #include "str.h" #include "err.h" #include "util.h" #include "userlock.h" #include "ulInt.h" /* * A portable condition variable */ struct MXUserCondVar { uint32 signature; MXUserHeader *header; MXRecLock *ownerLock; Atomic_uint32 referenceCount; #if defined(_WIN32) union { struct { CRITICAL_SECTION condVarLock; HANDLE signalEvent; uint32 numWaiters; uint32 numForRelease; } compat; CONDITION_VARIABLE condObject; } x; #else pthread_cond_t condObject; #endif }; #if defined(_WIN32) typedef VOID (WINAPI *InitializeConditionVariableFn)(PCONDITION_VARIABLE cv); typedef BOOL (WINAPI *SleepConditionVariableCSFn)(PCONDITION_VARIABLE cv, PCRITICAL_SECTION cs, DWORD msSleep); typedef VOID (WINAPI *WakeAllConditionVariableFn)(PCONDITION_VARIABLE cv); typedef VOID (WINAPI *WakeConditionVariableFn)(PCONDITION_VARIABLE cv); static InitializeConditionVariableFn pInitializeConditionVariable; static SleepConditionVariableCSFn pSleepConditionVariableCS; static WakeAllConditionVariableFn pWakeAllConditionVariable; static WakeConditionVariableFn pWakeConditionVariable; /* *----------------------------------------------------------------------------- * * MXUserNativeCVSupported -- * * Does native condition variable support exist for the Windows the * caller is running on? * * Results: * TRUE Yes * FALSE No * * Side effects: * Function pointers to the native routines are initialized upon success. * *----------------------------------------------------------------------------- */ static Bool MXUserNativeCVSupported(void) { static Bool result; static Bool done = FALSE; if (!done) { HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); if (kernel32) { pInitializeConditionVariable = (InitializeConditionVariableFn) GetProcAddress(kernel32, "InitializeConditionVariable"); pSleepConditionVariableCS = (SleepConditionVariableCSFn) GetProcAddress(kernel32, "SleepConditionVariableCS"); pWakeAllConditionVariable = (WakeAllConditionVariableFn) GetProcAddress(kernel32, "WakeAllConditionVariable"); pWakeConditionVariable = (WakeConditionVariableFn) GetProcAddress(kernel32, "WakeConditionVariable"); COMPILER_MEM_BARRIER(); result = ((pInitializeConditionVariable != NULL) && (pSleepConditionVariableCS != NULL) && (pWakeAllConditionVariable != NULL) && (pWakeConditionVariable != NULL)); } else { result = FALSE; } done = TRUE; } return result; } /* *----------------------------------------------------------------------------- * * MXUserCreateInternal -- * * Create/initialize the environmentally specific portion of an * MXUserCondVar. * * Results: * TRUE Success * FALSE Failure * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool MXUserCreateInternal(MXUserCondVar *condVar) // IN/OUT: { Bool success; if (MXUserNativeCVSupported()) { ASSERT(pInitializeConditionVariable); (*pInitializeConditionVariable)(&condVar->x.condObject); success = TRUE; } else { if (InitializeCriticalSectionAndSpinCount(&condVar->x.compat.condVarLock, 0x80000400) == 0) { success = FALSE; } else { condVar->x.compat.numWaiters = 0; condVar->x.compat.numForRelease = 0; condVar->x.compat.signalEvent = CreateEvent(NULL, // no security TRUE, // manual-reset FALSE, // non-signaled NULL); // unnamed success = (condVar->x.compat.signalEvent != NULL); if (!success) { DeleteCriticalSection(&condVar->x.compat.condVarLock); } } } return success; } /* *----------------------------------------------------------------------------- * * MXUserDestroyInternal -- * * Destroy the environmentally specific portion of an MXUserCondVar. * * Results: * As expect. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void MXUserDestroyInternal(MXUserCondVar *condVar) // IN/OUT: { if (pInitializeConditionVariable == NULL) { DeleteCriticalSection(&condVar->x.compat.condVarLock); CloseHandle(condVar->x.compat.signalEvent); } } /* *----------------------------------------------------------------------------- * * MXUserWaitInternal -- * * Perform the environmentally specific portion of a wait on an * MXUserCondVar. * * Results: * As above * * Side effects: * It is possible to return from this routine without the condition * variable having been signalled (spurious wake up); code accordingly! * *----------------------------------------------------------------------------- */ static INLINE void MXUserWaitInternal(MXRecLock *lock, // IN/OUT: MXUserCondVar *condVar, // IN/OUT: uint32 msecWait) // IN: { int lockCount = MXRecLockCount(lock); DWORD waitTime = (msecWait == MXUSER_WAIT_INFINITE) ? INFINITE : msecWait; if (pSleepConditionVariableCS) { /* * When using the native lock found within the MXUser lock, be sure to * decrement the count before the wait/sleep and increment it after the * wait/sleep - the (native) wait/sleep will perform a lock release * before the wait/sleep and a lock acquisition after the wait/sleep. * The MXUser internal accounting information must be maintained. */ MXRecLockDecCount(lock, lockCount); (*pSleepConditionVariableCS)(&condVar->x.condObject, &lock->nativeLock, waitTime); MXRecLockIncCount(lock, lockCount); } else { DWORD err; Bool done = FALSE; EnterCriticalSection(&condVar->x.compat.condVarLock); condVar->x.compat.numWaiters++; LeaveCriticalSection(&condVar->x.compat.condVarLock); MXRecLockDecCount(lock, lockCount - 1); MXRecLockRelease(lock); do { DWORD status = WaitForSingleObject(condVar->x.compat.signalEvent, waitTime); EnterCriticalSection(&condVar->x.compat.condVarLock); ASSERT(condVar->x.compat.numWaiters > 0); if (status == WAIT_OBJECT_0) { if (condVar->x.compat.numForRelease > 0) { condVar->x.compat.numWaiters--; if (--condVar->x.compat.numForRelease == 0) { ResetEvent(condVar->x.compat.signalEvent); } err = ERROR_SUCCESS; done = TRUE; } } else { condVar->x.compat.numWaiters--; if (status == WAIT_TIMEOUT) { if (msecWait == MXUSER_WAIT_INFINITE) { err = ERROR_CALL_NOT_IMPLEMENTED; // ACK! "IMPOSSIBLE" } else { err = ERROR_SUCCESS; } } else if (status == WAIT_ABANDONED) { err = ERROR_WAIT_NO_CHILDREN; } else { ASSERT(status == WAIT_FAILED); err = GetLastError(); } done = TRUE; } LeaveCriticalSection(&condVar->x.compat.condVarLock); } while (!done); MXRecLockAcquire(lock, NULL); // non-stats MXRecLockIncCount(lock, lockCount - 1); if (err != ERROR_SUCCESS) { Panic("%s: failure %d on condVar (0x%p; %s)\n", __FUNCTION__, err, condVar, condVar->header->name); } } } /* *----------------------------------------------------------------------------- * * MXUserSignalInternal -- * * Perform the environmentally specific portion of signalling an * MXUserCondVar. * * Results: * 0 Success * !0 Error * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE int MXUserSignalInternal(MXUserCondVar *condVar) // IN/OUT: { if (pWakeConditionVariable) { (*pWakeConditionVariable)(&condVar->x.condObject); } else { EnterCriticalSection(&condVar->x.compat.condVarLock); if (condVar->x.compat.numWaiters > condVar->x.compat.numForRelease) { SetEvent(condVar->x.compat.signalEvent); condVar->x.compat.numForRelease++; } LeaveCriticalSection(&condVar->x.compat.condVarLock); } return 0; } /* *----------------------------------------------------------------------------- * * MXUserBroadcastInternal -- * * Perform the environmentally specific portion of broadcasting on an * MXUserCondVar. * * Results: * 0 Success * !0 Error * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE int MXUserBroadcastInternal(MXUserCondVar *condVar) // IN/OUT: { if (pWakeAllConditionVariable) { (*pWakeAllConditionVariable)(&condVar->x.condObject); } else { EnterCriticalSection(&condVar->x.compat.condVarLock); if (condVar->x.compat.numWaiters > condVar->x.compat.numForRelease) { SetEvent(condVar->x.compat.signalEvent); condVar->x.compat.numForRelease = condVar->x.compat.numWaiters; } LeaveCriticalSection(&condVar->x.compat.condVarLock); } return 0; } #else /* _WIN32 */ /* *----------------------------------------------------------------------------- * * MXUserCreateInternal -- * * Create/initialize the environmentally specific portion of an * MXUserCondVar. * * Results: * TRUE Success * FALSE Failure * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool MXUserCreateInternal(MXUserCondVar *condVar) // IN/OUT: { return pthread_cond_init(&condVar->condObject, NULL) == 0; } /* *----------------------------------------------------------------------------- * * MXUserDestroyInternal -- * * Destroy the environmentally specific portion of an MXUserCondVar. * * Results: * As expected. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void MXUserDestroyInternal(MXUserCondVar *condVar) // IN/OUT: { pthread_cond_destroy(&condVar->condObject); } /* *----------------------------------------------------------------------------- * * MXUserWaitInternal -- * * Perform the environmentally specific portion of a wait on an * MXUserCondVar. * * Results: * As above * * Side effects: * It is possible to return from this routine without the condition * variable having been signalled (spurious wake up); code accordingly! * *----------------------------------------------------------------------------- */ static INLINE void MXUserWaitInternal(MXRecLock *lock, // IN/OUT: MXUserCondVar *condVar, // IN/OUT: uint32 msecWait) // IN: { int err; int lockCount = MXRecLockCount(lock); /* * When using the native lock found within the MXUser lock, be sure to * decrement the count before the wait/sleep and increment it after the * wait/sleep - the (native) wait/sleep will perform a lock release before * the wait/sleep and a lock acquisition after the wait/sleep. The * MXUser internal accounting information must be maintained. */ MXRecLockDecCount(lock, lockCount); if (msecWait == MXUSER_WAIT_INFINITE) { err = pthread_cond_wait(&condVar->condObject, &lock->nativeLock); } else { struct timeval curTime; struct timespec endTime; uint64 endNS; /* * pthread_cond_timedwait takes an absolute time. Yes, this is * beyond ridiculous, and the justifications for this * vs. relative time make no sense. But IIWII. */ #define A_BILLION (1000 * 1000 * 1000) gettimeofday(&curTime, NULL); endNS = ((uint64) curTime.tv_sec * A_BILLION) + ((uint64) curTime.tv_usec * 1000) + ((uint64) msecWait * (1000 * 1000)); endTime.tv_sec = (time_t) (endNS / A_BILLION); endTime.tv_nsec = (long int) (endNS % A_BILLION); #undef A_BILLION err = pthread_cond_timedwait(&condVar->condObject, &lock->nativeLock, &endTime); } MXRecLockIncCount(lock, lockCount); if (err != 0) { if (err != ETIMEDOUT) { Panic("%s: failure %d on condVar (0x%p; %s)\n", __FUNCTION__, err, condVar, condVar->header->name); } } } /* *----------------------------------------------------------------------------- * * MXUserSignalInternal -- * * Perform the environmentally specific portion of signalling an * MXUserCondVar. * * Results: * 0 Success * !0 Error * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE int MXUserSignalInternal(MXUserCondVar *condVar) // IN/OUT: { return pthread_cond_signal(&condVar->condObject); } /* *----------------------------------------------------------------------------- * * MXUserBroadcaseInternal -- * * Perform the environmentally specific portion of broadcasting on an * MXUserCondVar. * * Results: * 0 Success * !0 Error * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE int MXUserBroadcastInternal(MXUserCondVar *condVar) // IN/OUT: { return pthread_cond_broadcast(&condVar->condObject); } #endif /* _WIN32 */ /* *----------------------------------------------------------------------------- * * MXUserCreateCondVar -- * * Create/initialize a condition variable associated with the specified * lock. * * Results: * !NULL Success; a pointer to the (new) condition variable * NULL Failure * * Side effects: * None. * *----------------------------------------------------------------------------- */ MXUserCondVar * MXUserCreateCondVar(MXUserHeader *header, // IN: MXRecLock *lock) // IN: { MXUserCondVar *condVar = Util_SafeCalloc(1, sizeof *condVar); if (MXUserCreateInternal(condVar)) { condVar->signature = MXUserGetSignature(MXUSER_TYPE_CONDVAR); condVar->header = header; condVar->ownerLock = lock; } else { free(condVar); condVar = NULL; } return condVar; } /* *----------------------------------------------------------------------------- * * MXUserWaitCondVar -- * * The internal wait on a condition variable routine. * * Results: * As above * * Side effects: * An attempt to use a lock other than the one the specified condition * variable was specified for will result in a panic. * *----------------------------------------------------------------------------- */ void MXUserWaitCondVar(MXUserHeader *header, // IN: MXRecLock *lock, // IN/OUT: MXUserCondVar *condVar, // IN/OUT: uint32 msecWait) // IN: { ASSERT(header); ASSERT(lock); ASSERT(condVar); ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR)); if (condVar->ownerLock != lock) { Panic("%s: invalid use of lock %s with condVar (0x%p; %s)\n", __FUNCTION__, header->name, condVar, condVar->header->name); } if (vmx86_debug && !MXRecLockIsOwner(lock)) { Panic("%s: lock %s for condVar (0x%p) not owned\n", __FUNCTION__, condVar->header->name, condVar); } Atomic_Inc(&condVar->referenceCount); MXUserWaitInternal(lock, condVar, msecWait); Atomic_Dec(&condVar->referenceCount); } /* *----------------------------------------------------------------------------- * * MXUser_SignalCondVar * * Signal on a condVar - wake up one thread blocked on the specified * condition variable. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void MXUser_SignalCondVar(MXUserCondVar *condVar) // IN/OUT: { int err; ASSERT(condVar); ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR)); err = MXUserSignalInternal(condVar); if (err != 0) { Panic("%s: failure %d on condVar (0x%p; %s) \n", __FUNCTION__, err, condVar, condVar->header->name); } } /* *----------------------------------------------------------------------------- * * MXUser_BroadcastCondVar * * Broadcast on a condVar - wake up all threads blocked on the specified * condition variable. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ void MXUser_BroadcastCondVar(MXUserCondVar *condVar) // IN/OUT: { int err; ASSERT(condVar); ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR)); err = MXUserBroadcastInternal(condVar); if (err != 0) { Panic("%s: failure %d on condVar (0x%p; %s) \n", __FUNCTION__, err, condVar, condVar->header->name); } } /* *----------------------------------------------------------------------------- * * MXUser_DestroyCondVar -- * * Destroy a condition variable. * * A condVar must be destroyed before the lock it is associated with. * * Results: * As above. Don't use the pointer again... * * Side effects: * None. * *----------------------------------------------------------------------------- */ void MXUser_DestroyCondVar(MXUserCondVar *condVar) // IN/OUT: { if (condVar != NULL) { ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR)); if (Atomic_Read(&condVar->referenceCount) != 0) { Panic("%s: Attempted destroy on active condVar (0x%p; %s)\n", __FUNCTION__, condVar, condVar->header->name); } condVar->signature = 0; // just in case... MXUserDestroyInternal(condVar); condVar->header = NULL; condVar->ownerLock = NULL; free(condVar); } } open-vm-tools-10.0.7-3227872/lib/string/0000755000000000000000000000000012660700526015730 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/string/convertutf.c0000644000000000000000000004545512660700526020310 0ustar rootroot/* ********************************************************** * Copyright 2008 VMware, Inc. All rights reserved. * **********************************************************/ /* * Copyright 2001-2004 Unicode, Inc. * * Disclaimer * * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine * applicability of information provided. If this file has been * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. * * Limitations on Rights to Redistribute This Code * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form * for internal or external distribution as long as this notice * remains attached. */ /* --------------------------------------------------------------------- Conversions between UTF32, UTF-16, and UTF-8. Source code file. Author: Mark E. Davis, 1994. Rev History: Rick McGowan, fixes & updates May 2001. Sept 2001: fixed const & error conditions per mods suggested by S. Parent & A. Lillich. June 2002: Tim Dodd added detection and handling of incomplete source sequences, enhanced error detection, added casts to eliminate compiler warnings. July 2003: slight mods to back out aggressive FFFE detection. Jan 2004: updated switches in from-UTF8 conversions. Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. See the header file "ConvertUTF.h" for complete documentation. ------------------------------------------------------------------------ */ #include "convertutf.h" #ifdef CVTUTF_DEBUG #include #endif static const int halfShift = 10; /* used for shifting by 10 bits */ static const UTF32 halfBase = 0x0010000UL; static const UTF32 halfMask = 0x3FFUL; #define UNI_SUR_HIGH_START (UTF32)0xD800 #define UNI_SUR_HIGH_END (UTF32)0xDBFF #define UNI_SUR_LOW_START (UTF32)0xDC00 #define UNI_SUR_LOW_END (UTF32)0xDFFF #define false 0 #define true 1 /* --------------------------------------------------------------------- */ ConversionResult ConvertUTF32toUTF16 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF32* source = *sourceStart; UTF16* target = *targetStart; while (source < sourceEnd) { UTF32 ch; if (target >= targetEnd) { result = targetExhausted; break; } ch = *source++; if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { *target++ = (UTF16)ch; /* normal case */ } } else if (ch > UNI_MAX_LEGAL_UTF32) { if (flags == strictConversion) { result = sourceIllegal; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { /* target is a character in range 0xFFFF - 0x10FFFF. */ if (target + 1 >= targetEnd) { --source; /* Back up source pointer! */ result = targetExhausted; break; } ch -= halfBase; *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); } } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ ConversionResult ConvertUTF16toUTF32 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF16* source = *sourceStart; UTF32* target = *targetStart; UTF32 ch, ch2; while (source < sourceEnd) { const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ ch = *source++; /* If we have a surrogate pair, convert to UTF32 first. */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { /* If the 16 bits following the high surrogate are in the source buffer... */ if (source < sourceEnd) { ch2 = *source; /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) + halfBase; ++source; } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } else { /* We don't have the 16 bits following the high surrogate. */ --source; /* return to the high surrogate */ result = sourceExhausted; break; } } else if (flags == strictConversion) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } if (target >= targetEnd) { source = oldSource; /* Back up source pointer! */ result = targetExhausted; break; } *target++ = ch; } *sourceStart = source; *targetStart = target; #ifdef CVTUTF_DEBUG if (result == sourceIllegal) { fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); fflush(stderr); } #endif return result; } /* --------------------------------------------------------------------- */ /* * Index into the table below with the first byte of a UTF-8 sequence to * get the number of trailing bytes that are supposed to follow it. * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is * left as-is for anyone who may want to do such conversion, which was * allowed in earlier algorithms. */ static const char trailingBytesForUTF8[256] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 }; /* * Magic values subtracted from a buffer value during UTF8 conversion. * This table contains as many values as there might be trailing bytes * in a UTF-8 sequence. */ static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; /* * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed * into the first byte, depending on how many bytes follow. There are * as many entries in this table as there are UTF-8 sequence types. * (I.e., one byte sequence, two byte... etc.). Remember that sequencs * for *legal* UTF-8 will be 4 or fewer bytes total. */ static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; /* --------------------------------------------------------------------- */ /* The interface converts a whole buffer to avoid function-call overhead. * Constants have been gathered. Loops & conditionals have been removed as * much as possible for efficiency, in favor of drop-through switches. * (See "Note A" at the bottom of the file for equivalent code.) * If your compiler supports it, the "isLegalUTF8" call can be turned * into an inline function. */ /* --------------------------------------------------------------------- */ ConversionResult ConvertUTF16toUTF8 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF16* source = *sourceStart; UTF8* target = *targetStart; while (source < sourceEnd) { UTF32 ch; unsigned short bytesToWrite = 0; const UTF32 byteMask = 0xBF; const UTF32 byteMark = 0x80; const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ ch = *source++; /* If we have a surrogate pair, convert to UTF32 first. */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { /* If the 16 bits following the high surrogate are in the source buffer... */ if (source < sourceEnd) { UTF32 ch2 = *source; /* If it's a low surrogate, convert to UTF32. */ if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + (ch2 - UNI_SUR_LOW_START) + halfBase; ++source; } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } else { /* We don't have the 16 bits following the high surrogate. */ --source; /* return to the high surrogate */ result = sourceExhausted; break; } } else if (flags == strictConversion) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } /* Figure out how many bytes the result will require */ if (ch < (UTF32)0x80) { bytesToWrite = 1; } else if (ch < (UTF32)0x800) { bytesToWrite = 2; } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; } else { bytesToWrite = 3; ch = UNI_REPLACEMENT_CHAR; } target += bytesToWrite; if (target > targetEnd) { source = oldSource; /* Back up source pointer! */ target -= bytesToWrite; result = targetExhausted; break; } switch (bytesToWrite) { /* note: everything falls through. */ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); } target += bytesToWrite; } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ /* * Utility routine to tell whether a sequence of bytes is legal UTF-8. * This must be called with the length pre-determined by the first byte. * If not calling this from ConvertUTF8to*, then the length can be set by: * length = trailingBytesForUTF8[*source]+1; * and the sequence is illegal right away if there aren't that many bytes * available. * If presented with a length > 4, this returns false. The Unicode * definition of UTF-8 goes up to 4-byte sequences. */ static Boolean isLegalUTF8(const UTF8 *source, int length) { UTF8 a; const UTF8 *srcptr = source+length; switch (length) { default: return false; /* Everything else falls through when "true"... */ case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; case 2: if ((a = (*--srcptr)) > 0xBF) return false; switch (*source) { /* no fall-through in this inner switch */ case 0xE0: if (a < 0xA0) return false; break; case 0xED: if (a > 0x9F) return false; break; case 0xF0: if (a < 0x90) return false; break; case 0xF4: if (a > 0x8F) return false; break; default: if (a < 0x80) return false; } case 1: if (*source >= 0x80 && *source < 0xC2) return false; } if (*source > 0xF4) return false; return true; } /* --------------------------------------------------------------------- */ /* * Exported function to return whether a UTF-8 sequence is legal or not. * This is not used here; it's just exported. */ Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { int length = trailingBytesForUTF8[*source]+1; if (source+length > sourceEnd) { return false; } return isLegalUTF8(source, length); } /* --------------------------------------------------------------------- */ ConversionResult ConvertUTF8toUTF16 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF8* source = *sourceStart; UTF16* target = *targetStart; while (source < sourceEnd) { UTF32 ch = 0; unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; if (source + extraBytesToRead >= sourceEnd) { result = sourceExhausted; break; } /* Do this check whether lenient or strict */ if (! isLegalUTF8(source, extraBytesToRead+1)) { result = sourceIllegal; break; } /* * The cases all fall through. See "Note A" below. */ switch (extraBytesToRead) { case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ case 3: ch += *source++; ch <<= 6; case 2: ch += *source++; ch <<= 6; case 1: ch += *source++; ch <<= 6; case 0: ch += *source++; } ch -= offsetsFromUTF8[extraBytesToRead]; if (target >= targetEnd) { source -= (extraBytesToRead+1); /* Back up source pointer! */ result = targetExhausted; break; } if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) { source -= (extraBytesToRead+1); /* return to the illegal value itself */ result = sourceIllegal; break; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { *target++ = (UTF16)ch; /* normal case */ } } else if (ch > UNI_MAX_UTF16) { if (flags == strictConversion) { result = sourceIllegal; source -= (extraBytesToRead+1); /* return to the start */ break; /* Bail out; shouldn't continue */ } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { /* target is a character in range 0xFFFF - 0x10FFFF. */ if (target + 1 >= targetEnd) { source -= (extraBytesToRead+1); /* Back up source pointer! */ result = targetExhausted; break; } ch -= halfBase; *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); } } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ ConversionResult ConvertUTF32toUTF8 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF32* source = *sourceStart; UTF8* target = *targetStart; while (source < sourceEnd) { UTF32 ch; unsigned short bytesToWrite = 0; const UTF32 byteMask = 0xBF; const UTF32 byteMark = 0x80; ch = *source++; if (flags == strictConversion ) { /* UTF-16 surrogate values are illegal in UTF-32 */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { --source; /* return to the illegal value itself */ result = sourceIllegal; break; } } /* * Figure out how many bytes the result will require. Turn any * illegally large UTF32 things (> Plane 17) into replacement chars. */ if (ch < (UTF32)0x80) { bytesToWrite = 1; } else if (ch < (UTF32)0x800) { bytesToWrite = 2; } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; } else { bytesToWrite = 3; ch = UNI_REPLACEMENT_CHAR; result = sourceIllegal; } target += bytesToWrite; if (target > targetEnd) { --source; /* Back up source pointer! */ target -= bytesToWrite; result = targetExhausted; break; } switch (bytesToWrite) { /* note: everything falls through. */ case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); } target += bytesToWrite; } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- */ ConversionResult ConvertUTF8toUTF32 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { ConversionResult result = conversionOK; const UTF8* source = *sourceStart; UTF32* target = *targetStart; while (source < sourceEnd) { UTF32 ch = 0; unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; if (source + extraBytesToRead >= sourceEnd) { result = sourceExhausted; break; } /* Do this check whether lenient or strict */ if (! isLegalUTF8(source, extraBytesToRead+1)) { result = sourceIllegal; break; } /* * The cases all fall through. See "Note A" below. */ switch (extraBytesToRead) { case 5: ch += *source++; ch <<= 6; case 4: ch += *source++; ch <<= 6; case 3: ch += *source++; ch <<= 6; case 2: ch += *source++; ch <<= 6; case 1: ch += *source++; ch <<= 6; case 0: ch += *source++; } ch -= offsetsFromUTF8[extraBytesToRead]; if (target >= targetEnd) { source -= (extraBytesToRead+1); /* Back up the source pointer! */ result = targetExhausted; break; } if (ch <= UNI_MAX_LEGAL_UTF32) { /* * UTF-16 surrogate values are illegal in UTF-32, and anything * over Plane 17 (> 0x10FFFF) is illegal. */ if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { if (flags == strictConversion) { source -= (extraBytesToRead+1); /* return to the illegal value itself */ result = sourceIllegal; break; } else { *target++ = UNI_REPLACEMENT_CHAR; } } else { *target++ = ch; } } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ result = sourceIllegal; *target++ = UNI_REPLACEMENT_CHAR; } } *sourceStart = source; *targetStart = target; return result; } /* --------------------------------------------------------------------- Note A. The fall-through switches in UTF-8 reading code save a temp variable, some decrements & conditionals. The switches are equivalent to the following loop: { int tmpBytesToRead = extraBytesToRead+1; do { ch += *source++; --tmpBytesToRead; if (tmpBytesToRead) ch <<= 6; } while (tmpBytesToRead > 0); } In UTF-8 writing code, the switches on "bytesToWrite" are similarly unrolled loops. --------------------------------------------------------------------- */ open-vm-tools-10.0.7-3227872/lib/string/bsd_output_shared.c0000644000000000000000000002060612660700526021616 0ustar rootroot/* ********************************************************** * Copyright 2006 VMware, Inc. All rights reserved. * **********************************************************/ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Shared code common to the bsd_output_* implementation files. */ //#include #if !defined(STR_NO_WIN32_LIBS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__ANDROID__) #include #include #ifndef _WIN32 #include #include #endif #include #include #include #include #ifndef _WIN32 #include #endif #include "vmware.h" #include "bsd_output_int.h" #ifndef NO_FLOATING_POINT /* *----------------------------------------------------------------------------- * * dtoa -- * * Pretend to be like the mysterious dtoa function in the FreeBSD * libc source code. It appears to take a double argument, and then * return an ASCII character string representation of this number - * just digits, no sign, decimal point, or exponent symbol. * * If 'mode' is 3, then 'prec' limits the number of digits after the * decimal point, if 'mode' is 2, then total digits. * * The base-10 exponent of the number is returned in 'expOut'. * * 'sign' is returned as 0 for a positive number, otherwise negative. * * 'strEnd' is returned as a pointer to the end of the number in the * string, so don't rely on NULL-termination to tell you where the * number ends. * * Results: * * The allocated string on success (free with freedtoa), NULL on * failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ char * dtoa(double d, // IN int mode, // IN int prec, // IN int *expOut, // OUT int *sign, // OUT char **strEnd) // OUT { char *str = NULL; int dec; #if defined(_WIN32) if (2 == mode) { str = malloc(_CVTBUFSIZE); if (str) { if (_ecvt_s(str, _CVTBUFSIZE, d, prec, &dec, sign)) { free(str); str = NULL; } } } else { ASSERT(3 == mode); str = malloc(_CVTBUFSIZE); if (str) { if (_fcvt_s(str, _CVTBUFSIZE, d, prec, &dec, sign)) { free(str); str = NULL; } } /* * When the value is not zero but rounds to zero at prec digits, * the Windows fcvt() sometimes returns the empty string and * a negative dec that goes too far (as in -dec > prec). * For example, converting 0.001 with prec 1 results in * the empty string and dec -2. (See bug 253674.) * * We just clamp dec to -prec when this happens. * * While this may appear to be a safe and good thing to * do in general. It really only works when the result is * all zeros or empty. Since checking for all zeros is * expensive, we only check for empty string, which works * for this bug. */ if (str && *str == '\0' && dec < 0 && dec < -prec) { dec = -prec; } } #else // _WIN32 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; if (2 == mode) { pthread_mutex_lock(&mutex); str = strdup(ecvt(d, prec, &dec, sign)); pthread_mutex_unlock(&mutex); } else { ASSERT(3 == mode); #ifdef __APPLE__ /* * The Mac fcvt() returns "" when prec is 0, so we have to * compensate. See bug 233530. * While it is conceivable that fcvt(round(d), 1) can return * a string that doesn't end in 0, it doesn't seem to happen * in practice (on the Mac). The problematic case that we * want to avoid is a last digit greater than 4, which requires * rounding up, which we don't want to do, which is why we're * doing the rounding on the number instead of after fcvt() * in the first place. * -- edward */ if (prec == 0) { size_t l; pthread_mutex_lock(&mutex); str = strdup(fcvt(round(d), 1, &dec, sign)); pthread_mutex_unlock(&mutex); if (str) { l = strlen(str); ASSERT(l > 0); l--; ASSERT(str[l] == '0'); str[l] = '\0'; } } else #endif // __APPLE__ { pthread_mutex_lock(&mutex); str = strdup(fcvt(d, prec, &dec, sign)); pthread_mutex_unlock(&mutex); } } #endif // _WIN32 if (str) { *strEnd = str + strlen(str); /* strip trailing zeroes */ while ((*strEnd > str) && ('0' == *((*strEnd) - 1))) { (*strEnd)--; } *expOut = dec; } return str; } /* *----------------------------------------------------------------------------- * * ldtoa -- * * A dtoa wrapper that simply casts its long double argument to a * double. Windows can't handle long double. * * Results: * See dtoa. * * Side effects: * None * *----------------------------------------------------------------------------- */ char * ldtoa(long double *ld, int mode, int prec, int *exp, int *sign, char **strEnd) { double d = (double) *ld; // ghetto fabulous return dtoa(d, mode, prec, exp, sign, strEnd); } /* *----------------------------------------------------------------------------- * * freedtoa -- * * Free the result of dtoa and ldtoa. * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ void freedtoa(void *mem) { free(mem); } #if defined _MSC_VER && _MSC_VER < 1400 /* VC80 has a built-in wmemchar */ /* *----------------------------------------------------------------------------- * * wmemchr -- * * Stolen from FreeBSD. Find 'c' in 's', which is 'n' characters * long. * * Results: * The pointer to the first occurence of 'c' in 's', NULL otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ const wchar_t * wmemchr(const wchar_t *s, wchar_t c, size_t n) { size_t i; for (i = 0; i < n; i++) { if (*s == c) { /* LINTED const castaway */ return (wchar_t *)s; } s++; } return NULL; } #endif /* *----------------------------------------------------------------------------- * * btowc -- * * Stolen from FreeBSD. Convert the MBCS character 'c' to a wide * character. * * Results: * The wide character on success, WEOF on failure. * * Side effects: * None * *----------------------------------------------------------------------------- */ wint_t bsd_btowc(int c) { char cc; wchar_t wc; if (c == EOF) return (WEOF); /* * We expect mbtowc() to return 0 or 1, hence the check for n > 1 * which detects error return values as well as "impossible" byte * counts. */ cc = (char)c; if (mbtowc(&wc, &cc, 1) > 1) return (WEOF); return (wc); } #endif /* !NO_FLOATING_POINT */ #endif /* !STR_NO_WIN32_LIBS|*BSD */ open-vm-tools-10.0.7-3227872/lib/string/convertutf.h0000644000000000000000000001402612660700526020303 0ustar rootroot/* ********************************************************** * Copyright 2008 VMware, Inc. All rights reserved. * **********************************************************/ /* * Copyright 2001-2004 Unicode, Inc. * * Disclaimer * * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine * applicability of information provided. If this file has been * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. * * Limitations on Rights to Redistribute This Code * * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form * for internal or external distribution as long as this notice * remains attached. */ /* --------------------------------------------------------------------- Conversions between UTF32, UTF-16, and UTF-8. Header file. Several funtions are included here, forming a complete set of conversions between the three formats. UTF-7 is not included here, but is handled in a separate source file. Each of these routines takes pointers to input buffers and output buffers. The input buffers are const. Each routine converts the text between *sourceStart and sourceEnd, putting the result into the buffer between *targetStart and targetEnd. Note: the end pointers are *after* the last item: e.g. *(sourceEnd - 1) is the last item. The return result indicates whether the conversion was successful, and if not, whether the problem was in the source or target buffers. (Only the first encountered problem is indicated.) After the conversion, *sourceStart and *targetStart are both updated to point to the end of last text successfully converted in the respective buffers. Input parameters: sourceStart - pointer to a pointer to the source buffer. The contents of this are modified on return so that it points at the next thing to be converted. targetStart - similarly, pointer to pointer to the target buffer. sourceEnd, targetEnd - respectively pointers to the ends of the two buffers, for overflow checking only. These conversion functions take a ConversionFlags argument. When this flag is set to strict, both irregular sequences and isolated surrogates will cause an error. When the flag is set to lenient, both irregular sequences and isolated surrogates are converted. Whether the flag is strict or lenient, all illegal sequences will cause an error return. This includes sequences such as: , , or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code must check for illegal sequences. When the flag is set to lenient, characters over 0x10FFFF are converted to the replacement character; otherwise (when the flag is set to strict) they constitute an error. Output parameters: The value "sourceIllegal" is returned from some routines if the input sequence is malformed. When "sourceIllegal" is returned, the source value will point to the illegal value that caused the problem. E.g., in UTF-8 when a sequence is malformed, it points to the start of the malformed sequence. Author: Mark E. Davis, 1994. Rev History: Rick McGowan, fixes & updates May 2001. Fixes & updates, Sept 2001. ------------------------------------------------------------------------ */ /* --------------------------------------------------------------------- The following 4 definitions are compiler-specific. The C standard does not guarantee that wchar_t has at least 16 bits, so wchar_t is no less portable than unsigned short! All should be unsigned values to avoid sign extension during bit mask & shift operations. ------------------------------------------------------------------------ */ #include "vm_basic_types.h" typedef uint32 UTF32; /* at least 32 bits */ typedef uint16 UTF16; /* at least 16 bits */ typedef uint8 UTF8; /* typically 8 bits */ typedef unsigned char Boolean; /* 0 or 1 */ /* Some fundamental constants */ #define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD #define UNI_MAX_BMP (UTF32)0x0000FFFF #define UNI_MAX_UTF16 (UTF32)0x0010FFFF #define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF #define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF typedef enum { conversionOK, /* conversion successful */ sourceExhausted, /* partial character in source, but hit end */ targetExhausted, /* insuff. room in target for conversion */ sourceIllegal /* source sequence is illegal/malformed */ } ConversionResult; typedef enum { strictConversion = 0, lenientConversion } ConversionFlags; /* This is for C++ and does no harm in C */ #ifdef __cplusplus extern "C" { #endif ConversionResult ConvertUTF8toUTF16 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); ConversionResult ConvertUTF16toUTF8 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); ConversionResult ConvertUTF8toUTF32 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); ConversionResult ConvertUTF32toUTF8 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); ConversionResult ConvertUTF16toUTF32 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); ConversionResult ConvertUTF32toUTF16 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); #ifdef __cplusplus } #endif /* --------------------------------------------------------------------- */ open-vm-tools-10.0.7-3227872/lib/string/bsd_output_int.h0000644000000000000000000000605012660700526021144 0ustar rootroot/* ********************************************************** * Copyright 2006 VMware, Inc. All rights reserved. * **********************************************************/ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * bsd_output_int.h -- * * Declarations private to the BSD-borrowed formatted output * funtions. */ #ifndef _BSD_OUTPUT_INT_H_ #define _BSD_OUTPUT_INT_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "bsd_output.h" #include "bsdfmt.h" union arg { int intarg; u_int uintarg; long longarg; u_long ulongarg; long long longlongarg; unsigned long long ulonglongarg; ptrdiff_t ptrdiffarg; size_t sizearg; intmax_t intmaxarg; uintmax_t uintmaxarg; void *pvoidarg; char *pchararg; signed char *pschararg; short *pshortarg; int *pintarg; long *plongarg; long long *plonglongarg; ptrdiff_t *pptrdiffarg; size_t *psizearg; intmax_t *pintmaxarg; #ifndef NO_FLOATING_POINT double doublearg; long double longdoublearg; #endif wint_t wintarg; wchar_t *pwchararg; }; /* * Type ids for argument type table. */ enum typeid { T_UNUSED, TP_SHORT, T_INT, T_U_INT, TP_INT, T_LONG, T_U_LONG, TP_LONG, T_LLONG, T_U_LLONG, TP_LLONG, T_PTRDIFFT, TP_PTRDIFFT, T_SIZET, TP_SIZET, T_INTMAXT, T_UINTMAXT, TP_INTMAXT, TP_VOID, TP_CHAR, TP_SCHAR, T_DOUBLE, T_LONG_DOUBLE, T_WINT, TP_WCHAR }; #if defined _MSC_VER && _MSC_VER < 1400 /* VC80 has an internal wmemchr */ extern const wchar_t *wmemchr( const wchar_t * buf, wchar_t c, size_t count ); #endif extern wint_t bsd_btowc(int c); #endif // _BSD_OUTPUT_INT_H_ open-vm-tools-10.0.7-3227872/lib/string/Makefile.am0000644000000000000000000000224112660700526017763 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libString.la libString_la_SOURCES = if USE_PRINTF_WRAPPERS libString_la_SOURCES += bsd_output_shared.c libString_la_SOURCES += bsd_vsnprintf.c libString_la_SOURCES += bsd_vsnwprintf.c endif libString_la_SOURCES += convertutf.c libString_la_SOURCES += str.c open-vm-tools-10.0.7-3227872/lib/string/bsd_vsnprintf.c0000644000000000000000000015016312660700526020763 0ustar rootroot/* ********************************************************** * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * **********************************************************/ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Note - this code originated as the file vfprintf.c in the FreeBSD * source code, location src/lib/libc/stdio/vfprintf.c, revision * 1.72. It has been borrowed and modified to act like vsnprintf * instead. For now, it only works for Windows. See bsd_output.h for * more. * * If you care to compare, the original is checked into this directory * as bsd_vsnprintf_orig.c. */ #if !defined(STR_NO_WIN32_LIBS) && !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__) /* * Actual printf innards. * * This code is large and complicated... */ #include #include #include #include #ifndef _WIN32 #include #include #endif #include #include #include #include #include "vmware.h" #include "bsd_output_int.h" #include "codeset.h" #include "convertutf.h" #include "str.h" #if defined __ANDROID__ /* * Android doesn't support dtoa() or ldtoa(). */ #define NO_DTOA #define NO_LDTOA #endif static char *__ultoa(u_long, char *, int, int, const char *, int, char, const char *); static void __find_arguments(const char *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); char blanks[PADSIZE] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; char zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; const char xdigs_lower[17] = "0123456789abcdef?"; const char xdigs_upper[17] = "0123456789ABCDEF?"; static Bool isLenientConversion = TRUE; int BSDFmt_SFVWrite(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio) { int i; BSDFmt_IOV *siov; /* * If asprintf(), then grow the buffer as necessary. */ if (sbuf->alloc) { size_t n = sbuf->index + uio->uio_resid + 1; // +1 for \0 if (n > sbuf->size) { char *p; ASSERT(sbuf->size > 0); n = ROUNDUP(n, sbuf->size); if ((p = realloc(sbuf->buf, n)) == NULL) { sbuf->error = TRUE; return 1; } sbuf->buf = p; sbuf->size = n; } } for (i = 0, siov = uio->uio_iov; i < uio->uio_iovcnt; i++, siov++) { int numToWrite = sbuf->size - sbuf->index - 1; // -1 for \0 /* * Overflowing the buffer is not an error. * We just silently truncate because that's what snprintf() does. * * Always leave space for null termination. */ if (numToWrite > siov->iov_len) { numToWrite = siov->iov_len; } memcpy(sbuf->buf + sbuf->index, siov->iov_base, numToWrite); sbuf->index += numToWrite; } return 0; } /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. */ int BSDFmt_SPrint(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio) { int err; if (uio->uio_resid == 0) { uio->uio_iovcnt = 0; return (0); } err = BSDFmt_SFVWrite(sbuf, uio); uio->uio_resid = 0; uio->uio_iovcnt = 0; return err; } /* * Convert an unsigned long to ASCII for printf purposes, returning * a pointer to the first character of the string representation. * Octal numbers can be forced to have a leading zero; hex numbers * use the given digits. */ static char * __ultoa(u_long val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; long sval; int ndig; /* * Handle the three cases separately, in the hope of getting * better/faster code. */ switch (base) { case 10: if (val < 10) { /* many numbers are 1 digit */ *--cp = to_char(val); return (cp); } ndig = 0; /* * On many machines, unsigned arithmetic is harder than * signed arithmetic, so we do at most one unsigned mod and * divide; this is sufficient to reduce the range of * the incoming value to where signed arithmetic works. */ if (val > LONG_MAX) { *--cp = to_char(val % 10); ndig++; sval = val / 10; } else { sval = val; } do { *--cp = to_char(sval % 10); ndig++; /* * If (*grp == CHAR_MAX) then no more grouping * should be performed. */ if (needgrp && ndig == *grp && *grp != CHAR_MAX && sval > 9) { *--cp = thousep; ndig = 0; /* * If (*(grp+1) == '\0') then we have to* use *grp character * (last grouping rule) for all next cases */ if (*(grp+1) != '\0') { grp++; } } sval /= 10; } while (sval != 0); break; case 8: do { *--cp = to_char(val & 7); val >>= 3; } while (val); if (octzero && *cp != '0') { *--cp = '0'; } break; case 16: do { *--cp = xdigs[val & 15]; val >>= 4; } while (val); break; default: /* oops */ abort(); } return (cp); } /* Identical to __ultoa, but for intmax_t. */ char * BSDFmt_UJToA(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { char *cp = endp; intmax_t sval; int ndig; /* quick test for small values; __ultoa is typically much faster */ /* (perhaps instead we should run until small, then call __ultoa?) */ if (val <= ULONG_MAX) { return (__ultoa((u_long)val, endp, base, octzero, xdigs, needgrp, thousep, grp)); } switch (base) { case 10: if (val < 10) { *--cp = to_char(val % 10); return (cp); } ndig = 0; if (val > INTMAX_MAX) { *--cp = to_char(val % 10); ndig++; sval = val / 10; } else { sval = val; } do { *--cp = to_char(sval % 10); ndig++; /* * If (*grp == CHAR_MAX) then no more grouping should be performed. */ if (needgrp && *grp != CHAR_MAX && ndig == *grp && sval > 9) { *--cp = thousep; ndig = 0; /* * If (*(grp+1) == '\0') then we have to use *grp character * (last grouping rule) for all next cases */ if (*(grp+1) != '\0') { grp++; } } sval /= 10; } while (sval != 0); break; case 8: do { *--cp = to_char(val & 7); val >>= 3; } while (val); if (octzero && *cp != '0') { *--cp = '0'; } break; case 16: do { *--cp = xdigs[val & 15]; val >>= 4; } while (val); break; default: abort(); } return (cp); } /* * Convert a wide character string argument to a UTF-8 string * representation. If not -1, 'prec' specifies the maximum number of * bytes to output. The returned string is always NUL-terminated, even * if that results in the string exceeding 'prec' bytes. */ char * BSDFmt_WCharToUTF8(wchar_t *wcsarg, int prec) { ConversionResult cres; char *sourceStart, *sourceEnd; char *targStart, *targEnd; char *targ = NULL; size_t targSize; size_t sourceSize = wcslen(wcsarg) * sizeof(wchar_t); targSize = (-1 == prec) ? sourceSize : MIN(sourceSize, prec); while (TRUE) { /* * Pad by 4, because we need to NUL-terminate. */ targ = realloc(targ, targSize + 4); if (!targ) { goto exit; } targStart = targ; targEnd = targStart + targSize; sourceStart = (char *) wcsarg; sourceEnd = sourceStart + sourceSize; if (2 == sizeof(wchar_t)) { cres = ConvertUTF16toUTF8((const UTF16 **) &sourceStart, (const UTF16 *) sourceEnd, (UTF8 **) &targStart, (UTF8 *) targEnd, isLenientConversion); } else if (4 == sizeof(wchar_t)) { cres = ConvertUTF32toUTF8((const UTF32 **) &sourceStart, (const UTF32 *) sourceEnd, (UTF8 **) &targStart, (UTF8 *) targEnd, isLenientConversion); } else { NOT_IMPLEMENTED(); } if (targetExhausted == cres) { if (targSize == prec) { /* * We've got all the caller wants. */ break; } else { /* * Double buffer. */ targSize = (-1 == prec) ? targSize * 2 : MIN(targSize * 2, prec); } } else if ((sourceExhausted == cres) || (sourceIllegal == cres)) { /* * If lenient, the API converted all it could, so just * proceed, otherwise, barf. */ if (isLenientConversion) { break; } else { free(targ); targ = NULL; goto exit; } } else if (conversionOK == cres) { break; } else { NOT_IMPLEMENTED(); } } /* * Success, NUL-terminate. (The API updated targStart for us). */ ASSERT(targStart <= targEnd); targSize = targStart - targ; memset(targ + targSize, 0, 4); exit: return targ; } int bsd_vsnprintf_core(char **outbuf, char *groupingIn, char thousands_sepIn, char *decimal_point, size_t bufSize, const char *fmt0, va_list ap) { char *fmt; /* format string */ int ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ char *cp; /* handy char pointer (short term usage) */ BSDFmt_IOV *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ char sign; /* sign prefix (' ', '+', '-', or \0) */ char thousands_sep; /* locale specific thousands separator */ char *grouping; /* locale specific numeric grouping rules */ #if !defined(NO_FLOATING_POINT) /* * We can decompose the printed representation of floating * point numbers into several parts, some of which may be empty: * * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ * A B ---C--- D E F * * A: 'sign' holds this value if present; '\0' otherwise * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal * C: cp points to the string MMMNNN. Leading and trailing * zeros are not in the string and must be added. * D: expchar holds this character; '\0' if no exponent, e.g. %f * F: at least two digits for decimal, at least one digit for hex */ #if defined __ANDROID__ static char dp = '.'; #endif int signflag; /* true if float is negative */ union { /* floating point arguments %[aAeEfFgG] */ double dbl; long double ldbl; } fparg; int expt = 0; /* integer value of exponent */ char expchar; /* exponent character: [eEpP\0] */ char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ int lead; /* sig figs before decimal or group sep */ int ndig; /* actual number of digits returned by dtoa */ char expstr[MAXEXPDIG + 2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ int nseps; /* number of group separators with ' */ int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ int base; /* base for [diouxX] conversion */ int dprec; /* a copy of prec if [diouxX], 0 otherwise */ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for %[xX] conversion */ BSDFmt_UIO uio; /* output information: summary */ BSDFmt_IOV iov[BSDFMT_NIOV]; /* ... and individual io vectors */ char buf[INT_CONV_BUF]; /* buffer with space for digits of uintmax_t */ char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; int nextarg; /* 1-based argument index */ #ifndef _WIN32 va_list orgap; /* original argument pointer */ #endif char *convbuf = NULL; /* wide to multibyte conversion result */ BSDFmt_StrBuf sbuf; /* * BEWARE, these `goto error' on error, and PAD uses `n'. */ #define PRINT(ptr, len) { \ iovp->iov_base = (ptr); \ iovp->iov_len = (len) * sizeof (char); \ uio.uio_resid += (len) * sizeof (char); \ iovp++; \ if (++uio.uio_iovcnt >= BSDFMT_NIOV) { \ if (BSDFmt_SPrint(&sbuf, &uio)) \ goto error; \ iovp = iov; \ } \ } #define PAD(howmany, with) { \ if ((n = (howmany)) > 0) { \ while (n > PADSIZE) { \ PRINT(with, PADSIZE); \ n -= PADSIZE; \ } \ PRINT(with, n); \ } \ } #define PRINTANDPAD(p, ep, len, with) do { \ n2 = (ep) - (p); \ if (n2 > (len)) \ n2 = (len); \ if (n2 > 0) \ PRINT((p), n2); \ PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ } while(0) #define FLUSH() { \ if (uio.uio_resid && BSDFmt_SPrint(&sbuf, &uio)) \ goto error; \ uio.uio_iovcnt = 0; \ iovp = iov; \ } /* * Get the argument indexed by nextarg. If the argument table is * built, use it to get the argument. If its not, get the next * argument (and arguments must be gotten sequentially). */ #define GETARG(type) \ ((argtable != NULL) ? *((type*)(&argtable[nextarg++])) : \ (nextarg++, va_arg(ap, type))) /* * To extend shorts properly, we need both signed and unsigned * argument extraction methods. */ #define SARG() \ (flags&LONGINT ? GETARG(long) : \ flags&SHORTINT ? (long)(short)GETARG(int) : \ flags&CHARINT ? (long)(signed char)GETARG(int) : \ (long)GETARG(int)) #define UARG() \ (flags&LONGINT ? GETARG(u_long) : \ flags&SHORTINT ? (u_long)(u_short)GETARG(int) : \ flags&CHARINT ? (u_long)(u_char)GETARG(int) : \ (u_long)GETARG(u_int)) #define SJARG() \ (flags&INTMAXT ? GETARG(intmax_t) : \ flags&SIZET ? (intmax_t)GETARG(size_t) : \ flags&PTRDIFFT ? (intmax_t)GETARG(ptrdiff_t) : \ (intmax_t)GETARG(long long)) #define UJARG() \ (flags&INTMAXT ? GETARG(uintmax_t) : \ flags&SIZET ? (uintmax_t)GETARG(size_t) : \ flags&PTRDIFFT ? (uintmax_t)GETARG(ptrdiff_t) : \ (uintmax_t)GETARG(unsigned long long)) /* * Get * arguments, including the form *nn$. Preserve the nextarg * that the argument can be gotten once the type is determined. */ #define GETASTER(val) \ n2 = 0; \ cp = fmt; \ while (is_digit(*cp)) { \ n2 = 10 * n2 + to_digit(*cp); \ cp++; \ } \ if (*cp == '$') { \ int hold = nextarg; \ FIND_ARGUMENTS(); \ nextarg = n2; \ val = GETARG (int); \ nextarg = hold; \ fmt = ++cp; \ } else { \ val = GETARG (int); \ } /* * Windows can't scan the args twice, so always build argtable. * Otherwise, do it when we see an n$ argument. */ #ifndef _WIN32 #define FIND_ARGUMENTS() \ (argtable == NULL ? \ (argtable = statargtable, \ __find_arguments(fmt0, orgap, &argtable)) : \ (void) 0) #else #define FIND_ARGUMENTS() \ ASSERT(argtable != NULL) #endif xdigs = xdigs_lower; thousands_sep = '\0'; grouping = NULL; convbuf = NULL; #if !defined(NO_FLOATING_POINT) dtoaresult = NULL; #ifdef __ANDROID__ /* * Struct lconv is not working! For decimal_point, * using '.' instead is a workaround. */ decimal_point = &dp; #endif #endif fmt = (char *)fmt0; nextarg = 1; #ifndef _WIN32 argtable = NULL; va_copy(orgap, ap); #else argtable = statargtable; __find_arguments(fmt0, ap, &argtable); #endif uio.uio_iov = iovp = iov; uio.uio_resid = 0; uio.uio_iovcnt = 0; ret = 0; /* * Set up output string buffer structure. */ sbuf.alloc = (*outbuf == NULL); sbuf.error = FALSE; sbuf.buf = *outbuf; sbuf.size = bufSize; sbuf.index = 0; /* * If asprintf(), allocate initial buffer based on format length. * Empty format only needs one byte. Otherwise, round up to multiple of 64. */ if (sbuf.alloc) { size_t n = strlen(fmt0) + 1; // +1 for \0 if (n > 1) { n = ROUNDUP(n, 64); } if ((sbuf.buf = malloc(n * sizeof (char))) == NULL) { sbuf.error = TRUE; goto error; } sbuf.size = n; } // shut compile up #if !defined(NO_FLOATING_POINT) expchar = 0; expsize = 0; lead = 0; ndig = 0; nseps = 0; nrepeats = 0; #endif ulval = 0; ujval = 0; /* * Scan the format for conversions (`%' character). */ for (;;) { for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) /* void */; if ((n = fmt - cp) != 0) { if ((unsigned)ret + n > INT_MAX) { ret = EOF; goto error; } PRINT(cp, n); ret += n; } if (ch == '\0') { goto done; } fmt++; /* skip over '%' */ flags = 0; dprec = 0; width = 0; prec = -1; sign = '\0'; ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { case ' ': /*- * ``If the space and + flags both appear, the space flag will be * ignored.'' -- ANSI X3J11 */ if (!sign) { sign = ' '; } goto rflag; case '#': flags |= ALT; goto rflag; case '*': /*- * ``A negative field width argument is taken as a flag followed by * a positive field width.''-- ANSI X3J11 * * They don't exclude field widths read from args. */ GETASTER (width); if (width >= 0) { goto rflag; } width = -width; /* FALLTHROUGH */ case '-': flags |= LADJUST; goto rflag; case '+': sign = '+'; goto rflag; case '\'': flags |= GROUPING; #if !defined __ANDROID__ thousands_sep = thousands_sepIn; grouping = groupingIn; #else /* * Struct lconv is not working! The code below is a workaround. */ thousands_sep = ','; #endif /* * Grouping should not begin with 0, but it nevertheless does (see * bug 281072) and makes the formatting code behave badly, so we * fix it up. */ if (grouping != NULL && *grouping == '\0') { static char g[] = { CHAR_MAX, '\0' }; grouping = g; } goto rflag; case '.': if ((ch = *fmt++) == '*') { GETASTER (prec); goto rflag; } prec = 0; while (is_digit(ch)) { prec = 10 * prec + to_digit(ch); ch = *fmt++; } goto reswitch; case '0': /*- * ``Note that 0 is taken as a flag, not as the beginning of a * field width.'' -- ANSI X3J11 */ flags |= ZEROPAD; goto rflag; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = 0; do { n = 10 * n + to_digit(ch); ch = *fmt++; } while (is_digit(ch)); if (ch == '$') { nextarg = n; FIND_ARGUMENTS(); goto rflag; } width = n; goto reswitch; case 'h': if (flags & SHORTINT) { flags &= ~SHORTINT; flags |= CHARINT; } else { flags |= SHORTINT; } goto rflag; case 'j': flags |= INTMAXT; goto rflag; case 'I': /* could be I64 - long long int is 64bit */ if (fmt[0] == '6' && fmt[1] == '4') { fmt += 2; flags |= LLONGINT; goto rflag; } /* could be I32 - normal int is 32bit */ if (fmt[0] == '3' && fmt[1] == '2') { fmt += 2; /* flags |= normal integer - it is 32bit for all our targets */ goto rflag; } /* * I alone - use Microsoft's semantic as size_t modifier. We do * not support glibc's semantic to use alternative digits. */ flags |= SIZET; goto rflag; case 'l': if (flags & LONGINT) { flags &= ~LONGINT; flags |= LLONGINT; } else flags |= LONGINT; goto rflag; case 'L': case 'q': flags |= LLONGINT; /* not necessarily */ goto rflag; case 't': flags |= PTRDIFFT; goto rflag; case 'Z': case 'z': flags |= SIZET; goto rflag; case 'C': flags |= LONGINT; /*FALLTHROUGH*/ case 'c': if (flags & LONGINT) { static const mbstate_t initial; mbstate_t mbs; size_t mbseqlen; mbs = initial; mbseqlen = wcrtomb(cp = buf, (wchar_t) GETARG(wint_t), &mbs); if (mbseqlen == (size_t) -1) { sbuf.error = TRUE; goto error; } size = (int) mbseqlen; } else { *(cp = buf) = GETARG(int); size = 1; } sign = '\0'; break; case 'D': flags |= LONGINT; /*FALLTHROUGH*/ case 'd': case 'i': if (flags & INTMAX_SIZE) { ujval = SJARG(); if ((intmax_t) ujval < 0) { ujval = -ujval; sign = '-'; } } else { ulval = SARG(); if ((long) ulval < 0) { ulval = -ulval; sign = '-'; } } base = 10; goto number; #if !defined(NO_FLOATING_POINT) case 'e': case 'E': expchar = ch; if (prec < 0) { /* account for digit before decpt */ prec = DEFPREC + 1; } else { prec++; } goto fp_begin; case 'f': case 'F': expchar = '\0'; goto fp_begin; case 'g': case 'G': expchar = ch - ('g' - 'e'); if (prec == 0) { prec = 1; } fp_begin: if (prec < 0) { prec = DEFPREC; } if (dtoaresult != NULL) { freedtoa(dtoaresult); } if (flags & LLONGINT) { fparg.ldbl = GETARG(long double); #if defined NO_LDTOA dtoaresult = NULL; /* * Below is to keep compiler happy */ signflag = -1; expt = 0; dtoaend = NULL; #else dtoaresult = cp = ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend); #endif } else { fparg.dbl = GETARG(double); #if defined NO_DTOA dtoaresult = NULL; /* * Below is to keep compiler happy */ signflag = -1; expt = 0; dtoaend = NULL; #else dtoaresult = cp = dtoa(fparg.dbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend); #endif } /* Our dtoa / ldtoa call strdup(), which can fail. PR319844 */ if (dtoaresult == NULL) { sbuf.error = TRUE; goto error; } flags |= FPT; if ((expt == 9999) || ((Str_Strcasecmp(cp, "-inf") == 0) || (Str_Strcasecmp(cp, "inf") == 0) || (Str_Strcasecmp(cp, "nan") == 0))) { if (*cp == '-') { sign = '-'; cp++; } cp = islower(ch) ? Str_ToLower(cp) : Str_ToUpper(cp); expt = INT_MAX; size = strlen(cp); break; } if (signflag) { sign = '-'; } ndig = dtoaend - cp; if (ch == 'g' || ch == 'G') { if (expt > -4 && expt <= prec) { /* Make %[gG] smell like %[fF] */ expchar = '\0'; if (flags & ALT) { prec -= expt; } else { prec = ndig - expt; } if (prec < 0) { prec = 0; } } else { /* * Make %[gG] smell like %[eE], but trim trailing zeroes * if no # flag. */ if (!(flags & ALT)) { prec = ndig; } } } if (expchar) { expsize = BSDFmt_Exponent(expstr, expt - 1, expchar); size = expsize + prec; if (prec > 1 || flags & ALT) { ++size; } } else { /* space for digits before decimal point */ if (expt > 0) { size = expt; } else { /* "0" */ size = 1; } /* space for decimal pt and following digits */ if (prec || flags & ALT) { size += prec + 1; } if (grouping && expt > 0) { /* space for thousands' grouping */ nseps = nrepeats = 0; lead = expt; while (*grouping != CHAR_MAX) { if (lead <= *grouping) { break; } lead -= *grouping; if (*(grouping + 1)) { nseps++; grouping++; } else { nrepeats++; } } size += nseps + nrepeats; } else { lead = expt; } } break; #endif /* !NO_FLOATING_POINT */ case 'n': /* * Assignment-like behavior is specified if the value overflows or * is otherwise unrepresentable. C99 says to use `signed char' * for %hhn conversions. */ if (flags & LLONGINT) { *GETARG(long long *) = ret; } else if (flags & SIZET) { *GETARG(size_t *) = (size_t)ret; } else if (flags & PTRDIFFT) { *GETARG(ptrdiff_t *) = ret; } else if (flags & INTMAXT) { *GETARG(intmax_t *) = ret; } else if (flags & LONGINT) { *GETARG(long *) = ret; } else if (flags & SHORTINT) { *GETARG(short *) = ret; } else if (flags & CHARINT) { *GETARG(signed char *) = ret; } else { *GETARG(int *) = ret; } continue; /* no output */ case 'O': flags |= LONGINT; /*FALLTHROUGH*/ case 'o': if (flags & INTMAX_SIZE) { ujval = UJARG(); } else { ulval = UARG(); } base = 8; goto nosign; case 'p': /*- * ``The argument shall be a pointer to void. The value of the * pointer is converted to a sequence of printable characters, in * an implementation- defined manner.'' -- ANSI X3J11 */ ujval = (uintmax_t)(uintptr_t) GETARG(void *); base = 16; xdigs = xdigs_upper; flags = flags | INTMAXT; /* * PR 103201 * VisualC sscanf doesn't grok '0x', so prefix zeroes. */ // ox[1] = 'x'; goto nosign; case 'S': flags |= LONGINT; /*FALLTHROUGH*/ case 's': if (flags & LONGINT) { wchar_t *wcp; /* Argument is wchar_t * */ if (convbuf != NULL) { free(convbuf); convbuf = NULL; } if ((wcp = GETARG(wchar_t *)) == NULL) { cp = "(null)"; } else { convbuf = BSDFmt_WCharToUTF8(wcp, prec); if (convbuf == NULL) { sbuf.error = TRUE; goto error; } cp = convbuf; } } else if ((cp = GETARG(char *)) == NULL) { /* Argument is char * */ cp = "(null)"; } if (prec >= 0) { /* * can't use strlen; can only look for the NUL in the first * `prec' characters, and strlen() will go further. */ char *p = memchr(cp, 0, (size_t)prec); if (p == NULL) { size = prec; } else { size = p - cp; if (size > prec) { size = prec; } } size = CodeSet_Utf8FindCodePointBoundary(cp, size); } else { size = strlen(cp); } sign = '\0'; break; case 'U': flags |= LONGINT; /*FALLTHROUGH*/ case 'u': if (flags & INTMAX_SIZE) ujval = UJARG(); else ulval = UARG(); base = 10; goto nosign; case 'X': xdigs = xdigs_upper; goto hex; case 'x': xdigs = xdigs_lower; hex: if (flags & INTMAX_SIZE) { ujval = UJARG(); } else { ulval = UARG(); } base = 16; /* leading 0x/X only if non-zero */ if (flags & ALT && (flags & INTMAX_SIZE ? ujval != 0 : ulval != 0)) { ox[1] = ch; } flags &= ~GROUPING; /* unsigned conversions */ nosign: sign = '\0'; /*- * ``... diouXx conversions ... if a precision is specified, the * 0 flag will be ignored.'' -- ANSI X3J11 */ number: if ((dprec = prec) >= 0) { flags &= ~ZEROPAD; } /*- * ``The result of converting a zero value with an explicit * precision of zero is no characters.'' -- ANSI X3J11 * * ``The C Standard is clear enough as is. The call printf("%#.0o", 0) * should print 0.'' -- Defect Report #151 */ cp = buf + INT_CONV_BUF; if (flags & INTMAX_SIZE) { if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) { cp = BSDFmt_UJToA(ujval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, grouping); } } else { if (ulval != 0 || prec != 0 || (flags & ALT && base == 8)) { cp = __ultoa(ulval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, grouping); } } size = buf + INT_CONV_BUF - cp; if (size > INT_CONV_BUF) { /* should never happen */ abort(); } break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') { goto done; } /* pretend it was %c with argument ch */ cp = buf; *cp = ch; size = 1; sign = '\0'; break; } /* * All reasonable formats wind up here. At this point, `cp' points to * a string which (if not flags&LADJUST) should be padded out to `width' * places. If flags&ZEROPAD, it should first be prefixed by any sign * or other prefix; otherwise, it should be blank padded before the * prefix is emitted. After any left-hand padding and prefixing, emit * zeroes required by a decimal [diouxX] precision, then print the * string proper, then emit zeroes required by any leftover floating * precision; finally, if LADJUST, pad with blanks. * * Compute actual size, so we know how much to pad. size excludes * decimal prec; realsz includes it. */ realsz = dprec > size ? dprec : size; if (sign) { realsz++; } if (ox[1]) { realsz += 2; } prsize = width > realsz ? width : realsz; if ((unsigned)ret + prsize > INT_MAX) { ret = EOF; goto error; } /* right-adjusting blank padding */ if ((flags & (LADJUST | ZEROPAD)) == 0) { PAD(width - realsz, blanks); } /* prefix */ if (sign) { PRINT(&sign, 1); } #if !defined(NO_FLOATING_POINT) /* NAN, INF and -INF */ if ((flags & FPT) && (expt == INT_MAX)) { PRINT(cp, size); goto skip; } #endif if (ox[1]) { /* ox[1] is either x, X, or \0 */ ox[0] = '0'; PRINT(ox, 2); } /* right-adjusting zero padding */ if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) { PAD(width - realsz, zeroes); } /* leading zeroes from decimal precision */ PAD(dprec - size, zeroes); /* the string or number proper */ if (flags & FPT) { /* glue together f_p fragments */ #if defined(NO_FLOATING_POINT) NOT_IMPLEMENTED(); #else if (expchar) { /* %[fF] or sufficiently short %[gG] */ if (prec > 1 || flags & ALT) { buf[0] = *cp++; buf[1] = *decimal_point; PRINT(buf, 2); if (ndig > 0) { PRINT(cp, ndig - 1); PAD(prec - ndig, zeroes); } else { PAD(prec - ndig - 1, zeroes); } } else { /* XeYYY */ PRINT(cp, 1); } PRINT(expstr, expsize); } else { /* %[eE] or sufficiently long %[gG] */ if (expt <= 0) { PRINT(zeroes, 1); if (prec || flags & ALT) { PRINT(decimal_point, 1); } PAD(-expt, zeroes); /* already handled initial 0's */ prec += expt; } else { PRINTANDPAD(cp, dtoaend, lead, zeroes); cp += lead; if (grouping) { while (nseps > 0 || nrepeats > 0) { if (nrepeats > 0) { nrepeats--; } else { grouping--; nseps--; } PRINT(&thousands_sep, 1); PRINTANDPAD(cp, dtoaend, *grouping, zeroes); cp += *grouping; } if (cp > dtoaend) { cp = dtoaend; } } if (prec || flags & ALT) { PRINT(decimal_point, 1); } } PRINTANDPAD(cp, dtoaend, prec, zeroes); } #endif } else { PRINT(cp, size); } skip: /* left-adjusting padding (always blank) */ if (flags & LADJUST) { PAD(width - realsz, blanks); } /* finally, adjust ret */ ret += prsize; FLUSH(); /* copy out the I/O vectors */ } done: FLUSH(); /* * Always null terminate, unless buffer is size 0. */ ASSERT(!sbuf.error && ret >= 0); if (sbuf.size <= 0) { ASSERT(!sbuf.alloc); } else { ASSERT(sbuf.index < sbuf.size); sbuf.buf[sbuf.index] = '\0'; } error: #ifndef _WIN32 va_end(orgap); #endif #if !defined(NO_FLOATING_POINT) if (dtoaresult != NULL) { freedtoa(dtoaresult); } #endif if (convbuf != NULL) { free(convbuf); convbuf = NULL; } if (sbuf.error) { ret = EOF; } if ((argtable != NULL) && (argtable != statargtable)) { free (argtable); } // return allocated buffer on success, free it on failure if (sbuf.alloc) { if (ret < 0) { free(sbuf.buf); } else { *outbuf = sbuf.buf; } } return (ret); /* NOTREACHED */ #undef PRINT #undef PAD #undef PRINTANDPAD #undef FLUSH #undef GETARG #undef SARG #undef SJARG #undef UARG #undef UJARG #undef GETASTER #undef FIND_ARGUMENTS } int bsd_vsnprintf_c_locale(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) { char thousands_sep; char *decimal_point; static char dp = '.'; /* * Perform a "%f" conversion always using the locale associated * with the C locale - "," for thousands, '.' for decimal point. */ thousands_sep = ','; decimal_point = &dp; return bsd_vsnprintf_core(outbuf, NULL, thousands_sep, decimal_point, bufSize, fmt0, ap); } int bsd_vsnprintf(char **outbuf, size_t bufSize, const char *fmt0, va_list ap) { char *grouping; char thousands_sep; char *decimal_point; #if defined(__ANDROID__) static char dp = '.'; /* * Struct lconv is not working! The code below is a workaround. */ grouping = NULL; thousands_sep = ','; decimal_point = &dp; #else grouping = localeconv()->grouping; thousands_sep = *(localeconv()->thousands_sep); decimal_point = localeconv()->decimal_point; #endif return bsd_vsnprintf_core(outbuf, grouping, thousands_sep, decimal_point, bufSize, fmt0, ap); } /* * Find all arguments when a positional parameter is encountered. Returns a * table, indexed by argument number, of pointers to each arguments. The * initial argument table should be an array of STATIC_ARG_TBL_SIZE entries. * It will be replaces with a malloc-ed one if it overflows. */ static void __find_arguments (const char *fmt0, va_list ap, union arg **argtable) { char *fmt; /* format string */ int ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ char *cp; /* handy char pointer (short term usage) */ int flags; /* flags as above */ enum typeid *typetable; /* table of types */ enum typeid stattypetable [STATIC_ARG_TBL_SIZE]; int tablesize; /* current size of type table */ int tablemax; /* largest used index in table */ int nextarg; /* 1-based argument index */ /* * Add an argument type to the table, expanding if necessary. */ #define ADDTYPE(type) \ ((nextarg >= tablesize) ? \ __grow_type_table(nextarg, &typetable, &tablesize) : (void)0, \ (nextarg > tablemax) ? tablemax = nextarg : 0, \ typetable[nextarg++] = type) #define ADDSARG() \ ((flags&INTMAXT) ? ADDTYPE(T_INTMAXT) : \ ((flags&SIZET) ? ADDTYPE(T_SIZET) : \ ((flags&PTRDIFFT) ? ADDTYPE(T_PTRDIFFT) : \ ((flags&LLONGINT) ? ADDTYPE(T_LLONG) : \ ((flags&LONGINT) ? ADDTYPE(T_LONG) : ADDTYPE(T_INT)))))) #define ADDUARG() \ ((flags&INTMAXT) ? ADDTYPE(T_UINTMAXT) : \ ((flags&SIZET) ? ADDTYPE(T_SIZET) : \ ((flags&PTRDIFFT) ? ADDTYPE(T_PTRDIFFT) : \ ((flags&LLONGINT) ? ADDTYPE(T_U_LLONG) : \ ((flags&LONGINT) ? ADDTYPE(T_U_LONG) : ADDTYPE(T_U_INT)))))) /* * Add * arguments to the type array. */ #define ADDASTER() \ n2 = 0; \ cp = fmt; \ while (is_digit(*cp)) { \ n2 = 10 * n2 + to_digit(*cp); \ cp++; \ } \ if (*cp == '$') { \ int hold = nextarg; \ nextarg = n2; \ ADDTYPE (T_INT); \ nextarg = hold; \ fmt = ++cp; \ } else { \ ADDTYPE (T_INT); \ } fmt = (char *)fmt0; typetable = stattypetable; tablesize = STATIC_ARG_TBL_SIZE; tablemax = 0; nextarg = 1; for (n = 0; n < STATIC_ARG_TBL_SIZE; n++) typetable[n] = T_UNUSED; /* * Scan the format for conversions (`%' character). */ for (;;) { for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) /* void */; if (ch == '\0') goto done; fmt++; /* skip over '%' */ flags = 0; rflag: ch = *fmt++; reswitch: switch (ch) { case ' ': case '#': goto rflag; case '*': ADDASTER (); goto rflag; case '-': case '+': case '\'': goto rflag; case '.': if ((ch = *fmt++) == '*') { ADDASTER (); goto rflag; } while (is_digit(ch)) { ch = *fmt++; } goto reswitch; case '0': goto rflag; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = 0; do { n = 10 * n + to_digit(ch); ch = *fmt++; } while (is_digit(ch)); if (ch == '$') { nextarg = n; goto rflag; } goto reswitch; case 'h': if (flags & SHORTINT) { flags &= ~SHORTINT; flags |= CHARINT; } else flags |= SHORTINT; goto rflag; case 'j': flags |= INTMAXT; goto rflag; case 'I': /* could be I64 - long long int is 64bit */ if (fmt[0] == '6' && fmt[1] == '4') { fmt += 2; flags |= LLONGINT; goto rflag; } /* could be I32 - normal int is 32bit */ if (fmt[0] == '3' && fmt[1] == '2') { fmt += 2; /* flags |= normal integer - it is 32bit for all our targets */ goto rflag; } /* * I alone - use Microsoft's semantic as size_t modifier. We do * not support glibc's semantic to use alternative digits. */ flags |= SIZET; goto rflag; case 'l': if (flags & LONGINT) { flags &= ~LONGINT; flags |= LLONGINT; } else flags |= LONGINT; goto rflag; case 'L': case 'q': flags |= LLONGINT; /* not necessarily */ goto rflag; case 't': flags |= PTRDIFFT; goto rflag; case 'Z': case 'z': flags |= SIZET; goto rflag; case 'C': flags |= LONGINT; /*FALLTHROUGH*/ case 'c': if (flags & LONGINT) ADDTYPE(T_WINT); else ADDTYPE(T_INT); break; case 'D': flags |= LONGINT; /*FALLTHROUGH*/ case 'd': case 'i': ADDSARG(); break; #if !defined(NO_FLOATING_POINT) case 'a': case 'A': case 'e': case 'E': case 'f': case 'g': case 'G': if (flags & LLONGINT) ADDTYPE(T_LONG_DOUBLE); else ADDTYPE(T_DOUBLE); break; #endif /* !NO_FLOATING_POINT */ case 'n': if (flags & INTMAXT) ADDTYPE(TP_INTMAXT); else if (flags & PTRDIFFT) ADDTYPE(TP_PTRDIFFT); else if (flags & SIZET) ADDTYPE(TP_SIZET); else if (flags & LLONGINT) ADDTYPE(TP_LLONG); else if (flags & LONGINT) ADDTYPE(TP_LONG); else if (flags & SHORTINT) ADDTYPE(TP_SHORT); else if (flags & CHARINT) ADDTYPE(TP_SCHAR); else ADDTYPE(TP_INT); continue; /* no output */ case 'O': flags |= LONGINT; /*FALLTHROUGH*/ case 'o': ADDUARG(); break; case 'p': ADDTYPE(TP_VOID); break; case 'S': flags |= LONGINT; /*FALLTHROUGH*/ case 's': if (flags & LONGINT) ADDTYPE(TP_WCHAR); else ADDTYPE(TP_CHAR); break; case 'U': flags |= LONGINT; /*FALLTHROUGH*/ case 'u': case 'X': case 'x': ADDUARG(); break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') goto done; break; } } done: /* * Build the argument table. */ if (tablemax >= STATIC_ARG_TBL_SIZE) { *argtable = (union arg *) malloc (sizeof (union arg) * (tablemax + 1)); } (*argtable) [0].intarg = 0; for (n = 1; n <= tablemax; n++) { switch (typetable [n]) { case T_UNUSED: /* whoops! */ (*argtable) [n].intarg = va_arg (ap, int); break; case TP_SCHAR: (*argtable) [n].pschararg = va_arg (ap, signed char *); break; case TP_SHORT: (*argtable) [n].pshortarg = va_arg (ap, short *); break; case T_INT: (*argtable) [n].intarg = va_arg (ap, int); break; case T_U_INT: (*argtable) [n].uintarg = va_arg (ap, unsigned int); break; case TP_INT: (*argtable) [n].pintarg = va_arg (ap, int *); break; case T_LONG: (*argtable) [n].longarg = va_arg (ap, long); break; case T_U_LONG: (*argtable) [n].ulongarg = va_arg (ap, unsigned long); break; case TP_LONG: (*argtable) [n].plongarg = va_arg (ap, long *); break; case T_LLONG: (*argtable) [n].longlongarg = va_arg (ap, long long); break; case T_U_LLONG: (*argtable) [n].ulonglongarg = va_arg (ap, unsigned long long); break; case TP_LLONG: (*argtable) [n].plonglongarg = va_arg (ap, long long *); break; case T_PTRDIFFT: (*argtable) [n].ptrdiffarg = va_arg (ap, ptrdiff_t); break; case TP_PTRDIFFT: (*argtable) [n].pptrdiffarg = va_arg (ap, ptrdiff_t *); break; case T_SIZET: (*argtable) [n].sizearg = va_arg (ap, size_t); break; case TP_SIZET: (*argtable) [n].psizearg = va_arg (ap, size_t *); break; case T_INTMAXT: (*argtable) [n].intmaxarg = va_arg (ap, intmax_t); break; case T_UINTMAXT: (*argtable) [n].uintmaxarg = va_arg (ap, uintmax_t); break; case TP_INTMAXT: (*argtable) [n].pintmaxarg = va_arg (ap, intmax_t *); break; #if !defined(NO_FLOATING_POINT) case T_DOUBLE: (*argtable) [n].doublearg = va_arg (ap, double); break; case T_LONG_DOUBLE: (*argtable) [n].longdoublearg = va_arg (ap, long double); break; #endif case TP_CHAR: (*argtable) [n].pchararg = va_arg (ap, char *); break; case TP_VOID: (*argtable) [n].pvoidarg = va_arg (ap, void *); break; case T_WINT: (*argtable) [n].wintarg = va_arg (ap, wint_t); break; case TP_WCHAR: (*argtable) [n].pwchararg = va_arg (ap, wchar_t *); break; } } if ((typetable != NULL) && (typetable != stattypetable)) free (typetable); #undef ADDTYPE #undef ADDSARG #undef ADDUARG #undef ADDASTER } /* * Increase the size of the type table. */ static void __grow_type_table (int nextarg, enum typeid **typetable, int *tablesize) { enum typeid *const oldtable = *typetable; const int oldsize = *tablesize; enum typeid *newtable; int n, newsize = oldsize * 2; if (newsize < nextarg + 1) { newsize = nextarg + 1; } if (oldsize == STATIC_ARG_TBL_SIZE) { if ((newtable = malloc(newsize * sizeof(enum typeid))) == NULL) { abort(); /* XXX handle better */ } memmove(newtable, oldtable, oldsize * sizeof(enum typeid)); } else { newtable = realloc(oldtable, newsize * sizeof(enum typeid)); if (newtable == NULL) { abort(); /* XXX handle better */ } } for (n = oldsize; n < newsize; n++) { newtable[n] = T_UNUSED; } *typetable = newtable; *tablesize = newsize; } #if !defined(NO_FLOATING_POINT) int BSDFmt_Exponent(char *p0, int exp, int fmtch) { char *p, *t; char expbuf[MAXEXPDIG]; p = p0; *p++ = fmtch; if (exp < 0) { exp = -exp; *p++ = '-'; } else { *p++ = '+'; } t = expbuf + MAXEXPDIG; if (exp < 10) { *p++ = '0'; } // See PR 704706: POSIX specifies that exponents < 100 only have 2 digits // if (exp < 100) { // *p++ = '0'; // } if (exp > 9) { do { *--t = to_char(exp % 10); } while ((exp /= 10) > 9); *--t = to_char(exp); for (; t < expbuf + MAXEXPDIG; *p++ = *t++); } else { *p++ = to_char(exp); } return (p - p0); } #endif /* !NO_FLOATING_POINT */ #endif /* !STR_NO_WIN32_LIBS|*BSD */ open-vm-tools-10.0.7-3227872/lib/string/str.c0000644000000000000000000010552612660700526016715 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * str.c -- * * User level string wrappers * * WARNING: * Do not call any variadic functions - those that use "..." repeatedly * with the same va_list or memory corruption and/or crashes will occur. * The suggested way deal with repeated calls is to use a va_copy: * * va_list tmpArgs; * * va_copy(tmpArgs, ap); * // Call the variadic function * va_end(tmpArgs); * */ #ifdef _WIN32 #include #endif #include #include #include #include "vmware.h" #include "str.h" #ifdef HAS_BSD_PRINTF #include "bsd_output.h" #endif #include "codeset.h" #if defined _WIN32 && !defined HAS_BSD_PRINTF #define vsnprintf _vsnprintf #endif #ifndef _WIN32 extern int vasprintf(char **ptr, const char *f, va_list arg); /* * Declare vswprintf on platforms where it's not known to exist. We know * it's available on glibc >= 2.2, FreeBSD >= 5.0, and all versions of * Solaris. * (Re: Solaris, vswprintf has been present since Solaris 8, and we only * support Solaris 9 and above, since that was the first release available * for x86, so we just assume it's already there.) * * XXX Str_Vsnwprintf and friends are still protected by _WIN32 and * glibc >= 2.2. I.e., even though they should be able to work on * FreeBSD 5.0+ and Solaris 8+, they aren't made available there. */ # if !(defined(__linux__) || \ (defined(__FreeBSD__) && (__FreeBSD_version >= 500000)) || \ defined(sun)) extern int vswprintf(wchar_t *wcs, size_t maxlen, const wchar_t *format, va_list args); # endif #endif // _WIN32 /* *---------------------------------------------------------------------- * * Str_Vsnprintf -- * * Compatibility wrapper b/w different libc versions * * Results: * * int - number of bytes stored in 'str' (not including NUL * terminate character), -1 on overflow (insufficient space for * NUL terminate is considered overflow) * * NB: on overflow the buffer WILL be NUL terminated at the last * UTF-8 code point boundary within the buffer's bounds. * * WARNING: See warning at the top of this file. * * Side effects: * None * *---------------------------------------------------------------------- */ int Str_Vsnprintf(char *str, // OUT size_t size, // IN const char *format, // IN va_list ap) // IN { int retval; ASSERT(str != NULL); ASSERT(format != NULL); #if defined HAS_BSD_PRINTF && !defined __ANDROID__ retval = bsd_vsnprintf(&str, size, format, ap); #else retval = vsnprintf(str, size, format, ap); #endif /* * Linux glibc 2.0.x returns -1 and NUL terminates (which we shouldn't * be linking against), but glibc 2.1.x follows c99 and returns * characters that would have been written. * * In the case of Win32 and !HAS_BSD_PRINTF, we are using * _vsnprintf(), which returns -1 on overflow, returns size * when result fits exactly, and does not NUL terminate in * those cases. */ if ((retval < 0) || (retval >= size)) { if (size > 0) { /* Find UTF-8 code point boundary and place NUL termination there */ int trunc = CodeSet_Utf8FindCodePointBoundary(str, size - 1); str[trunc] = '\0'; } } if (retval >= size) { return -1; } return retval; } #ifdef HAS_BSD_PRINTF /* *---------------------------------------------------------------------- * * Str_Sprintf_C_Locale -- * * sprintf wrapper that fails on overflow. Enforces numeric C locale. * * Results: * Returns the number of bytes stored in 'buf'. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Str_Sprintf_C_Locale(char *buf, // OUT: size_t maxSize, // IN: const char *fmt, // IN: ...) // IN: { va_list args; int retval; ASSERT(buf); ASSERT(fmt); va_start(args, fmt); retval = bsd_vsnprintf_c_locale(&buf, maxSize, fmt, args); va_end(args); if ((retval < 0) || (retval >= maxSize)) { if (maxSize > 0) { /* Find UTF-8 code point boundary and place NUL termination there */ int trunc = CodeSet_Utf8FindCodePointBoundary(buf, maxSize - 1); buf[trunc] = '\0'; } } if (retval >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } return retval; } #endif /* *---------------------------------------------------------------------- * * Str_Sprintf -- * * sprintf wrapper that fails on overflow * * Results: * Returns the number of bytes stored in 'buf'. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Str_Sprintf(char *buf, // OUT size_t maxSize, // IN const char *fmt, // IN ...) // IN { va_list args; int i; va_start(args, fmt); i = Str_Vsnprintf(buf, maxSize, fmt, args); va_end(args); if (i < 0) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } return i; } /* *---------------------------------------------------------------------- * * Str_Snprintf -- * * Compatibility wrapper b/w different libc versions * * Results: * * int - number of bytes stored in 'str' (not including NUL * terminate character), -1 on overflow (insufficient space for * NUL terminate is considered overflow) * * NB: on overflow the buffer WILL be NUL terminated * * Side effects: * None * *---------------------------------------------------------------------- */ int Str_Snprintf(char *str, // OUT size_t size, // IN const char *format, // IN ...) // IN { int retval; va_list args; ASSERT(str != NULL); ASSERT(format != NULL); va_start(args, format); retval = Str_Vsnprintf(str, size, format, args); va_end(args); return retval; } /* *---------------------------------------------------------------------- * * Str_Strcpy -- * * Wrapper for strcpy that checks for buffer overruns. * * Results: * Same as strcpy. * * Side effects: * None. * *---------------------------------------------------------------------- */ char * Str_Strcpy(char *buf, // OUT const char *src, // IN size_t maxSize) // IN { size_t len; ASSERT(buf != NULL); ASSERT(src != NULL); len = strlen(src); if (len >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } return memcpy(buf, src, len + 1); } /* *---------------------------------------------------------------------- * * Str_Strlen -- * * Calculate length of the string. * * Results: * Length of s not including the terminating '\0' character. * If there is no '\0' for first maxLen bytes, then it * returns maxLen. * * Side Effects: * None * *---------------------------------------------------------------------- */ size_t Str_Strlen(const char *s, // IN: size_t maxLen) // IN: { const char *end; ASSERT(s != NULL); if ((end = memchr(s, '\0', maxLen)) == NULL) { return maxLen; } return end - s; } /* *---------------------------------------------------------------------- * * Str_Strnstr -- * * Find a substring within a string of length at most n. 'sub' must be * NUL-terminated. 'n' is interpreted as an unsigned int. * * Results: * A pointer to the beginning of the substring, or NULL if not found. * * Side Effects: * None * *---------------------------------------------------------------------- */ char * Str_Strnstr(const char *src, // IN: const char *sub, // IN: size_t n) // IN: { size_t subLen; const char *end; ASSERT(src != NULL); ASSERT(sub != NULL); if ((subLen = strlen(sub)) == 0) { return (char *) src; } if ((end = memchr(src, '\0', n)) == NULL) { end = src + n; } end -= subLen - 1; if (end <= src) { return NULL; } for (; (src = memchr(src, sub[0], end - src)) != NULL && memcmp(src, sub, subLen) != 0; src++) { } return (char *) src; } /* *---------------------------------------------------------------------- * * Str_Strcat -- * * Wrapper for strcat that checks for buffer overruns. * * Results: * Same as strcat. * * Side effects: * None. * *---------------------------------------------------------------------- */ char * Str_Strcat(char *buf, // IN/OUT const char *src, // IN size_t maxSize) // IN { size_t bufLen; size_t srcLen; ASSERT(buf != NULL); ASSERT(src != NULL); bufLen = strlen(buf); srcLen = strlen(src); /* The first comparison checks for numeric overflow */ if (bufLen + srcLen < srcLen || bufLen + srcLen >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } memcpy(buf + bufLen, src, srcLen + 1); return buf; } /* *---------------------------------------------------------------------- * * Str_Strncat -- * * Wrapper for strncat that checks for buffer overruns. * * Specifically, this function will Panic if a buffer overrun would * have occurred. * * Results: * Same as strncat. * * Side effects: * None. * *---------------------------------------------------------------------- */ char * Str_Strncat(char *buf, // IN/OUT size_t bufSize, // IN: Size of buf const char *src, // IN: String to append size_t n) // IN: Max chars of src to append { size_t bufLen; ASSERT(buf != NULL); ASSERT(src != NULL); /* * Check bufLen + n first so we can avoid the second call to strlen * if possible. * * The reason the test with bufLen and n is >= rather than just > * is that strncat always NUL-terminates the resulting string, even * if it reaches the length limit n. This means that if it happens that * bufLen + n == bufSize, strncat will write a NUL terminator that * is outside of the buffer. Therefore, we make sure this does not * happen by adding the == case to the Panic test. */ bufLen = strlen(buf); if (bufLen + n >= bufSize && bufLen + strlen(src) >= bufSize) { Panic("%s:%d Buffer too small\n", __FILE__,__LINE__); } /* * We don't need to worry about NUL termination, because it's only * needed on overflow and we Panic above in that case. */ return strncat(buf, src, n); } /* *----------------------------------------------------------------------------- * * Str_Asprintf -- * * Same as Str_Vasprintf(), but parameters are passed inline * * Results: * Same as Str_Vasprintf() * * Side effects: * Same as Str_Vasprintf() * *----------------------------------------------------------------------------- */ char * Str_Asprintf(size_t *length, // OUT/OPT const char *format, // IN ...) // IN { va_list arguments; char *result; va_start(arguments, format); result = Str_Vasprintf(length, format, arguments); va_end(arguments); return result; } /* *----------------------------------------------------------------------------- * * Str_SafeAsprintf -- * * Same as Str_SafeVasprintf(), but parameters are passed inline * * Results: * Same as Str_SafeVasprintf() * * Side effects: * Same as Str_SafeVasprintf() * *----------------------------------------------------------------------------- */ char * Str_SafeAsprintf(size_t *length, // OUT/OPT const char *format, // IN ...) // IN { va_list arguments; char *result; va_start(arguments, format); result = Str_SafeVasprintf(length, format, arguments); va_end(arguments); return result; } /* *----------------------------------------------------------------------------- * * StrVasprintfInternal -- * * Allocate and format a string, using the GNU libc way to specify the * format (i.e. optionally allow the use of positional parameters) * * Results: * * The allocated string on success (if 'length' is not NULL, *length * is set to the length of the allocated string). * * ASSERTs or returns NULL on failure, depending on the value of * 'assertOnFailure'. * * WARNING: See warning at the top of this file. * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * StrVasprintfInternal(size_t *length, // OUT/OPT: const char *format, // IN: va_list arguments, // IN: Bool assertOnFailure) // IN: { char *buf = NULL; int ret; #if defined HAS_BSD_PRINTF && !defined __ANDROID__ ret = bsd_vsnprintf(&buf, 0, format, arguments); #elif !defined sun && !defined STR_NO_WIN32_LIBS ret = vasprintf(&buf, format, arguments); #else /* * Simple implementation of Str_Vasprintf when we we have vsnprintf * but not vasprintf (e.g. in Win32 or in drivers). We just fallback * to vsnprintf, doubling if we didn't have enough space. */ size_t bufSize = strlen(format); do { /* * Initial allocation of strlen(format) * 2. Should this be tunable? * XXX Yes, this could overflow and spin forever when you get near 2GB * allocations. I don't care. --rrdharan */ char *newBuf; va_list tmpArgs; bufSize *= 2; newBuf = realloc(buf, bufSize); if (!newBuf) { free(buf); buf = NULL; goto exit; } buf = newBuf; va_copy(tmpArgs, arguments); ret = Str_Vsnprintf(buf, bufSize, format, tmpArgs); va_end(tmpArgs); } while (ret < 0); #endif if (ret < 0) { buf = NULL; goto exit; } if (length != NULL) { *length = ret; } exit: if (assertOnFailure) { VERIFY(buf); } return buf; } /* *----------------------------------------------------------------------------- * * Str_Vasprintf -- * * See StrVasprintfInternal. * * Results: * Returns NULL on failure. * * WARNING: See warning at the top of this file. * * Side effects: * None *----------------------------------------------------------------------------- */ char * Str_Vasprintf(size_t *length, // OUT/OPT const char *format, // IN va_list arguments) // IN { return StrVasprintfInternal(length, format, arguments, FALSE); } /* *----------------------------------------------------------------------------- * * Str_SafeVasprintf -- * * See StrVasprintfInternal. * * Results: * Calls VERIFY on failure. * * WARNING: See warning at the top of this file. * * Side effects: * None * *----------------------------------------------------------------------------- */ char * Str_SafeVasprintf(size_t *length, // OUT/OPT const char *format, // IN va_list arguments) // IN { return StrVasprintfInternal(length, format, arguments, TRUE); } #if defined(_WIN32) || defined(__linux__) /* *---------------------------------------------------------------------- * * Str_Swprintf -- * * wsprintf wrapper that fails on overflow * * Results: * Returns the number of wchar_ts stored in 'buf'. * * Side effects: * None. * *---------------------------------------------------------------------- */ int Str_Swprintf(wchar_t *buf, // OUT size_t maxSize, // IN: Size of buf, in wide-characters. const wchar_t *fmt, // IN ...) // IN { va_list args; int i; va_start(args,fmt); i = Str_Vsnwprintf(buf, maxSize, fmt, args); va_end(args); if (i < 0) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } return i; } /* *---------------------------------------------------------------------- * * Str_Vsnwprintf -- * * Compatibility wrapper b/w different libc versions * * Results: * * int - number of wchar_ts stored in 'str' (not including NUL * terminate character), -1 on overflow (insufficient space for * NUL terminate is considered overflow) * * NB: on overflow the buffer WILL be NUL terminated * * WARNING: See warning at the top of this file. * * Side effects: * None * *---------------------------------------------------------------------- */ int Str_Vsnwprintf(wchar_t *str, // OUT size_t size, // IN: Size of str, in wide-characters. const wchar_t *format, // IN va_list ap) // IN { int retval; #if defined(HAS_BSD_WPRINTF) && HAS_BSD_WPRINTF retval = bsd_vsnwprintf(&str, size, format, ap); #elif defined(_WIN32) retval = _vsnwprintf(str, size, format, ap); #else retval = vswprintf(str, size, format, ap); #endif /* * Linux glibc 2.0.x returns -1 and NUL terminates (which we shouldn't * be linking against), but glibc 2.1.x follows c99 and returns * characters that would have been written. * * In the case of Win32 and !HAS_BSD_PRINTF, we are using * _vsnwprintf(), which returns -1 on overflow, returns size * when result fits exactly, and does not NUL terminate in * those cases. */ #if defined _WIN32 && !defined HAS_BSD_PRINTF if ((retval < 0 || retval >= size) && size > 0) { str[size - 1] = L'\0'; } #endif if (retval >= size) { return -1; } return retval; } /* *---------------------------------------------------------------------- * * Str_Snwprintf -- * * Compatibility wrapper b/w different libc versions * * Results: * * int - number of wchar_ts stored in 'str' (not including NUL * terminate character), -1 on overflow (insufficient space for * NUL terminate is considered overflow) * * NB: on overflow the buffer WILL be NUL terminated * * Side effects: * None * *---------------------------------------------------------------------- */ int Str_Snwprintf(wchar_t *str, // OUT size_t size, // IN: Size of str, in wide-characters. const wchar_t *format, // IN ...) // IN { int retval; va_list args; va_start(args, format); retval = Str_Vsnwprintf(str, size, format, args); va_end(args); return retval; } /* *---------------------------------------------------------------------- * * Str_Wcscpy -- * * Wrapper for wcscpy that checks for buffer overruns. * * Results: * Same as wcscpy. * * Side effects: * None. * *---------------------------------------------------------------------- */ wchar_t * Str_Wcscpy(wchar_t *buf, // OUT const wchar_t *src, // IN size_t maxSize) // IN: Size of buf, in wide-characters. { size_t len; len = wcslen(src); if (len >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } return memcpy(buf, src, (len + 1)*sizeof(wchar_t)); } /* *---------------------------------------------------------------------- * * Str_Wcscat -- * * Wrapper for wcscat that checks for buffer overruns. * * Results: * Same as wcscat. * * Side effects: * None. * *---------------------------------------------------------------------- */ wchar_t * Str_Wcscat(wchar_t *buf, // IN/OUT const wchar_t *src, // IN size_t maxSize) // IN: Size of buf, in wide-characters. { size_t bufLen; size_t srcLen; bufLen = wcslen(buf); srcLen = wcslen(src); /* The first comparison checks for numeric overflow */ if (bufLen + srcLen < srcLen || bufLen + srcLen >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } memcpy(buf + bufLen, src, (srcLen + 1)*sizeof(wchar_t)); return buf; } /* *---------------------------------------------------------------------- * * Str_Wcsncat -- * * Wrapper for wcsncat that checks for buffer overruns. * * Specifically, this function will Panic if a buffer overrun would * have occurred. * * Results: * Same as wcsncat. * * Side effects: * None. * *---------------------------------------------------------------------- */ wchar_t * Str_Wcsncat(wchar_t *buf, // IN/OUT size_t bufSize, // IN: Size of buf, in wide-characters. const wchar_t *src, // IN: String to append size_t n) // IN: Max chars of src to append { size_t bufLen = wcslen(buf); /* * Check bufLen + n first so we can avoid the second call to wcslen * if possible. * * The reason the test with bufLen and n is >= rather than just > * is that wcsncat always NUL-terminates the resulting string, even * if it reaches the length limit n. This means that if it happens that * bufLen + n == bufSize, wcsncat will write a NUL terminator that * is outside of the buffer. Therefore, we make sure this does not * happen by adding the == case to the Panic test. */ if (bufLen + n >= bufSize && bufLen + wcslen(src) >= bufSize) { Panic("%s:%d Buffer too small\n", __FILE__,__LINE__); } /* * We don't need to worry about NUL termination, because it's only * needed on overflow and we Panic above in that case. */ return wcsncat(buf, src, n); } /* *---------------------------------------------------------------------- * * Str_Mbscpy -- * * Wrapper for _mbscpy that checks for buffer overruns. * * Results: * Same as strcpy. * * Side effects: * None. * *---------------------------------------------------------------------- */ unsigned char * Str_Mbscpy(char *buf, // OUT const char *src, // IN size_t maxSize) // IN { size_t len; len = strlen(src); if (len >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } return memcpy(buf, src, len + 1); } /* *---------------------------------------------------------------------- * * Str_Mbscat -- * * Wrapper for _mbscat that checks for buffer overruns. * * The Microsoft _mbscat may or may not deal with tailing * partial multibyte sequence in buf. We don't. * * Results: * Same as strcat. * * Side effects: * None. * *---------------------------------------------------------------------- */ unsigned char * Str_Mbscat(char *buf, // IN/OUT const char *src, // IN size_t maxSize) // IN { size_t bufLen; size_t srcLen; bufLen = strlen(buf); srcLen = strlen(src); /* The first comparison checks for numeric overflow */ if (bufLen + srcLen < srcLen || bufLen + srcLen >= maxSize) { Panic("%s:%d Buffer too small\n", __FILE__, __LINE__); } memcpy(buf + bufLen, src, srcLen + 1); return (unsigned char *)buf; } /* *----------------------------------------------------------------------------- * * StrVaswprintfInternal -- * * Allocate and format a string. * * Results: * The allocated string on success (if 'length' is not NULL, *length * is set to the length of the allocated string, in wchat_ts) * * ASSERTs or returns NULL on failure, depending on the value of * 'assertOnFailure'. * * WARNING: See warning at the top of this file. * * Side effects: * None * *----------------------------------------------------------------------------- */ static wchar_t * StrVaswprintfInternal(size_t *length, // OUT/OPT: const wchar_t *format, // IN: va_list arguments, // IN Bool assertOnFailure) // IN { size_t bufSize; wchar_t *buf = NULL; int retval; bufSize = wcslen(format); do { /* * Initial allocation of wcslen(format) * 2. Should this be tunable? * XXX Yes, this could overflow and spin forever when you get near 2GB * allocations. I don't care. --rrdharan */ va_list tmpArgs; wchar_t *newBuf; bufSize *= 2; newBuf = realloc(buf, bufSize * sizeof(wchar_t)); if (!newBuf) { free(buf); buf = NULL; goto exit; } buf = newBuf; va_copy(tmpArgs, arguments); retval = Str_Vsnwprintf(buf, bufSize, format, tmpArgs); va_end(tmpArgs); } while (retval == -1); if (length) { *length = retval; } /* * Try to trim the buffer here to save memory? */ exit: if (assertOnFailure) { VERIFY(buf); } return buf; } /* *----------------------------------------------------------------------------- * * Str_Aswprintf -- * * Same as Str_Vaswprintf(), but parameters are passed inline. * * Results: * Same as Str_Vaswprintf() * * Side effects: * Same as Str_Vaswprintf() * *----------------------------------------------------------------------------- */ wchar_t * Str_Aswprintf(size_t *length, // OUT/OPT const wchar_t *format, // IN ...) // IN { va_list arguments; wchar_t *result; va_start(arguments, format); result = Str_Vaswprintf(length, format, arguments); va_end(arguments); return result; } /* *----------------------------------------------------------------------------- * * Str_Vaswprintf -- * * See StrVaswprintfInternal. * * Results: * Returns NULL on failure. * * WARNING: See warning at the top of this file. * * Side effects: * None * *----------------------------------------------------------------------------- */ wchar_t * Str_Vaswprintf(size_t *length, // OUT/OPT const wchar_t *format, // IN va_list arguments) // IN { return StrVaswprintfInternal(length, format, arguments, FALSE); } /* *----------------------------------------------------------------------------- * * Str_SafeAswprintf -- * * Same as Str_SafeVaswprintf(), but parameters are passed inline. * * Results: * Same as Str_SafeVaswprintf() * * Side effects: * Same as Str_SafeVaswprintf() * *----------------------------------------------------------------------------- */ wchar_t * Str_SafeAswprintf(size_t *length, // OUT/OPT const wchar_t *format, // IN ...) // IN { va_list arguments; wchar_t *result; va_start(arguments, format); result = Str_SafeVaswprintf(length, format, arguments); va_end(arguments); return result; } /* *----------------------------------------------------------------------------- * * Str_SafeVaswprintf -- * * See StrVaswprintfInternal. * * Results: * Calls VERIFY on failure. * * WARNING: See warning at the top of this file. * * Side effects: * None * *----------------------------------------------------------------------------- */ wchar_t * Str_SafeVaswprintf(size_t *length, // OUT/OPT const wchar_t *format, // IN va_list arguments) // IN { return StrVaswprintfInternal(length, format, arguments, TRUE); } #endif // defined(_WIN32) || defined(__linux__) #ifndef _WIN32 /* *----------------------------------------------------------------------------- * * Str_ToLower -- * * Convert a string to lowercase, in-place. Hand-rolled, for non-WIN32. * * Results: * * Returns the same pointer that was passed in. * * Side effects: * * See above. * *----------------------------------------------------------------------------- */ char * Str_ToLower(char *string) // IN { char *c = string; while (*c) { *c = (*c >= 'A' && *c <= 'Z') ? *c + ('a' - 'A') : *c; c++; } return string; } /* *----------------------------------------------------------------------------- * * Str_ToUpper -- * * Convert a string to uppercase, in-place. Hand-rolled, for non-WIN32. * * Results: * * Returns the same pointer that was passed in. * * Side effects: * * See above. * *----------------------------------------------------------------------------- */ char * Str_ToUpper(char *string) // IN { char *c = string; while (*c) { *c = (*c >= 'a' && *c <= 'z') ? *c - ('a' - 'A') : *c; c++; } return string; } #endif // !_WIN32 #if 0 /* * Unit tests. Compares our bsd_vs*printf code output to C-library * code output, where possible. */ static Bool bCompare; #define FAIL(s) \ do { \ printf("FAIL: %s\n", s); \ exit(1); \ } while (0); static void PrintAndCheck(char *fmt, // IN: ...) // IN: { char buf1[1024], buf2[1024]; int count; va_list args; va_start(args, fmt); count = Str_Vsnprintf(buf1, sizeof buf1, fmt, args); va_end(args); if (count < 0) { FAIL("PrintAndCheck new code count off"); } va_start(args, fmt); #ifdef _WIN32 count = _vsnprintf(buf2, sizeof buf2, fmt, args); #else count = vsnprintf(buf2, sizeof buf2, fmt, args); #endif va_end(args); if (count < 0) { FAIL("PrintAndCheck old code count off"); } if (bCompare && (0 != strcmp(buf1, buf2))) { printf("Format string: %s\n", fmt); printf("Our code: %s\n", buf1); printf("Sys code: %s\n", buf2); FAIL("PrintAndCheck compare failed"); } printf(buf1); } static void PrintAndCheckW(wchar_t *fmt, ...) { wchar_t buf1[1024], buf2[1024]; int count; va_list args; va_start(args, fmt); count = Str_Vsnwprintf(buf1, sizeof buf1, fmt, args); va_end(args); if (count < 0) { FAIL("PrintAndCheckW new code count off"); } va_start(args, fmt); #ifdef _WIN32 count = _vsnwprintf(buf2, sizeof buf2, fmt, args); #else count = vswprintf(buf2, sizeof buf2, fmt, args); #endif va_end(args); if (count < 0) { FAIL("PrintAndCheckW old code count off"); } if (bCompare && (0 != wcscmp(buf1, buf2))) { printf("Format string: %S", fmt); printf("Our code: %S", buf1); printf("Sys code: %S", buf2); FAIL("PrintAndCheckW compare failed"); } #ifndef _WIN32 printf("%S", buf1); #endif // _WIN32 } void Str_UnitTests(void) { char buf[1024]; wchar_t bufw[1024]; int count; int32 num1 = 0xDEADBEEF; int32 num2 = 0x927F82CD; int64 num3 = CONST64U(0xCAFEBABE42439021); #ifdef _WIN32 double num4 = 5.1923843; double num5 = 0.000482734; double num6 = 8274102.3872; #endif int numChars; char empty[1] = {'\0'}; wchar_t wempty[1] = {L'\0'}; /* test empty string */ count = Str_Snprintf(buf, 1, empty); if (0 != count) { FAIL("Failed empty string test"); } count = Str_Snwprintf(bufw, 1, wempty); if (0 != count) { FAIL("Failed empty string test (W)"); } /* test borderline overflow */ count = Str_Snprintf(buf, 2, "ba"); if (-1 != count) { FAIL("Failed borderline overflow test - count"); } if (buf[1]) { FAIL("Failed borderline overflow test - NULL term"); } count = Str_Snwprintf(bufw, 2, L"ba"); if (-1 != count) { FAIL("Failed borderline overflow test - count (W)"); } if (bufw[1]) { FAIL("Failed borderline overflow test - NULL term (W)"); } /* test egregious overflow */ count = Str_Snprintf(buf, 2, "baabaa"); if (-1 != count) { FAIL("Failed egregious overflow test - count"); } if (buf[1]) { FAIL("Failed egregious overflow test - NULL term"); } count = Str_Snwprintf(bufw, 2, L"baabaa"); if (-1 != count) { FAIL("Failed egregious overflow test - count (W)"); } if (bufw[1]) { FAIL("Failed egregious overflow test - NULL term (W)"); } /* test 'n' argument */ count = Str_Snprintf(buf, 1024, "foo %n\n", &numChars); if (-1 == count) { FAIL("Failed 'n' arg test - count"); } if (4 != numChars) { FAIL("Failed 'n' arg test - numChars"); } count = Str_Snwprintf(bufw, 1024, L"foo %n\n", &numChars); if (-1 == count) { FAIL("Failed 'n' arg test - count (W)"); } if (4 != numChars) { FAIL("Failed 'n' arg test - numChars (W)"); } bCompare = TRUE; // simple PrintAndCheck("hello\n"); PrintAndCheckW(L"hello\n"); // string arguments PrintAndCheck("whazz %s up %S doc\n", "hello", L"hello"); PrintAndCheckW(L"whazz %s up %S doc\n", L"hello", "hello"); // character arguments PrintAndCheck("whazz %c up %C doc\n", 'a', L'a'); PrintAndCheckW(L"whazz %c up %C doc\n", L'a', 'a'); // 32-bit integer arguments PrintAndCheck("%d %i %o %u %x %X\n", num1, num1, num1, num1, num1, num1); PrintAndCheckW(L"%d %i %o %u %x %X\n", num1, num1, num1, num1, num1, num1); // 'p' argument bCompare = FALSE; PrintAndCheck("%p\n", buf); PrintAndCheckW(L"%p\n", buf); bCompare = TRUE; // 64-bit bCompare = FALSE; PrintAndCheck("%LX %llX %qX\n", num3, num3, num3); PrintAndCheckW(L"%LX %llX %qX\n", num3, num3, num3); bCompare = TRUE; // more 64-bit #ifdef _WIN32 PrintAndCheck("%I64X\n", num3); PrintAndCheckW(L"%I64X\n", num3); #else PrintAndCheck("%LX\n", num3); PrintAndCheckW(L"%LX\n", num3); #endif #ifdef _WIN32 // exponent digits printed differs vs. POSIX // floating-point PrintAndCheck("%e %E %f %g %G\n", num4, num5, num6); PrintAndCheckW(L"%e %E %f %g %G\n", num4, num5, num6); #endif // positional arguments bCompare = FALSE; PrintAndCheck("%3$LX %1$x %2$x\n", num1, num2, num3); PrintAndCheckW(L"%3$LX %1$x %2$x\n", num1, num2, num3); bCompare = TRUE; #ifdef _WIN32 // exponent digits printed differs vs. POSIX // width and precision PrintAndCheck("%15.1g %20.2f %*.*f\n", num6, num6, 15, 3, num6); PrintAndCheckW(L"%15.1g %20.2f %*.*f\n", num6, num6, 15, 3, num6); #endif #ifdef _WIN32 // exponent digits printed differs vs. POSIX // flags PrintAndCheck("%-15e %+f %015g\n", num4, num5, num6); PrintAndCheckW(L"%-15e %+f %015g\n", num4, num5, num6); #endif #ifdef _WIN32 // exponent digits printed differs vs. POSIX // more flags PrintAndCheck("%#X %#E %#G\n", num1, num1, num1); PrintAndCheckW(L"%#X %#E %#G\n", num1, num1, num1); #endif } #endif // 0 open-vm-tools-10.0.7-3227872/lib/string/Makefile.in0000644000000000000000000004160612660700526020004 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ @USE_PRINTF_WRAPPERS_TRUE@am__append_1 = bsd_output_shared.c \ @USE_PRINTF_WRAPPERS_TRUE@ bsd_vsnprintf.c bsd_vsnwprintf.c subdir = lib/string DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libString_la_LIBADD = am__libString_la_SOURCES_DIST = bsd_output_shared.c bsd_vsnprintf.c \ bsd_vsnwprintf.c convertutf.c str.c @USE_PRINTF_WRAPPERS_TRUE@am__objects_1 = bsd_output_shared.lo \ @USE_PRINTF_WRAPPERS_TRUE@ bsd_vsnprintf.lo bsd_vsnwprintf.lo am_libString_la_OBJECTS = $(am__objects_1) convertutf.lo str.lo libString_la_OBJECTS = $(am_libString_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libString_la_SOURCES) DIST_SOURCES = $(am__libString_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libString.la libString_la_SOURCES = $(am__append_1) convertutf.c str.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/string/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/string/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libString.la: $(libString_la_OBJECTS) $(libString_la_DEPENDENCIES) $(LINK) $(libString_la_OBJECTS) $(libString_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_output_shared.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_vsnprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_vsnwprintf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convertutf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/string/bsd_vsnwprintf.c0000644000000000000000000014440012660700526021147 0ustar rootroot/* ********************************************************** * Copyright 2006 VMware, Inc. All rights reserved. * **********************************************************/ /*- * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * Note - this code originated as the file vfwprintf.c in the FreeBSD * source code, location src/lib/libc/stdio/vfwprintf.c, revision * 1.24. It has been borrowed and modified to act like vsnwprintf * instead. See bsd_output.h for more. * * If you care to compare, the original is checked into this directory * as bsd_vsnwprintf_orig.c. */ #if !defined(STR_NO_WIN32_LIBS) && !defined(__FreeBSD__) \ && !defined(__OpenBSD__) && !defined(__NetBSD__) /* * Actual wprintf innards. */ #include #include #include #include #include #include #include #include #include "vmware.h" #include "bsd_output_int.h" #include "msgfmt.h" #include "convertutf.h" typedef struct StrBuf { Bool alloc; Bool error; wchar_t *buf; size_t size; size_t index; } StrBuf; static int __sfvwrite(StrBuf *sbuf, BSDFmt_UIO *uio); static int __sprint(StrBuf *sbuf, BSDFmt_UIO *uio); static wchar_t *__ujtoa(uintmax_t, wchar_t *, int, int, const char *, int, char, const char *); static wchar_t *__ultoa(u_long, wchar_t *, int, int, const char *, int, char, const char *); static wchar_t *BSDFmt_UTF8ToWChar(const char *, int); static void __find_arguments(const wchar_t *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); static Bool isLenientConversion = TRUE; static int __sfvwrite(StrBuf *sbuf, BSDFmt_UIO *uio) { int i; BSDFmt_IOV *siov; /* * If aswprintf(), then grow the buffer as necessary. */ if (sbuf->alloc) { size_t n = sbuf->index + uio->uio_resid + 1; // +1 for \0 if (n > sbuf->size) { wchar_t *p; ASSERT(sbuf->size > 0); n = ROUNDUP(n, sbuf->size); if ((p = realloc(sbuf->buf, n * sizeof(wchar_t))) == NULL) { sbuf->error = TRUE; return 1; } sbuf->buf = p; sbuf->size = n; } } for (i = 0, siov = uio->uio_iov; i < uio->uio_iovcnt; i++, siov++) { int numToWrite; /* * Overflowing the buffer is not an error. * We just silently truncate because that's what snprintf() does. * * Always leave space for null termination. */ numToWrite = sbuf->size - sbuf->index - 1; // -1 for \0 if (numToWrite > siov->iov_len) { numToWrite = siov->iov_len; } memcpy(sbuf->buf + sbuf->index, siov->iov_base, numToWrite * sizeof(wchar_t)); sbuf->index += numToWrite; } return 0; } /* * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. */ static int __sprint(StrBuf *sbuf, BSDFmt_UIO *uio) { int err; if (uio->uio_resid == 0) { uio->uio_iovcnt = 0; return (0); } err = __sfvwrite(sbuf, uio); uio->uio_resid = 0; uio->uio_iovcnt = 0; return err; } /* * Convert an unsigned long to ASCII for printf purposes, returning * a pointer to the first character of the string representation. * Octal numbers can be forced to have a leading zero; hex numbers * use the given digits. */ static wchar_t * __ultoa(u_long val, wchar_t *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; long sval; int ndig; /* * Handle the three cases separately, in the hope of getting * better/faster code. */ switch (base) { case 10: if (val < 10) { /* many numbers are 1 digit */ *--cp = to_char(val); return (cp); } ndig = 0; /* * On many machines, unsigned arithmetic is harder than * signed arithmetic, so we do at most one unsigned mod and * divide; this is sufficient to reduce the range of * the incoming value to where signed arithmetic works. */ if (val > LONG_MAX) { *--cp = to_char(val % 10); ndig++; sval = val / 10; } else sval = val; do { *--cp = to_char(sval % 10); ndig++; /* * If (*grp == CHAR_MAX) then no more grouping * should be performed. */ if (needgrp && ndig == *grp && *grp != CHAR_MAX && sval > 9) { *--cp = thousep; ndig = 0; /* * If (*(grp+1) == '\0') then we have to * use *grp character (last grouping rule) * for all next cases */ if (*(grp+1) != '\0') grp++; } sval /= 10; } while (sval != 0); break; case 8: do { *--cp = to_char(val & 7); val >>= 3; } while (val); if (octzero && *cp != '0') *--cp = '0'; break; case 16: do { *--cp = xdigs[val & 15]; val >>= 4; } while (val); break; default: /* oops */ abort(); } return (cp); } /* Identical to __ultoa, but for intmax_t. */ static wchar_t * __ujtoa(uintmax_t val, wchar_t *endp, int base, int octzero, const char *xdigs, int needgrp, char thousep, const char *grp) { wchar_t *cp = endp; intmax_t sval; int ndig; /* quick test for small values; __ultoa is typically much faster */ /* (perhaps instead we should run until small, then call __ultoa?) */ if (val <= ULONG_MAX) return (__ultoa((u_long)val, endp, base, octzero, xdigs, needgrp, thousep, grp)); switch (base) { case 10: if (val < 10) { *--cp = to_char(val % 10); return (cp); } ndig = 0; if (val > INTMAX_MAX) { *--cp = to_char(val % 10); ndig++; sval = val / 10; } else sval = val; do { *--cp = to_char(sval % 10); ndig++; /* * If (*grp == CHAR_MAX) then no more grouping * should be performed. */ if (needgrp && *grp != CHAR_MAX && ndig == *grp && sval > 9) { *--cp = thousep; ndig = 0; /* * If (*(grp+1) == '\0') then we have to * use *grp character (last grouping rule) * for all next cases */ if (*(grp+1) != '\0') grp++; } sval /= 10; } while (sval != 0); break; case 8: do { *--cp = to_char(val & 7); val >>= 3; } while (val); if (octzero && *cp != '0') *--cp = '0'; break; case 16: do { *--cp = xdigs[val & 15]; val >>= 4; } while (val); break; default: abort(); } return (cp); } /* * Convert a UTF-8 string argument to a wide-character string * representation. If not -1, 'prec' specifies the maximum number of * wide characters to output. The returned string is always NUL-terminated, * even if that results in the string exceeding 'prec' characters. */ wchar_t * BSDFmt_UTF8ToWChar(const char *arg, // IN int prec) // IN { ConversionResult cres; const char *sourceStart, *sourceEnd; wchar_t *targStart, *targEnd; wchar_t *targ = NULL; /* * targSize and sourceSize are measured in wchar_t units, excluding NUL. */ size_t targSize; size_t sourceSize = strlen(arg); ASSERT(prec == -1 || prec >= 0); targSize = sourceSize; if (prec >= 0) { targSize = MIN(targSize, prec); } while (TRUE) { /* * Pad by 1 because we need to NUL-terminate. */ wchar_t *oldTarg = targ; targ = realloc(oldTarg, (targSize + 1) * sizeof *targ); if (!targ) { free(oldTarg); goto exit; } targStart = targ; targEnd = targStart + targSize; sourceStart = arg; sourceEnd = sourceStart + sourceSize; if (2 == sizeof(wchar_t)) { cres = ConvertUTF8toUTF16((const UTF8 **) &sourceStart, (const UTF8 *) sourceEnd, (UTF16 **) &targStart, (UTF16 *) targEnd, isLenientConversion); } else if (4 == sizeof(wchar_t)) { cres = ConvertUTF8toUTF32((const UTF8 **) &sourceStart, (const UTF8 *) sourceEnd, (UTF32 **) &targStart, (UTF32 *) targEnd, isLenientConversion); } else { NOT_IMPLEMENTED(); } if (targetExhausted == cres) { if (targSize == prec) { /* * We've got all the caller wants. */ break; } else { /* * Grow the buffer. */ ASSERT(FALSE); targSize *= 2; if (prec >= 0) { targSize = MIN(targSize, prec); } } } else if ((sourceExhausted == cres) || (sourceIllegal == cres)) { /* * If lenient, the API converted all it could, so just * proceed, otherwise, barf. */ if (isLenientConversion) { break; } else { free(targ); targ = NULL; goto exit; } } else if (conversionOK == cres) { break; } else { NOT_IMPLEMENTED(); } } /* * Success, NUL-terminate. (The API updated targStart for us). */ ASSERT(targStart <= targEnd); *targStart = L'\0'; exit: return targ; } #ifndef NO_FLOATING_POINT static int exponent(wchar_t *, int, wchar_t); #endif /* !NO_FLOATING_POINT */ int bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, va_list ap) { wchar_t *fmt; /* format string */ wchar_t ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ BSDFmt_IOV *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ int prec; /* precision from format; <0 for N/A */ wchar_t sign; /* sign prefix (' ', '+', '-', or \0) */ wchar_t thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ #ifndef NO_FLOATING_POINT /* * We can decompose the printed representation of floating * point numbers into several parts, some of which may be empty: * * [+|-| ] [0x|0X] MMM . NNN [e|E|p|P] [+|-] ZZ * A B ---C--- D E F * * A: 'sign' holds this value if present; '\0' otherwise * B: ox[1] holds the 'x' or 'X'; '\0' if not hexadecimal * C: cp points to the string MMMNNN. Leading and trailing * zeros are not in the string and must be added. * D: expchar holds this character; '\0' if no exponent, e.g. %f * F: at least two digits for decimal, at least one digit for hex */ char *decimal_point; /* locale specific decimal point */ int signflag; /* true if float is negative */ union { /* floating point arguments %[aAeEfFgG] */ double dbl; long double ldbl; } fparg; int expt; /* integer value of exponent */ char expchar; /* exponent character: [eEpP\0] */ char *dtoaend; /* pointer to end of converted digits */ int expsize; /* character count for expstr */ int lead; /* sig figs before decimal or group sep */ int ndig; /* actual number of digits returned by dtoa */ wchar_t expstr[MAXEXPDIG+2]; /* buffer for exponent string: e+ZZZ */ char *dtoaresult; /* buffer allocated by dtoa */ int nseps; /* number of group separators with ' */ int nrepeats; /* number of repeats of the last group */ #endif u_long ulval; /* integer arguments %[diouxX] */ uintmax_t ujval; /* %j, %ll, %q, %t, %z integers */ int base; /* base for [diouxX] conversion */ int dprec; /* a copy of prec if [diouxX], 0 otherwise */ int realsz; /* field size expanded by dprec, sign, etc */ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for [xX] conversion */ BSDFmt_UIO uio; /* output information: summary */ BSDFmt_IOV iov[BSDFMT_NIOV]; /* ... and individual io vectors */ wchar_t buf[INT_CONV_BUF]; /* buffer with space for digits of uintmax_t */ wchar_t ox[2]; /* space for 0x hex-prefix */ union arg *argtable; /* args, built due to positional arg */ union arg statargtable [STATIC_ARG_TBL_SIZE]; int nextarg; /* 1-based argument index */ wchar_t *convbuf; /* multibyte to wide conversion result */ #ifndef _WIN32 va_list orgap; #endif StrBuf sbuf; /* * Choose PADSIZE to trade efficiency vs. size. If larger printf * fields occur frequently, increase PADSIZE and make the initialisers * below longer. */ #define PADSIZE 16 /* pad chunk size */ static wchar_t blanks[PADSIZE] = {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; static wchar_t zeroes[PADSIZE] = {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; static const char xdigs_lower[16] = "0123456789abcdef"; static const char xdigs_upper[16] = "0123456789ABCDEF"; /* * BEWARE, these `goto error' on error, PRINT uses `n2' and * PAD uses `n'. */ /* * BEWARE, these `goto error' on error, and PAD uses `n'. */ #define PRINT(ptr, len) { \ iovp->iov_base = (ptr); \ iovp->iov_len = len; \ uio.uio_resid += len; \ iovp++; \ if (++uio.uio_iovcnt >= BSDFMT_NIOV) { \ if (__sprint(&sbuf, &uio)) \ goto error; \ iovp = iov; \ } \ } #define PAD(howmany, with) do { \ if ((n = (howmany)) > 0) { \ while (n > PADSIZE) { \ PRINT(with, PADSIZE); \ n -= PADSIZE; \ } \ PRINT(with, n); \ } \ } while (0) #define PRINTANDPAD(p, ep, len, with) do { \ n2 = (ep) - (p); \ if (n2 > (len)) \ n2 = (len); \ if (n2 > 0) \ PRINT((p), n2); \ PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ } while(0) #define FLUSH() { \ if (uio.uio_resid && __sprint(&sbuf, &uio)) \ goto error; \ uio.uio_iovcnt = 0; \ iovp = iov; \ } /* * Get the argument indexed by nextarg. If the argument table is * built, use it to get the argument. If its not, get the next * argument (and arguments must be gotten sequentially). */ #define GETARG(type) \ ((argtable != NULL) ? *((type*)(&argtable[nextarg++])) : \ (nextarg++, va_arg(ap, type))) /* * To extend shorts properly, we need both signed and unsigned * argument extraction methods. */ #define SARG() \ (flags&LONGINT ? GETARG(long) : \ flags&SHORTINT ? (long)(short)GETARG(int) : \ flags&CHARINT ? (long)(signed char)GETARG(int) : \ (long)GETARG(int)) #define UARG() \ (flags&LONGINT ? GETARG(u_long) : \ flags&SHORTINT ? (u_long)(u_short)GETARG(int) : \ flags&CHARINT ? (u_long)(u_char)GETARG(int) : \ (u_long)GETARG(u_int)) #define INTMAX_SIZE (INTMAXT|SIZET|PTRDIFFT|LLONGINT) #define SJARG() \ (flags&INTMAXT ? GETARG(intmax_t) : \ flags&SIZET ? (intmax_t)GETARG(size_t) : \ flags&PTRDIFFT ? (intmax_t)GETARG(ptrdiff_t) : \ (intmax_t)GETARG(long long)) #define UJARG() \ (flags&INTMAXT ? GETARG(uintmax_t) : \ flags&SIZET ? (uintmax_t)GETARG(size_t) : \ flags&PTRDIFFT ? (uintmax_t)GETARG(ptrdiff_t) : \ (uintmax_t)GETARG(unsigned long long)) /* * Get * arguments, including the form *nn$. Preserve the nextarg * that the argument can be gotten once the type is determined. */ #define GETASTER(val) \ n2 = 0; \ cp = fmt; \ while (is_digit(*cp)) { \ n2 = 10 * n2 + to_digit(*cp); \ cp++; \ } \ if (*cp == '$') { \ int hold = nextarg; \ nextarg = n2; \ val = GETARG (int); \ nextarg = hold; \ fmt = ++cp; \ } else { \ val = GETARG (int); \ } /* * Windows can't scan the args twice, so always build argtable. * Otherwise, do it when we see an n$ argument. */ #ifndef _WIN32 #define FIND_ARGUMENTS() \ (argtable == NULL ? \ (argtable = statargtable, \ __find_arguments(fmt0, orgap, &argtable)) : \ (void) 0) #else #define FIND_ARGUMENTS() \ ASSERT(argtable != NULL) #endif xdigs = xdigs_lower; thousands_sep = L'\0'; grouping = NULL; #ifndef NO_FLOATING_POINT decimal_point = localeconv()->decimal_point; #endif convbuf = NULL; fmt = (wchar_t *)fmt0; argtable = NULL; nextarg = 1; argtable = statargtable; #ifndef _WIN32 argtable = NULL; va_copy(orgap, ap); #else argtable = statargtable; __find_arguments (fmt0, ap, &argtable); #endif uio.uio_iov = iovp = iov; uio.uio_resid = 0; uio.uio_iovcnt = 0; ret = 0; /* * Set up output string buffer structure. */ sbuf.alloc = *outBuf == NULL; sbuf.error = FALSE; sbuf.buf = *outBuf; sbuf.size = bufSize; sbuf.index = 0; /* * If aswprintf(), allocate initial buffer based on format length. * Empty format only needs one byte. * Otherwise, round up to multiple of 64. */ if (sbuf.alloc) { size_t n = wcslen(fmt0) + 1; // +1 for \0 if (n > 1) { n = ROUNDUP(n, 64); } if ((sbuf.buf = malloc(n * sizeof (wchar_t))) == NULL) { sbuf.error = TRUE; goto error; } sbuf.size = n; } // shut compile up #ifndef NO_FLOATING_POINT expchar = 0; expsize = 0; lead = 0; ndig = 0; nseps = 0; nrepeats = 0; #endif ulval = 0; ujval = 0; /* * Scan the format for conversions (`%' character). */ for (;;) { for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) /* void */; if ((n = fmt - cp) != 0) { if ((unsigned)ret + n > INT_MAX) { ret = EOF; goto error; } PRINT(cp, n); ret += n; } if (ch == '\0') goto done; fmt++; /* skip over '%' */ flags = 0; dprec = 0; width = 0; prec = -1; sign = '\0'; ox[1] = '\0'; rflag: ch = *fmt++; reswitch: switch (ch) { case ' ': /*- * ``If the space and + flags both appear, the space * flag will be ignored.'' * -- ANSI X3J11 */ if (!sign) sign = ' '; goto rflag; case '#': flags |= ALT; goto rflag; case '*': /*- * ``A negative field width argument is taken as a * - flag followed by a positive field width.'' * -- ANSI X3J11 * They don't exclude field widths read from args. */ GETASTER (width); if (width >= 0) goto rflag; width = -width; /* FALLTHROUGH */ case '-': flags |= LADJUST; goto rflag; case '+': sign = '+'; goto rflag; case '\'': flags |= GROUPING; thousands_sep = (wchar_t) *(localeconv()->thousands_sep); grouping = localeconv()->grouping; /* * Grouping should not begin with 0, but it nevertheless * does (see bug 281072) and makes the formatting code * behave badly, so we fix it up. */ if (grouping != NULL && *grouping == '\0') { static char g[] = { CHAR_MAX, '\0' }; grouping = g; } goto rflag; case '.': if ((ch = *fmt++) == '*') { GETASTER (prec); goto rflag; } prec = 0; while (is_digit(ch)) { prec = 10 * prec + to_digit(ch); ch = *fmt++; } goto reswitch; case '0': /*- * ``Note that 0 is taken as a flag, not as the * beginning of a field width.'' * -- ANSI X3J11 */ flags |= ZEROPAD; goto rflag; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = 0; do { n = 10 * n + to_digit(ch); ch = *fmt++; } while (is_digit(ch)); if (ch == '$') { nextarg = n; FIND_ARGUMENTS(); goto rflag; } width = n; goto reswitch; case 'h': if (flags & SHORTINT) { flags &= ~SHORTINT; flags |= CHARINT; } else flags |= SHORTINT; goto rflag; case 'j': flags |= INTMAXT; goto rflag; case 'I': /* could be I64 - long long int is 64bit */ if (fmt[0] == '6' && fmt[1] == '4') { fmt += 2; flags |= LLONGINT; goto rflag; } /* could be I32 - normal int is 32bit */ if (fmt[0] == '3' && fmt[1] == '2') { fmt += 2; /* flags |= normal integer - it is 32bit for all our targets */ goto rflag; } /* * I alone - use Microsoft's semantic as size_t modifier. We do * not support glibc's semantic to use alternative digits. */ flags |= SIZET; goto rflag; case 'l': if (flags & LONGINT) { flags &= ~LONGINT; flags |= LLONGINT; } else flags |= LONGINT; goto rflag; case 'L': case 'q': flags |= LLONGINT; /* not necessarily */ goto rflag; case 't': flags |= PTRDIFFT; goto rflag; case 'Z': case 'z': flags |= SIZET; goto rflag; case 'C': flags |= LONGINT; /*FALLTHROUGH*/ case 'c': if (flags & LONGINT) *(cp = buf) = (wchar_t)GETARG(wint_t); else *(cp = buf) = (wchar_t)bsd_btowc(GETARG(int)); size = 1; sign = '\0'; break; case 'D': flags |= LONGINT; /*FALLTHROUGH*/ case 'd': case 'i': if (flags & INTMAX_SIZE) { ujval = SJARG(); if ((intmax_t)ujval < 0) { ujval = -ujval; sign = '-'; } } else { ulval = SARG(); if ((long)ulval < 0) { ulval = -ulval; sign = '-'; } } base = 10; goto number; #ifndef NO_FLOATING_POINT case 'e': case 'E': expchar = ch; if (prec < 0) /* account for digit before decpt */ prec = DEFPREC + 1; else prec++; goto fp_begin; case 'f': case 'F': expchar = '\0'; goto fp_begin; case 'g': case 'G': expchar = ch - ('g' - 'e'); if (prec == 0) prec = 1; fp_begin: if (prec < 0) prec = DEFPREC; if (convbuf != NULL) free(convbuf); if (flags & LLONGINT) { fparg.ldbl = GETARG(long double); dtoaresult = ldtoa(&fparg.ldbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend); } else { fparg.dbl = GETARG(double); dtoaresult = dtoa(fparg.dbl, expchar ? 2 : 3, prec, &expt, &signflag, &dtoaend); if (expt == 9999) expt = INT_MAX; } ndig = dtoaend - dtoaresult; cp = convbuf = BSDFmt_UTF8ToWChar(dtoaresult, -1); freedtoa(dtoaresult); if (signflag) sign = '-'; if (expt == INT_MAX) { /* inf or nan */ if (*cp == 'N') { cp = (ch >= 'a') ? L"nan" : L"NAN"; sign = '\0'; } else cp = (ch >= 'a') ? L"inf" : L"INF"; size = 3; break; } flags |= FPT; if (ch == 'g' || ch == 'G') { if (expt > -4 && expt <= prec) { /* Make %[gG] smell like %[fF] */ expchar = '\0'; if (flags & ALT) prec -= expt; else prec = ndig - expt; if (prec < 0) prec = 0; } else { /* * Make %[gG] smell like %[eE], but * trim trailing zeroes if no # flag. */ if (!(flags & ALT)) prec = ndig; } } if (expchar) { expsize = exponent(expstr, expt - 1, expchar); size = expsize + prec; if (prec > 1 || flags & ALT) ++size; } else { /* space for digits before decimal point */ if (expt > 0) size = expt; else /* "0" */ size = 1; /* space for decimal pt and following digits */ if (prec || flags & ALT) size += prec + 1; if (grouping && expt > 0) { /* space for thousands' grouping */ nseps = nrepeats = 0; lead = expt; while (*grouping != CHAR_MAX) { if (lead <= *grouping) break; lead -= *grouping; if (*(grouping+1)) { nseps++; grouping++; } else nrepeats++; } size += nseps + nrepeats; } else lead = expt; } break; #endif /* !NO_FLOATING_POINT */ case 'n': /* * Assignment-like behavior is specified if the * value overflows or is otherwise unrepresentable. * C99 says to use `signed char' for %hhn conversions. */ if (flags & LLONGINT) *GETARG(long long *) = ret; else if (flags & SIZET) *GETARG(size_t *) = (size_t)ret; else if (flags & PTRDIFFT) *GETARG(ptrdiff_t *) = ret; else if (flags & INTMAXT) *GETARG(intmax_t *) = ret; else if (flags & LONGINT) *GETARG(long *) = ret; else if (flags & SHORTINT) *GETARG(short *) = ret; else if (flags & CHARINT) *GETARG(signed char *) = ret; else *GETARG(int *) = ret; continue; /* no output */ case 'O': flags |= LONGINT; /*FALLTHROUGH*/ case 'o': if (flags & INTMAX_SIZE) ujval = UJARG(); else ulval = UARG(); base = 8; goto nosign; case 'p': /*- * ``The argument shall be a pointer to void. The * value of the pointer is converted to a sequence * of printable characters, in an implementation- * defined manner.'' * -- ANSI X3J11 */ ujval = (uintmax_t)(uintptr_t)GETARG(void *); base = 16; xdigs = xdigs_lower; flags = flags | INTMAXT; /* * PR 103201 * VisualC sscanf doesn't grok '0x', so prefix zeroes. */ // ox[1] = 'x'; goto nosign; case 'S': flags |= LONGINT; /*FALLTHROUGH*/ case 's': if (flags & LONGINT) { /* Argument is wchar_t * */ if ((cp = GETARG(wchar_t *)) == NULL) cp = L"(null)"; } else { char *mbp; /* Argument is char * */ if (convbuf!= NULL) free(convbuf); if ((mbp = GETARG(char *)) == NULL) cp = L"(null)"; else { convbuf = BSDFmt_UTF8ToWChar(mbp, prec); if (convbuf == NULL) { sbuf.error = TRUE; goto error; } cp = convbuf; } } if (prec >= 0) { /* * can't use wcslen; can only look for the * NUL in the first `prec' characters, and * wcslen() will go further. */ wchar_t *p = (wchar_t *) wmemchr(cp, 0, (size_t)prec); if (p != NULL) { size = p - cp; if (size > prec) size = prec; } else size = prec; } else size = wcslen(cp); sign = '\0'; break; case 'U': flags |= LONGINT; /*FALLTHROUGH*/ case 'u': if (flags & INTMAX_SIZE) ujval = UJARG(); else ulval = UARG(); base = 10; goto nosign; case 'X': xdigs = xdigs_upper; goto hex; case 'x': xdigs = xdigs_lower; hex: if (flags & INTMAX_SIZE) ujval = UJARG(); else ulval = UARG(); base = 16; /* leading 0x/X only if non-zero */ if (flags & ALT && (flags & INTMAX_SIZE ? ujval != 0 : ulval != 0)) ox[1] = ch; flags &= ~GROUPING; /* unsigned conversions */ nosign: sign = '\0'; /*- * ``... diouXx conversions ... if a precision is * specified, the 0 flag will be ignored.'' * -- ANSI X3J11 */ number: if ((dprec = prec) >= 0) flags &= ~ZEROPAD; /*- * ``The result of converting a zero value with an * explicit precision of zero is no characters.'' * -- ANSI X3J11 * * ``The C Standard is clear enough as is. The call * printf("%#.0o", 0) should print 0.'' * -- Defect Report #151 */ cp = buf + INT_CONV_BUF; if (flags & INTMAX_SIZE) { if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) cp = __ujtoa(ujval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, grouping); } else { if (ulval != 0 || prec != 0 || (flags & ALT && base == 8)) cp = __ultoa(ulval, cp, base, flags & ALT, xdigs, flags & GROUPING, thousands_sep, grouping); } size = buf + INT_CONV_BUF - cp; if (size > INT_CONV_BUF) /* should never happen */ abort(); break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') goto done; /* pretend it was %c with argument ch */ cp = buf; *cp = ch; size = 1; sign = '\0'; break; } /* * All reasonable formats wind up here. At this point, `cp' * points to a string which (if not flags&LADJUST) should be * padded out to `width' places. If flags&ZEROPAD, it should * first be prefixed by any sign or other prefix; otherwise, * it should be blank padded before the prefix is emitted. * After any left-hand padding and prefixing, emit zeroes * required by a decimal [diouxX] precision, then print the * string proper, then emit zeroes required by any leftover * floating precision; finally, if LADJUST, pad with blanks. * * Compute actual size, so we know how much to pad. * size excludes decimal prec; realsz includes it. */ realsz = dprec > size ? dprec : size; if (sign) realsz++; if (ox[1]) realsz += 2; prsize = width > realsz ? width : realsz; if ((unsigned)ret + prsize > INT_MAX) { ret = EOF; goto error; } /* right-adjusting blank padding */ if ((flags & (LADJUST|ZEROPAD)) == 0) PAD(width - realsz, blanks); /* prefix */ if (sign) PRINT(&sign, 1); if (ox[1]) { /* ox[1] is either x, X, or \0 */ ox[0] = '0'; PRINT(ox, 2); } /* right-adjusting zero padding */ if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) PAD(width - realsz, zeroes); /* leading zeroes from decimal precision */ PAD(dprec - size, zeroes); /* the string or number proper */ #ifndef NO_FLOATING_POINT if ((flags & FPT) == 0) { PRINT(cp, size); } else { /* glue together f_p fragments */ if (!expchar) { /* %[fF] or sufficiently short %[gG] */ if (expt <= 0) { PRINT(zeroes, 1); if (prec || flags & ALT) { buf[0] = (wchar_t) *decimal_point; PRINT(buf, 1); } PAD(-expt, zeroes); /* already handled initial 0's */ prec += expt; } else { PRINTANDPAD(cp, convbuf + ndig, lead, zeroes); cp += lead; if (grouping) { while (nseps>0 || nrepeats>0) { if (nrepeats > 0) nrepeats--; else { grouping--; nseps--; } PRINT(&thousands_sep, 1); PRINTANDPAD(cp, convbuf + ndig, *grouping, zeroes); cp += *grouping; } if (cp > convbuf + ndig) cp = convbuf + ndig; } if (prec || flags & ALT) { buf[0] = (wchar_t) *decimal_point; PRINT(buf, 1); } } PRINTANDPAD(cp, convbuf + ndig, prec, zeroes); } else { /* %[eE] or sufficiently long %[gG] */ if (prec > 1 || flags & ALT) { buf[0] = *cp++; buf[1] = (wchar_t) *decimal_point; PRINT(buf, 2); PRINT(cp, ndig-1); PAD(prec - ndig, zeroes); } else /* XeYYY */ PRINT(cp, 1); PRINT(expstr, expsize); } } #else PRINT(cp, size); #endif /* left-adjusting padding (always blank) */ if (flags & LADJUST) PAD(width - realsz, blanks); /* finally, adjust ret */ ret += prsize; FLUSH(); /* copy out the I/O vectors */ } done: FLUSH(); /* * Always null terminate, unless buffer is size 0. */ ASSERT(!sbuf.error && ret >= 0); if (sbuf.size <= 0) { ASSERT(!sbuf.alloc); } else { ASSERT(sbuf.index < sbuf.size); sbuf.buf[sbuf.index] = L'\0'; } error: #ifndef _WIN32 va_end(orgap); #endif if (convbuf != NULL) free(convbuf); if (sbuf.error) ret = EOF; if ((argtable != NULL) && (argtable != statargtable)) free (argtable); return (ret); /* NOTREACHED */ #undef FIND_ARGUMENTS } /* * Find all arguments when a positional parameter is encountered. Returns a * table, indexed by argument number, of pointers to each arguments. The * initial argument table should be an array of STATIC_ARG_TBL_SIZE entries. * It will be replaces with a malloc-ed one if it overflows. */static void __find_arguments (const wchar_t *fmt0, va_list ap, union arg **argtable) { wchar_t *fmt; /* format string */ wchar_t ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ int flags; /* flags as above */ enum typeid *typetable; /* table of types */ enum typeid stattypetable [STATIC_ARG_TBL_SIZE]; int tablesize; /* current size of type table */ int tablemax; /* largest used index in table */ int nextarg; /* 1-based argument index */ /* * Add an argument type to the table, expanding if necessary. */ #define ADDTYPE(type) \ ((nextarg >= tablesize) ? \ __grow_type_table(nextarg, &typetable, &tablesize) : (void)0, \ (nextarg > tablemax) ? tablemax = nextarg : 0, \ typetable[nextarg++] = type) #define ADDSARG() \ ((flags&INTMAXT) ? ADDTYPE(T_INTMAXT) : \ ((flags&SIZET) ? ADDTYPE(T_SIZET) : \ ((flags&PTRDIFFT) ? ADDTYPE(T_PTRDIFFT) : \ ((flags&LLONGINT) ? ADDTYPE(T_LLONG) : \ ((flags&LONGINT) ? ADDTYPE(T_LONG) : ADDTYPE(T_INT)))))) #define ADDUARG() \ ((flags&INTMAXT) ? ADDTYPE(T_UINTMAXT) : \ ((flags&SIZET) ? ADDTYPE(T_SIZET) : \ ((flags&PTRDIFFT) ? ADDTYPE(T_PTRDIFFT) : \ ((flags&LLONGINT) ? ADDTYPE(T_U_LLONG) : \ ((flags&LONGINT) ? ADDTYPE(T_U_LONG) : ADDTYPE(T_U_INT)))))) /* * Add * arguments to the type array. */ #define ADDASTER() \ n2 = 0; \ cp = fmt; \ while (is_digit(*cp)) { \ n2 = 10 * n2 + to_digit(*cp); \ cp++; \ } \ if (*cp == '$') { \ int hold = nextarg; \ nextarg = n2; \ ADDTYPE (T_INT); \ nextarg = hold; \ fmt = ++cp; \ } else { \ ADDTYPE (T_INT); \ } fmt = (wchar_t *)fmt0; typetable = stattypetable; tablesize = STATIC_ARG_TBL_SIZE; tablemax = 0; nextarg = 1; for (n = 0; n < STATIC_ARG_TBL_SIZE; n++) typetable[n] = T_UNUSED; /* * Scan the format for conversions (`%' character). */ for (;;) { for (cp = fmt; (ch = *fmt) != '\0' && ch != '%'; fmt++) /* void */; if (ch == '\0') goto done; fmt++; /* skip over '%' */ flags = 0; rflag: ch = *fmt++; reswitch: switch (ch) { case ' ': case '#': goto rflag; case '*': ADDASTER (); goto rflag; case '-': case '+': case '\'': goto rflag; case '.': if ((ch = *fmt++) == '*') { ADDASTER (); goto rflag; } while (is_digit(ch)) { ch = *fmt++; } goto reswitch; case '0': goto rflag; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': n = 0; do { n = 10 * n + to_digit(ch); ch = *fmt++; } while (is_digit(ch)); if (ch == '$') { nextarg = n; goto rflag; } goto reswitch; case 'h': if (flags & SHORTINT) { flags &= ~SHORTINT; flags |= CHARINT; } else flags |= SHORTINT; goto rflag; case 'j': flags |= INTMAXT; goto rflag; case 'I': /* could be I64 - long long int is 64bit */ if (fmt[0] == '6' && fmt[1] == '4') { fmt += 2; flags |= LLONGINT; goto rflag; } /* could be I32 - normal int is 32bit */ if (fmt[0] == '3' && fmt[1] == '2') { fmt += 2; /* flags |= normal integer - it is 32bit for all our targets */ goto rflag; } /* * I alone - use Microsoft's semantic as size_t modifier. We do * not support glibc's semantic to use alternative digits. */ flags |= SIZET; goto rflag; case 'l': if (flags & LONGINT) { flags &= ~LONGINT; flags |= LLONGINT; } else flags |= LONGINT; goto rflag; case 'L': case 'q': flags |= LLONGINT; /* not necessarily */ goto rflag; case 't': flags |= PTRDIFFT; goto rflag; case 'Z': case 'z': flags |= SIZET; goto rflag; case 'C': flags |= LONGINT; /*FALLTHROUGH*/ case 'c': if (flags & LONGINT) ADDTYPE(T_WINT); else ADDTYPE(T_INT); break; case 'D': flags |= LONGINT; /*FALLTHROUGH*/ case 'd': case 'i': ADDSARG(); break; #ifndef NO_FLOATING_POINT case 'a': case 'A': case 'e': case 'E': case 'f': case 'g': case 'G': if (flags & LLONGINT) ADDTYPE(T_LONG_DOUBLE); else ADDTYPE(T_DOUBLE); break; #endif /* !NO_FLOATING_POINT */ case 'n': if (flags & INTMAXT) ADDTYPE(TP_INTMAXT); else if (flags & PTRDIFFT) ADDTYPE(TP_PTRDIFFT); else if (flags & SIZET) ADDTYPE(TP_SIZET); else if (flags & LLONGINT) ADDTYPE(TP_LLONG); else if (flags & LONGINT) ADDTYPE(TP_LONG); else if (flags & SHORTINT) ADDTYPE(TP_SHORT); else if (flags & CHARINT) ADDTYPE(TP_SCHAR); else ADDTYPE(TP_INT); continue; /* no output */ case 'O': flags |= LONGINT; /*FALLTHROUGH*/ case 'o': ADDUARG(); break; case 'p': ADDTYPE(TP_VOID); break; case 'S': flags |= LONGINT; /*FALLTHROUGH*/ case 's': if (flags & LONGINT) ADDTYPE(TP_WCHAR); else ADDTYPE(TP_CHAR); break; case 'U': flags |= LONGINT; /*FALLTHROUGH*/ case 'u': case 'X': case 'x': ADDUARG(); break; default: /* "%?" prints ?, unless ? is NUL */ if (ch == '\0') goto done; break; } } done: /* * Build the argument table. */ if (tablemax >= STATIC_ARG_TBL_SIZE) { *argtable = (union arg *) malloc (sizeof (union arg) * (tablemax + 1)); } (*argtable) [0].intarg = 0; for (n = 1; n <= tablemax; n++) { switch (typetable [n]) { case T_UNUSED: /* whoops! */ (*argtable) [n].intarg = va_arg (ap, int); break; case TP_SCHAR: (*argtable) [n].pschararg = va_arg (ap, signed char *); break; case TP_SHORT: (*argtable) [n].pshortarg = va_arg (ap, short *); break; case T_INT: (*argtable) [n].intarg = va_arg (ap, int); break; case T_U_INT: (*argtable) [n].uintarg = va_arg (ap, unsigned int); break; case TP_INT: (*argtable) [n].pintarg = va_arg (ap, int *); break; case T_LONG: (*argtable) [n].longarg = va_arg (ap, long); break; case T_U_LONG: (*argtable) [n].ulongarg = va_arg (ap, unsigned long); break; case TP_LONG: (*argtable) [n].plongarg = va_arg (ap, long *); break; case T_LLONG: (*argtable) [n].longlongarg = va_arg (ap, long long); break; case T_U_LLONG: (*argtable) [n].ulonglongarg = va_arg (ap, unsigned long long); break; case TP_LLONG: (*argtable) [n].plonglongarg = va_arg (ap, long long *); break; case T_PTRDIFFT: (*argtable) [n].ptrdiffarg = va_arg (ap, ptrdiff_t); break; case TP_PTRDIFFT: (*argtable) [n].pptrdiffarg = va_arg (ap, ptrdiff_t *); break; case T_SIZET: (*argtable) [n].sizearg = va_arg (ap, size_t); break; case TP_SIZET: (*argtable) [n].psizearg = va_arg (ap, size_t *); break; case T_INTMAXT: (*argtable) [n].intmaxarg = va_arg (ap, intmax_t); break; case T_UINTMAXT: (*argtable) [n].uintmaxarg = va_arg (ap, uintmax_t); break; case TP_INTMAXT: (*argtable) [n].pintmaxarg = va_arg (ap, intmax_t *); break; #ifndef NO_FLOATING_POINT case T_DOUBLE: (*argtable) [n].doublearg = va_arg (ap, double); break; case T_LONG_DOUBLE: (*argtable) [n].longdoublearg = va_arg (ap, long double); break; #endif case TP_CHAR: (*argtable) [n].pchararg = va_arg (ap, char *); break; case TP_VOID: (*argtable) [n].pvoidarg = va_arg (ap, void *); break; case T_WINT: (*argtable) [n].wintarg = va_arg (ap, wint_t); break; case TP_WCHAR: (*argtable) [n].pwchararg = va_arg (ap, wchar_t *); break; } } if ((typetable != NULL) && (typetable != stattypetable)) free (typetable); } /* * Increase the size of the type table. */ static void __grow_type_table (int nextarg, enum typeid **typetable, int *tablesize) { enum typeid *const oldtable = *typetable; const int oldsize = *tablesize; enum typeid *newtable; int n, newsize = oldsize * 2; if (newsize < nextarg + 1) newsize = nextarg + 1; if (oldsize == STATIC_ARG_TBL_SIZE) { if ((newtable = malloc(newsize * sizeof(enum typeid))) == NULL) abort(); /* XXX handle better */ memmove(newtable, oldtable, oldsize * sizeof(enum typeid)); } else { newtable = realloc(oldtable, newsize * sizeof(enum typeid)); if (newtable == NULL) abort(); /* XXX handle better */ } for (n = oldsize; n < newsize; n++) newtable[n] = T_UNUSED; *typetable = newtable; *tablesize = newsize; } #ifndef NO_FLOATING_POINT static int exponent(wchar_t *p0, int exp, wchar_t fmtch) { wchar_t *p, *t; wchar_t expbuf[MAXEXPDIG]; p = p0; *p++ = fmtch; if (exp < 0) { exp = -exp; *p++ = '-'; } else *p++ = '+'; t = expbuf + MAXEXPDIG; if (exp < 10) { *p++ = '0'; } if (exp < 100) { *p++ = '0'; } if (exp > 9) { do { *--t = to_char(exp % 10); } while ((exp /= 10) > 9); *--t = to_char(exp); for (; t < expbuf + MAXEXPDIG; *p++ = *t++); } else { *p++ = to_char(exp); } return (p - p0); } #endif /* !NO_FLOATING_POINT */ #endif /* !STR_NO_WIN32_LIBS|*BSD */ open-vm-tools-10.0.7-3227872/lib/xdg/0000755000000000000000000000000012660700527015205 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/xdg/Makefile.am0000644000000000000000000000176412660700527017251 0ustar rootroot################################################################################ ### Copyright (C) 2010-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libXdg.la libXdg_la_CPPFLAGS = @GLIB2_CPPFLAGS@ libXdg_la_SOURCES = libXdg_la_SOURCES += xdg.c open-vm-tools-10.0.7-3227872/lib/xdg/xdg.c0000644000000000000000000000623012660700527016134 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * xdg.c -- * * vmware-xdg-* script wrapper library. */ #include #include #include #include #include #include #include "vmware.h" #include "vmstdio.h" #include "xdg.h" /* * Local data */ /* Name of helper script used by Xdg_DetectDesktopEnv. */ static const char xdgDetectDEExec[] = "vmware-xdg-detect-de"; /* * Global functions */ /* *----------------------------------------------------------------------------- * * Xdg_DetectDesktopEnv -- * * Captures output from external vmware-xdg-detect-de script to determine * which desktop environment we're running under. * * Results: * Returns a pointer to a string specifying the desktop environment on * success or "" on failure. * * This function only guarantees that the returned string matches the * pattern ^[A-Za-z0-9]*$. * * Side effects: * Allocates memory for outbuf on first call for duration of program. * Uses popen(), relying on $PATH, to find and execute xdgDetectDeExec. * Caller must not modify returned string. * *----------------------------------------------------------------------------- */ const char * Xdg_DetectDesktopEnv(void) { static char *outbuf = NULL; if (outbuf == NULL) { FILE *cmdPipe = popen(xdgDetectDEExec, "r"); if (cmdPipe) { static const size_t maxSize = sizeof "TEHLONGISTDESKTOPENVEVAR"; size_t outLen; // Doesn't include NUL. int status; if ( StdIO_ReadNextLine(cmdPipe, &outbuf, maxSize, &outLen) == StdIO_Success) { int i; for (i = 0; i < outLen; i++) { if (!isalnum(outbuf[i])) { g_debug("%s: received malformed input\n", __func__); free(outbuf); outbuf = NULL; break; } } } status = pclose(cmdPipe); if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { g_debug("%s: %s did not exit cleanly (%x/%x)\n", __func__, xdgDetectDEExec, status, WEXITSTATUS(status)); free(outbuf); outbuf = NULL; } } if (outbuf == NULL) { outbuf = ""; } } return outbuf; } open-vm-tools-10.0.7-3227872/lib/xdg/Makefile.in0000644000000000000000000004204412660700527017256 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2010-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/xdg DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libXdg_la_LIBADD = am_libXdg_la_OBJECTS = libXdg_la-xdg.lo libXdg_la_OBJECTS = $(am_libXdg_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libXdg_la_SOURCES) DIST_SOURCES = $(libXdg_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libXdg.la libXdg_la_CPPFLAGS = @GLIB2_CPPFLAGS@ libXdg_la_SOURCES = xdg.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/xdg/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/xdg/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libXdg.la: $(libXdg_la_OBJECTS) $(libXdg_la_DEPENDENCIES) $(LINK) $(libXdg_la_OBJECTS) $(libXdg_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libXdg_la-xdg.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 $@ $< libXdg_la-xdg.lo: xdg.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libXdg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libXdg_la-xdg.lo -MD -MP -MF $(DEPDIR)/libXdg_la-xdg.Tpo -c -o libXdg_la-xdg.lo `test -f 'xdg.c' || echo '$(srcdir)/'`xdg.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libXdg_la-xdg.Tpo $(DEPDIR)/libXdg_la-xdg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='xdg.c' object='libXdg_la-xdg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libXdg_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libXdg_la-xdg.lo `test -f 'xdg.c' || echo '$(srcdir)/'`xdg.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/file/0000755000000000000000000000000012660700525015340 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/file/Makefile.am0000644000000000000000000000236512660700525017402 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libFile.la libFile_la_SOURCES = libFile_la_SOURCES += file.c libFile_la_SOURCES += fileStandAlone.c libFile_la_SOURCES += filePosix.c libFile_la_SOURCES += fileIO.c libFile_la_SOURCES += fileIOPosix.c libFile_la_SOURCES += fileLockPrimitive.c libFile_la_SOURCES += fileLockPosix.c libFile_la_SOURCES += fileTempPosix.c libFile_la_SOURCES += fileTemp.c open-vm-tools-10.0.7-3227872/lib/file/fileTemp.c0000644000000000000000000002467612660700525017270 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #if defined(_WIN32) #include #endif #include #include #include #include #include #include #include #include #include "vmware.h" #include "log.h" #include "file.h" #include "fileInt.h" #include "util.h" #include "unicodeOperations.h" #include "posix.h" #if !defined(O_BINARY) #define O_BINARY 0 #endif /* *---------------------------------------------------------------------- * * FileTempNum -- * * Compute a number to be used as an attachment to a base name. * In order to avoid race conditions, files and directories are * kept separate via enforced odd (file) and even (directory) * numberings. * * Regardless of the input value of *var, the output value will * be even or odd as determined by createTempFile. * * Results: * An odd number if createTempFile is TRUE. * An even number if createTempFile is FALSE. * * Side effects: * None * *---------------------------------------------------------------------- */ static void FileTempNum(Bool createTempFile, // IN: uint32 *var) // IN/OUT: { ASSERT(var); *var += (FileSimpleRandom() >> 8) & 0xFF; *var = (*var & ~0x1) | (createTempFile ? 1 : 0); } /* *---------------------------------------------------------------------- * * File_MakeTempEx2 -- * * Create a temporary file or a directory. * If a temporary file is created successfully, then return an open file * descriptor to that file. * * 'dir' specifies the directory in which to create the file. It * must not end in a slash. * * 'createTempFile', if TRUE, then a temporary file will be created. If * FALSE, then a temporary directory will be created. * * 'createNameFunc' specifies the user-specified callback function that * will be called to construct the fileName. 'createNameFuncData' will be * passed everytime 'createNameFunc' is called. 'createNameFunc' * should return the proper fileName. * * Check the documentation for File_MakeTempHelperFunc. * * Results: * if a temporary file is created, then Open file descriptor or -1; * if a temporary directory is created, then 0 or -1; * If successful then presult points to a dynamically allocated * string with the pathname of the temp file. * * Side effects: * Creates the requested object when successful. Errno is set on error * * Files and directories are effectively in separate name spaces; * the numerical value attached via createNameFunc is odd for files * and even for directories. * *---------------------------------------------------------------------- */ int File_MakeTempEx2(const char *dir, // IN: Bool createTempFile, // IN: File_MakeTempCreateNameFunc *createNameFunc, // IN: void *createNameFuncData, // IN: char **presult) // OUT: { uint32 i; int fd = -1; uint32 var = 0; char *path = NULL; if ((dir == NULL) || (createNameFunc == NULL)) { errno = EFAULT; return -1; } ASSERT(presult); *presult = NULL; for (i = 0; i < (MAX_INT32 / 2); i++) { char *fileName; /* construct suffixed pathname to use */ free(path); path = NULL; /* * Files and directories are kept separate (odd and even respectfully). * This way the available exclusion mechanisms work properly - O_EXCL * on files, mkdir on directories - and races are avoided. * * Not attempting an open on a directory is a good thing... */ FileTempNum(createTempFile, &var); fileName = (*createNameFunc)(var, createNameFuncData); ASSERT(fileName); /* construct base full pathname to use */ path = Unicode_Join(dir, DIRSEPS, fileName, NULL); free(fileName); if (createTempFile) { fd = Posix_Open(path, O_CREAT | O_EXCL | O_BINARY | O_RDWR, 0600); } else { fd = Posix_Mkdir(path, 0700); } if (fd != -1) { *presult = path; path = NULL; break; } if (errno != EEXIST) { Log(LGPFX" Failed to create temporary %s \"%s\": %s.\n", createTempFile ? "file" : "directory", path, strerror(errno)); goto exit; } } if (fd == -1) { Warning(LGPFX" Failed to create temporary %s \"%s\": " "The name space is full.\n", createTempFile ? "file" : "directory", path); errno = EAGAIN; } exit: free(path); return fd; } /* *---------------------------------------------------------------------------- * * FileMakeTempExCreateNameFunc -- * * This is a helper function designed for File_MakeTempEx function. * Everytime this function is called, this creates a fileName with the * format and returns back to the caller. * * 'num' specifies the nth time this function is called. * * 'data' specifies the payload that is specified when File_MakeTempEx2() * function is called. This points to a UTF8 string. * * Results: * if successful, a dynamically allocated string with the basename of * the temp file. NULL otherwise. * * Side effects: * None * *---------------------------------------------------------------------------- */ static char * FileMakeTempExCreateNameFunc(uint32 num, // IN: void *data) // IN: { if (data == NULL) { return NULL; } return Unicode_Format("%s%u", (char *) data, num); } /* *---------------------------------------------------------------------- * * File_MakeTempEx -- * * Create a temporary file and, if successful, return an open file * descriptor to that file. * * 'dir' specifies the directory in which to create the file. It * must not end in a slash. * * 'fileName' specifies the base filename of the created file. * * Results: * Open file descriptor or -1; if successful then presult points * to a dynamically allocated string with the pathname of the temp * file. * * Side effects: * Creates a file if successful. Errno is set on error * *---------------------------------------------------------------------- */ int File_MakeTempEx(const char *dir, // IN: const char *fileName, // IN: char **presult) // OUT: { return File_MakeTempEx2(dir, TRUE, FileMakeTempExCreateNameFunc, (void *) fileName, presult); } /* *---------------------------------------------------------------------- * * File_MakeSafeTempDir -- * * Create a temporary directory in a safe area. * * Optional argument 'prefix' specifies the name prefix of the * created directory. When not provided a default will be provided. * * Results: * NULL Failure * !NULL Path name of created directory * * Side effects: * Creates a directory if successful. Errno is set on error * *---------------------------------------------------------------------- */ char * File_MakeSafeTempDir(const char *prefix) // IN: { char *result = NULL; char *dir = File_GetSafeTmpDir(TRUE); if (dir != NULL) { const char *effectivePrefix = (prefix == NULL) ? "safeDir" : prefix; File_MakeTempEx2(dir, FALSE, FileMakeTempExCreateNameFunc, (void *) effectivePrefix, &result); free(dir); } return result; } /* *---------------------------------------------------------------------- * * File_MakeSafeTemp -- * * Exactly the same as File_MakeTempEx except uses a safe directory * as the default temporary directory. * * Results: * Open file descriptor or -1 * * Side effects: * Creates a file if successful. * *---------------------------------------------------------------------- */ int File_MakeSafeTemp(const char *tag, // IN (OPT): char **presult) // OUT: { int fd; char *dir = NULL; char *fileName = NULL; ASSERT(presult); *presult = NULL; if (tag && File_IsFullPath(tag)) { File_GetPathName(tag, &dir, &fileName); } else { dir = File_GetSafeTmpDir(TRUE); fileName = Unicode_Duplicate(tag ? tag : "vmware"); } fd = File_MakeTempEx(dir, fileName, presult); free(dir); free(fileName); return fd; } /* *----------------------------------------------------------------------------- * * File_DoesVolumeSupportAcls -- * * Determines if the volume that the pathname resides on supports * ACLs. * * Results: * TRUE it does * FALSE it doesn't * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool File_DoesVolumeSupportAcls(const char *path) // IN: { Bool succeeded = FALSE; #if defined(_WIN32) Bool res; char *vol; char *vol2; const utf16_t *vol2W; DWORD fsFlags; ASSERT(path); File_SplitName(path, &vol, NULL, NULL); vol2 = Unicode_Append(vol, DIRSEPS); vol2W = UNICODE_GET_UTF16(vol2); res = GetVolumeInformationW(vol2W, NULL, 0, NULL, NULL, &fsFlags, NULL, 0); UNICODE_RELEASE_UTF16(vol2W); if (res) { if ((fsFlags & FS_PERSISTENT_ACLS) == 0) { goto exit; } } else { Log(LGPFX" %s: GetVolumeInformation failed: %d\n", __FUNCTION__, GetLastError()); goto exit; } succeeded = TRUE; exit: free(vol); free(vol2); #endif return succeeded; } open-vm-tools-10.0.7-3227872/lib/file/fileIOPosix.c0000644000000000000000000023610612660700525017706 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileIOPosix.c -- * * Implementation of the file library host specific functions for linux. */ #if defined(__linux__) # if !defined(VMX86_TOOLS) && !defined(__ANDROID__) # define FILEIO_SUPPORT_ODIRECT # define _GNU_SOURCE # endif # include #endif #include #include #include #include #if defined __ANDROID__ #include // for __NR_SYSCALL_BASE #endif #include #include #include #include #if defined(__linux__) #ifdef __ANDROID__ # include #else # include #endif #endif #include #include "su.h" #if defined(__APPLE__) #include "sysSocket.h" // Don't move this: it fixes a system header. #include #include #include #include #include #include #include #include #include #include #include #else #if defined(__FreeBSD__) #include #include #else #include #if !defined(__sun__) #include #include #endif #endif #endif /* Check for non-matching prototypes */ #include "vmware.h" #include "str.h" #include "err.h" #include "posix.h" #include "file.h" #include "fileIO.h" #include "fileInt.h" #include "config.h" #include "util.h" #include "iovector.h" #include "hostType.h" #include "unicodeOperations.h" #include "memaligned.h" #include "userlock.h" #include "hostinfo.h" #if defined(__APPLE__) #include /* * F_NODIRECT was added in Mac OS 10.7.0 "Lion". We test at runtime for the * right version before using it, but we also need to get the definition. */ #include #ifndef F_NODIRECT #define F_NODIRECT 62 #endif #endif /* * fallocate() is only supported since the glibc-2.8 and * linux kernel-2.6.23. Presently the glibc in our toolchain is 2.3. */ #if defined(__linux__) #if !defined(SYS_fallocate) #if defined(__i386__) #define SYS_fallocate 324 #elif __x86_64__ #define SYS_fallocate 285 #elif __arm__ #define SYS_fallocate (__NR_SYSCALL_BASE+352) // newer glibc value #endif #endif #if !defined(FALLOC_FL_KEEP_SIZE) #define FALLOC_FL_KEEP_SIZE 1 #endif #endif static const unsigned int FileIO_SeekOrigins[] = { SEEK_SET, SEEK_CUR, SEEK_END, }; static const int FileIO_OpenActions[] = { 0, O_TRUNC, O_CREAT, O_CREAT | O_EXCL, O_CREAT | O_TRUNC, }; /* * Options for FileCoalescing performance optimization */ typedef struct FilePosixOptions { Bool initialized; Bool aligned; Bool enabled; int countThreshold; int sizeThreshold; int aioNumThreads; ssize_t maxIOVec; } FilePosixOptions; static FilePosixOptions filePosixOptions; /* * Data structures for FileIOAligned_* functions; only used on * hosted (see fileInt.h for rationale). */ #if !defined(VMX86_TOOLS) && !defined(VMX86_SERVER) #define ALIGNEDPOOL_FREELIST_SIZE 30 #define ALIGNEDPOOL_BUFSZ (1024 * 1024) #define ALIGNEDPOOL_OLD_AGE ((VmTimeType)1000 * 1000 * 1000) /* nanoseconds */ typedef struct AlignedPool { MXUserExclLock *lock; /* * list: Array of allocated buffers. * 0 .. numBusy-1 : busy buffers (in use by a caller). * numBusy .. numAlloc-1 : allocated but not busy. * numAlloc .. SIZE-1 : unused. */ void *list[ALIGNEDPOOL_FREELIST_SIZE]; /* * timestamp: Array of release timestamps. * 0 .. numBusy-1 : unused. * numBusy .. numAlloc-1 : last time we had N buffers outstanding. * numAlloc .. SIZE-1 : unused. */ VmTimeType timestamp[ALIGNEDPOOL_FREELIST_SIZE]; /* invariant: 0 <= numBusy <= numAlloc <= ALIGNEDPOOL_FREELIST_SIZE */ unsigned numAlloc; unsigned numBusy; } AlignedPool; static Atomic_Ptr alignedPoolLockStorage; static AlignedPool alignedPool; #endif /* * Although, support for preadv()/pwrite() first appeared in Linux 2.6.30, * library support was added in glibc 2.10. Hence these functions * are not available in any header file. */ #if defined(__linux__) && !defined(__ANDROID__) #if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64) /* * We want preadv/pwritev. But due to FOB=64, the symbols are -64. * TODO: when the baseline bumps to XOPEN=700, link directly to * the symbols (and anyone building XOPEN<700 gets nothing). */ extern ssize_t preadv64(int fd, const struct iovec *iov, int iovcnt, __off64_t offset) __attribute__ ((weak)); extern ssize_t pwritev64(int fd, const struct iovec *iov, int iovcnt, __off64_t offset) __attribute__ ((weak)); #else #error "Large file support unavailable. Aborting." #endif #endif /* defined(__linux__) */ /* *----------------------------------------------------------------------------- * * FileIOErrno2Result -- * * Convert a POSIX errno to a FileIOResult code. * * Results: * The FileIOResult corresponding to the errno, FILEIO_ERROR by default. * * Side effects: * None * *----------------------------------------------------------------------------- */ static FileIOResult FileIOErrno2Result(int error) // IN: errno to convert { switch (error) { case EEXIST: return FILEIO_OPEN_ERROR_EXIST; case ENOENT: return FILEIO_FILE_NOT_FOUND; case EACCES: return FILEIO_NO_PERMISSION; case ENAMETOOLONG: return FILEIO_FILE_NAME_TOO_LONG; case ENOSPC: return FILEIO_WRITE_ERROR_NOSPC; case EFBIG: return FILEIO_WRITE_ERROR_FBIG; #if defined(VMX86_SERVER) case EBUSY: return FILEIO_LOCK_FAILED; #endif #if defined(EDQUOT) case EDQUOT: return FILEIO_WRITE_ERROR_DQUOT; #endif default: Log("%s: Unexpected errno=%d, %s\n", __FUNCTION__, error, Err_Errno2String(error)); return FILEIO_ERROR; } } /* *---------------------------------------------------------------------- * * FileIO_OptionalSafeInitialize -- * * Initialize global state. If this module is called from a * thread other than the VMX or VCPU threads, like an aioGeneric worker * thread, then we cannot do things like call config. Do that sort * of initialization here, which is called from a safe thread. * * This routine is OPTIONAL if you do not call this module from a * worker thread. The same initialization can be done lazily when * a read/write routine is called. * * Results: * None * * Side effects: * None * *---------------------------------------------------------------------- */ INLINE void FileIO_OptionalSafeInitialize(void) { if (!filePosixOptions.initialized) { filePosixOptions.enabled = Config_GetBool(TRUE, "filePosix.coalesce.enable"); /* * Aligned malloc starts failing to allocate memory during heavy I/O on * Linux. We're not sure why -- maybe we are running out of mmaps? * Turn it off by default for now. */ filePosixOptions.aligned = Config_GetBool(FALSE, "filePosix.coalesce.aligned"); filePosixOptions.countThreshold = Config_GetLong(5, "filePosix.coalesce.count"); filePosixOptions.sizeThreshold = Config_GetLong(16*1024, "filePosix.coalesce.size"); filePosixOptions.aioNumThreads = Config_GetLong(0, "aiomgr.numThreads"); #if defined(__linux__) filePosixOptions.maxIOVec = sysconf(_SC_IOV_MAX); /* Assume unlimited unless sysconf says otherwise. */ if (filePosixOptions.maxIOVec < 0) { filePosixOptions.maxIOVec = MAX_INT32; } #elif defined(__APPLE__) /* * There appears to be no way to determine the iovec size limit at * runtime. If Apple ever changes this, we lose binary compatibility. * On the bright side, Apple has not changed this value for at least as * long as they've produced Intel Macs. */ filePosixOptions.maxIOVec = 1024; #else filePosixOptions.maxIOVec = MAX_INT32; #endif filePosixOptions.initialized = TRUE; FileIOAligned_PoolInit(); } } /* *---------------------------------------------------------------------- * * FileIO_Invalidate -- * * Initialize a FileIODescriptor with an invalid value * * Results: * None * * Side effects: * None * *---------------------------------------------------------------------- */ void FileIO_Invalidate(FileIODescriptor *fd) // OUT: { ASSERT(fd); (memset)(fd, 0, sizeof *fd); fd->posix = -1; } /* *---------------------------------------------------------------------- * * FileIO_IsValid -- * * Check whether a FileIODescriptor is valid. * * Results: * True if valid. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool FileIO_IsValid(const FileIODescriptor *fd) // IN: { ASSERT(fd); return fd->posix != -1; } /* *---------------------------------------------------------------------- * * FileIO_CreateFDPosix -- * * This function is for specific needs: for example, when you need * to create a FileIODescriptor from an already open fd. Use only * FileIO_* library functions on the FileIODescriptor from that point on. * * Because FileIODescriptor struct is different on two platforms, * this function is the only one in the file library that's * platform-specific. * * Results: * FileIODescriptor * * Side effects: * None * *---------------------------------------------------------------------- */ FileIODescriptor FileIO_CreateFDPosix(int posix, // IN: UNIX file descriptor int flags) // IN: UNIX access flags { FileIODescriptor fd; FileIO_Invalidate(&fd); switch (flags & O_ACCMODE) { case O_RDWR: fd.flags |= (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE); break; case O_WRONLY: fd.flags |= FILEIO_OPEN_ACCESS_WRITE; break; default: ASSERT(FALSE); /* FALLTHRU */ case O_RDONLY: fd.flags |= FILEIO_OPEN_ACCESS_READ; break; } #if defined(O_SYNC) // Not available in FreeBSD tools build if (flags & O_SYNC) { fd.flags |= FILEIO_OPEN_SYNC; } #endif if (flags & O_APPEND) { fd.flags |= FILEIO_OPEN_APPEND; } fd.posix = posix; return fd; } /* *---------------------------------------------------------------------- * * FileIO_GetVolumeSectorSize -- * * Get sector size of underlying volume. * * Results: * Always 512, there does not seem to be a way to query sectorSize * from filename. But O_DIRECT boundary alignment constraint is * always 512, so use that. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool FileIO_GetVolumeSectorSize(const char *pathName, // IN: uint32 *sectorSize) // OUT: { ASSERT(sectorSize); *sectorSize = 512; return TRUE; } #if defined(__APPLE__) /* *---------------------------------------------------------------------- * * ProxySendResults -- * * Send the results of a open from the proxy. * * Results: * None. * * Side effects: * None. * *---------------------------------------------------------------------- */ static void ProxySendResults(int sock_fd, // IN: int send_fd, // IN: int send_errno) // IN: { struct iovec iov; struct msghdr msg; char cmsgBuf[CMSG_SPACE(sizeof send_fd)]; iov.iov_base = &send_errno; iov.iov_len = sizeof send_errno; if (send_fd == -1) { msg.msg_control = NULL; msg.msg_controllen = 0; } else { struct cmsghdr *cmsg; msg.msg_control = cmsgBuf; msg.msg_controllen = sizeof cmsgBuf; cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_level = SOL_SOCKET; cmsg->cmsg_len = CMSG_LEN(sizeof send_fd); cmsg->cmsg_type = SCM_RIGHTS; (*(int *) CMSG_DATA(cmsg)) = send_fd; msg.msg_controllen = cmsg->cmsg_len; } msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; msg.msg_flags = 0; sendmsg(sock_fd, &msg, 0); } /* *---------------------------------------------------------------------- * * ProxyReceiveResults -- * * Receive the results of an open from the proxy. * * Results: * None * * Side effects: * None * *---------------------------------------------------------------------- */ static void ProxyReceiveResults(int sock_fd, // IN: int *recv_fd, // OUT: int *recv_errno) // OUT: { int err; struct iovec iov; struct msghdr msg; struct cmsghdr *cmsg; uint8_t cmsgBuf[CMSG_SPACE(sizeof(int))]; iov.iov_base = recv_errno; iov.iov_len = sizeof *recv_errno; msg.msg_control = cmsgBuf; msg.msg_controllen = sizeof cmsgBuf; msg.msg_name = NULL; msg.msg_namelen = 0; msg.msg_iov = &iov; msg.msg_iovlen = 1; err = recvmsg(sock_fd, &msg, 0); if (err <= 0) { *recv_fd = -1; *recv_errno = (err == 0) ? EIO : errno; return; } if (msg.msg_controllen == 0) { *recv_fd = -1; } else { cmsg = CMSG_FIRSTHDR(&msg); if ((cmsg->cmsg_level == SOL_SOCKET) && (cmsg->cmsg_type == SCM_RIGHTS)) { *recv_fd = *((int *) CMSG_DATA(cmsg)); } else { *recv_fd = -1; *recv_errno = EIO; } } } /* *---------------------------------------------------------------------- * * ProxyOpen -- * * Open a file via a proxy. * * Results: * -1 on error * >= 0 on success * * Side effects: * errno is set on error * *---------------------------------------------------------------------- */ static int ProxyOpen(const char *pathName, // IN: int flags, // IN: int mode) // IN: { int err; pid_t pid; int fds[2]; int proxyFD; int saveErrno = 0; if (pathName == NULL) { errno = EFAULT; return -1; } err = socketpair(AF_UNIX, SOCK_DGRAM, 0, fds); if (err == -1) { errno = ENOMEM; // Out of resources... return err; } pid = fork(); if (pid == -1) { proxyFD = -1; saveErrno = ENOMEM; // Out of resources... goto bail; } if (pid == 0) { /* child: use fd[0] */ proxyFD = Posix_Open(pathName, flags, mode); ProxySendResults(fds[0], proxyFD, errno); _exit(0); } else { /* parent: use fd[1] */ ProxyReceiveResults(fds[1], &proxyFD, &saveErrno); waitpid(pid, &err, 0); } bail: close(fds[0]); close(fds[1]); errno = saveErrno; return proxyFD; } /* *---------------------------------------------------------------------- * * ProxyUse -- * * Determine is the open proxy is to be used. * * Results: * 0 Success, useProxy is set * > 0 Failure (errno value); useProxy is undefined * * Side effects: * None * *---------------------------------------------------------------------- */ static int ProxyUse(const char *pathName, // IN: Bool *useProxy) // IN: { char *path; UnicodeIndex index; struct statfs sfbuf; struct stat statbuf; if (pathName == NULL) { errno = EFAULT; return -1; } if ((Posix_Lstat(pathName, &statbuf) == 0) && S_ISLNK(statbuf.st_mode)) { *useProxy = TRUE; return 0; } /* * Construct the path to the directory that contains the filePath. */ index = Unicode_FindLast(pathName, "/"); if (index == UNICODE_INDEX_NOT_FOUND) { path = Unicode_Duplicate("."); } else { char *temp; temp = Unicode_Substr(pathName, 0, index + 1); path = Unicode_Append(temp, "."); free(temp); } /* * Attempt to obtain information about the testPath (directory * containing filePath). */ if (Posix_Statfs(path, &sfbuf) == 0) { /* * The testPath exists; determine proxy usage explicitely. */ *useProxy = strcmp(sfbuf.f_fstypename, "nfs") == 0 ? TRUE : FALSE; } else { /* * A statfs error of some sort; Err on the side of caution. */ *useProxy = TRUE; } free(path); return 0; } /* *---------------------------------------------------------------------- * * PosixFileOpener -- * * Open a file. Use a proxy when creating a file or on NFS. * * Why a proxy? The Mac OS X 10.4.* NFS client interacts with our * use of settid() and doesn't send the proper credentials on opens. * This leads to files being written without error but containing no * data. The proxy avoids all of this unhappiness. * * Results: * -1 on error * >= 0 on success * * Side effects: * errno is set * *---------------------------------------------------------------------- */ int PosixFileOpener(const char *pathName, // IN: int flags, // IN: mode_t mode) // IN: { Bool useProxy; if ((flags & O_ACCMODE) || (flags & O_CREAT)) { int err; /* * Open for write and/or O_CREAT. Determine proxy usage. */ err = ProxyUse(pathName, &useProxy); if (err != 0) { errno = err; return -1; } } else { /* * No write access, no need for a proxy. */ useProxy = FALSE; } return useProxy ? ProxyOpen(pathName, flags, mode) : Posix_Open(pathName, flags, mode); } #endif /* *---------------------------------------------------------------------- * * FileIOCreateRetry -- * * Open/create a file; specify creation mode * May perform retries to deal with certain OS conditions * * Results: * FILEIO_SUCCESS on success: 'file' is set * FILEIO_OPEN_ERROR_EXIST if the file already exists * FILEIO_FILE_NOT_FOUND if the file is not present * FILEIO_ERROR for other errors * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIOCreateRetry(FileIODescriptor *file, // OUT: const char *pathName, // IN: int access, // IN: FileIOOpenAction action, // IN: int mode, // IN: mode_t for creation uint32 msecMaxWaitTime) // IN: Ignored { uid_t uid = -1; int fd = -1; int flags = 0; int error; FileIOResult ret; ASSERT(file); if (pathName == NULL) { errno = EFAULT; return FILEIO_ERROR; } ASSERT(!FileIO_IsValid(file)); ASSERT(file->lockToken == NULL); ASSERT_ON_COMPILE(FILEIO_ERROR_LAST < 16); /* See comment in fileIO.h */ FileIOResolveLockBits(&access); ASSERT((access & FILEIO_OPEN_LOCKED) == 0 && (access & FILEIO_OPEN_EXCLUSIVE_LOCK) == 0); /* Only ESX implements mandatory locking */ ASSERT((access & FILEIO_OPEN_LOCK_MANDATORY) == 0 || File_SupportsMandatoryLock(pathName)); #if defined(__APPLE__) if (access & FILEIO_OPEN_EXCLUSIVE_LOCK_MACOS) { flags |= O_EXLOCK; } #elif defined(__linux__) if (HostType_OSIsVMK()) { if ((access & FILEIO_OPEN_MULTIWRITER_LOCK) != 0) { flags |= O_MULTIWRITER_LOCK; } else if ((access & FILEIO_OPEN_LOCK_MANDATORY) != 0) { flags |= O_EXCLUSIVE_LOCK; } else if ((access & FILEIO_OPEN_OPTIMISTIC_LOCK) != 0) { flags |= O_OPTIMISTIC_LOCK; } } #endif /* * Locking implementation note: this can be recursive. On ESX: * FileIOCreateRetry("foo", ...ADVISORY...) * -> FileIO_Lock("foo", ...ADVISORY...) * -> FileLock_Lock("foo", ...ADVISORY...) * -> FileIOCreateRetry("foo.lck", ...MANDATORY...) * -> open("foo.lck", ...O_EXCLUSIVE_LOCK...) */ FileIO_Init(file, pathName); /* Mandatory file locks are only available at open() itself */ if ((access & FILEIO_OPEN_LOCK_ADVISORY) != 0) { ret = FileIO_Lock(file, access); if (!FileIO_IsSuccess(ret)) { goto error; } } if ((access & (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE)) == (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE)) { flags |= O_RDWR; } else if (access & FILEIO_OPEN_ACCESS_WRITE) { flags |= O_WRONLY; } else if (access & FILEIO_OPEN_ACCESS_READ) { flags |= O_RDONLY; } if (access & FILEIO_OPEN_EXCLUSIVE_READ && access & FILEIO_OPEN_EXCLUSIVE_WRITE) { flags |= O_EXCL; } if (access & FILEIO_OPEN_UNBUFFERED) { #if defined(FILEIO_SUPPORT_ODIRECT) flags |= O_DIRECT; #elif !defined(__APPLE__) // Mac hosts need this access flag after opening. access &= ~FILEIO_OPEN_UNBUFFERED; LOG_ONCE((LGPFX" %s reverting to buffered IO on %s.\n", __FUNCTION__, pathName)); #endif } if (access & FILEIO_OPEN_NONBLOCK) { flags |= O_NONBLOCK; } if (access & FILEIO_OPEN_APPEND) { flags |= O_APPEND; } #if defined(O_NOFOLLOW) if (access & FILEIO_OPEN_ACCESS_NOFOLLOW) { flags |= O_NOFOLLOW; } #endif #if defined(__linux__) if (access & FILEIO_OPEN_SYNC) { flags |= O_SYNC; } #endif #if defined(O_NOFOLLOW) if (access & FILEIO_OPEN_ACCESS_NOFOLLOW) { flags |= O_NOFOLLOW; } #endif flags |= FileIO_OpenActions[action]; file->flags = access; if (access & FILEIO_OPEN_PRIVILEGED) { uid = Id_BeginSuperUser(); } fd = PosixFileOpener(pathName, flags, mode); error = errno; if (access & FILEIO_OPEN_PRIVILEGED) { Id_EndSuperUser(uid); } errno = error; if (fd == -1) { ret = FileIOErrno2Result(errno); goto error; } #if defined(__APPLE__) if (access & (FILEIO_OPEN_UNBUFFERED | FILEIO_OPEN_SYNC)) { error = fcntl(fd, F_NOCACHE, 1); if (error == -1) { ret = FileIOErrno2Result(errno); goto error; } if (!(access & FILEIO_OPEN_SYNC)) { /* * F_NODIRECT was added in Mac OS 10.7.0 "Lion" which has Darwin * kernel 11.0.0. */ if (Hostinfo_OSVersion(0) >= 11) { error = fcntl(fd, F_NODIRECT, 1); if (error == -1) { ret = FileIOErrno2Result(errno); goto error; } } } } #endif if (access & FILEIO_OPEN_DELETE_ASAP) { /* * Remove the name from the name space. The file remains laid out on the * disk and accessible through the file descriptor until it is closed. */ if (Posix_Unlink(pathName) == -1) { ret = FileIOErrno2Result(errno); goto error; } } file->posix = fd; return FILEIO_SUCCESS; error: error = errno; if (fd != -1) { close(fd); } FileIO_Unlock(file); FileIO_Cleanup(file); FileIO_Invalidate(file); errno = error; return ret; } /* *---------------------------------------------------------------------- * * FileIO_Create -- * * Open/create a file; specify creation mode * * Results: * FILEIO_SUCCESS on success: 'file' is set * FILEIO_OPEN_ERROR_EXIST if the file already exists * FILEIO_FILE_NOT_FOUND if the file is not present * FILEIO_ERROR for other errors * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Create(FileIODescriptor *file, // OUT: const char *pathName, // IN: int access, // IN: FileIOOpenAction action, // IN: int mode) // IN: mode_t for creation { return FileIOCreateRetry(file, pathName, access, action, mode, 0); } /* *---------------------------------------------------------------------- * * FileIO_Open -- * * Open/create a file. * * Results: * FILEIO_SUCCESS on success: 'file' is set * FILEIO_OPEN_ERROR_EXIST if the file already exists * FILEIO_FILE_NOT_FOUND if the file is not present * FILEIO_ERROR for other errors * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Open(FileIODescriptor *file, // OUT: const char *pathName, // IN: int access, // IN: FileIOOpenAction action) // IN: { return FileIO_OpenRetry(file, pathName, access, action, 0); } /* *---------------------------------------------------------------------- * * FileIO_OpenRetry -- * * Open/create a file. * May perform retries to deal with certain OS conditions. * * Results: * FILEIO_SUCCESS on success: 'file' is set * FILEIO_OPEN_ERROR_EXIST if the file already exists * FILEIO_FILE_NOT_FOUND if the file is not present * FILEIO_ERROR for other errors * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_OpenRetry(FileIODescriptor *file, // OUT: const char *pathName, // IN: int access, // IN: FileIOOpenAction action, // IN: uint32 msecMaxWaitTime) // IN: { #if defined(VMX86_SERVER) FileIOResult res; uint32 msecWaitTime = 0; uint32 msecMaxLoopTime = 3000; // 3 seconds /* * Workaround the ESX NFS client bug as seen in PR 1341775. * Since ESX NFS client can sometimes *wrongly* return ESTALE for a * legitimate file open case, we retry for some time in hopes that the * problem will resolve itself. */ while (TRUE) { res = FileIOCreateRetry(file, pathName, access, action, S_IRUSR | S_IWUSR, msecMaxWaitTime); if (res == FILEIO_ERROR && Err_Errno() == ESTALE && msecWaitTime < msecMaxLoopTime) { Log(LGPFX "FileIOCreateRetry (%s) failed with ESTALE, retrying.\n", pathName); msecWaitTime += FileSleeper(100, 300); } else { break; } } return res; #else return FileIOCreateRetry(file, pathName, access, action, S_IRUSR | S_IWUSR, msecMaxWaitTime); #endif } /* *---------------------------------------------------------------------- * * FileIO_Seek -- * * Change the current position in a file * * Results: * On success: the new current position in bytes from the beginning of * the file * * On failure: -1 * * Side effects: * None * *---------------------------------------------------------------------- */ uint64 FileIO_Seek(const FileIODescriptor *file, // IN: int64 distance, // IN: FileIOSeekOrigin origin) // IN: { ASSERT(file); #if defined(__ANDROID__) /* * Android doesn't implement _FILE_OFFSET_BITS=64, but always has lseek64. */ return lseek64(file->posix, distance, FileIO_SeekOrigins[origin]); #else /* * Require 64-bit file API support via _FILE_OFFSET_BITS=64 or * operating system default. */ ASSERT_ON_COMPILE(sizeof(off_t) == 8); return lseek(file->posix, distance, FileIO_SeekOrigins[origin]); #endif } /* *---------------------------------------------------------------------- * * FileIO_Write -- * * Write to a file * * Results: * FILEIO_SUCCESS on success: '*actual_count' = 'requested' bytes have * been written. * FILEIO_WRITE_ERROR_FBIG for the attempt to write file that exceeds * maximum file size. * FILEIO_WRITE_ERROR_NOSPC when the device containing the file has no * room for the data. * FILEIO_WRITE_ERROR_DQUOT for attempts to write file that exceeds * user's disk quota. * FILEIO_ERROR for other errors: only '*actual_count' bytes have been * written for sure. * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Write(FileIODescriptor *fd, // IN: const void *bufIn, // IN: size_t requested, // IN: size_t *actual) // OUT: { const uint8 *buf = (const uint8 *)bufIn; size_t initial_requested; FileIOResult fret = FILEIO_SUCCESS; ASSERT(fd); VERIFY(requested < 0x80000000); initial_requested = requested; while (requested > 0) { ssize_t res; res = write(fd->posix, buf, requested); if (res == -1) { int error = errno; if (error == EINTR) { NOT_TESTED(); continue; } fret = FileIOErrno2Result(error); break; } buf += res; requested -= res; } if (actual) { *actual = initial_requested - requested; } return fret; } /* *---------------------------------------------------------------------- * * FileIO_Read -- * * Read from a file * * Results: * FILEIO_SUCCESS on success: '*actual_count' = 'requested' bytes have * been read. * FILEIO_READ_ERROR_EOF if the end of the file was reached: only * '*actual_count' bytes have been read for sure. * FILEIO_ERROR for other errors: only '*actual_count' bytes have been * read for sure. * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Read(FileIODescriptor *fd, // IN: void *bufIn, // OUT: size_t requested, // IN: size_t *actual) // OUT: { uint8 *buf = (uint8 *) bufIn; size_t initial_requested; FileIOResult fret = FILEIO_SUCCESS; ASSERT(fd); VERIFY(requested < 0x80000000); initial_requested = requested; while (requested > 0) { ssize_t res; res = read(fd->posix, buf, requested); if (res == -1) { if (errno == EINTR) { NOT_TESTED(); continue; } fret = FileIOErrno2Result(errno); if (FILEIO_ERROR == fret) { Log("read failed, errno=%d, %s\n", errno, Err_Errno2String(errno)); } break; } if (res == 0) { fret = FILEIO_READ_ERROR_EOF; break; } buf += res; requested -= res; } if (actual) { *actual = initial_requested - requested; } return fret; } /* *---------------------------------------------------------------------- * * FileIO_Truncate -- * * Truncates file to a given length * * Results: * Bool - TRUE on success, FALSE on failure * * Side effects: * None * *---------------------------------------------------------------------- */ Bool FileIO_Truncate(FileIODescriptor *file, // IN: uint64 newLength) // IN: { ASSERT(file); return ftruncate(file->posix, newLength) == 0; } /* *---------------------------------------------------------------------- * * FileIO_Close -- * * Close a file * * Results: * FILEIO_SUCCESS: The file was closed and unlinked. The FileIODescriptor * is no longer valid. * FILEIO_ERROR: An error occurred. * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Close(FileIODescriptor *file) // IN: { int err; ASSERT(file); err = (close(file->posix) == -1) ? errno : 0; /* Unlock the file if it was locked */ FileIO_Unlock(file); FileIO_Cleanup(file); FileIO_Invalidate(file); if (err) { errno = err; } return (err == 0) ? FILEIO_SUCCESS : FILEIO_ERROR; } /* *---------------------------------------------------------------------- * * FileIO_Sync -- * * Synchronize the disk state of a file with its memory state * * Results: * On success: FILEIO_SUCCESS * On failure: FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Sync(const FileIODescriptor *file) // IN: { ASSERT(file); return (fsync(file->posix) == -1) ? FILEIO_ERROR : FILEIO_SUCCESS; } /* *----------------------------------------------------------------------------- * * FileIOCoalesce -- * * Linux 2.2 does a fairly braindead thing with ioVec's. It simply issues * reads and writes internal to the kernel in serial * (linux/fs/read_write.c:do_readv_writev()). We optimize here for the * case of many small chunks. The cost of the extra copy in this case * is made up for by the decreased number of separate I/Os the kernel * issues internally. Note that linux 2.4 seems to be smarter with respect * to this problem. * * Results: * Bool - Whether or not coalescing was done. If it was done, * FileIODecoalesce *MUST* be called. * * Side effects: * FileIOCoalesce will malloc *outVec if coalescing is performed * *----------------------------------------------------------------------------- */ static Bool FileIOCoalesce(struct iovec const *inVec, // IN: Vector to coalesce from int inCount, // IN: count for inVec size_t inTotalSize, // IN: totalSize (bytes) in inVec Bool isWrite, // IN: coalesce for writing (or reading) Bool forceCoalesce, // IN: if TRUE always coalesce int flags, // IN: fileIO open flags struct iovec *outVec) // OUT: Coalesced (1-entry) iovec { uint8 *cBuf; ASSERT(inVec); ASSERT(outVec); FileIO_OptionalSafeInitialize(); /* simple case: no need to coalesce */ if (inCount == 1) { return FALSE; } /* * Only coalesce when the number of entries is above our count threshold * and the average size of an entry is less than our size threshold */ if (!forceCoalesce && (!filePosixOptions.enabled || inCount <= filePosixOptions.countThreshold || inTotalSize / inCount >= filePosixOptions.sizeThreshold)) { return FALSE; } // XXX: Wouldn't it be nice if we could log from here! //LOG(5, ("FILE: Coalescing %s of %d elements and %d size\n", // isWrite ? "write" : "read", inCount, inTotalSize)); if (filePosixOptions.aligned || flags & FILEIO_OPEN_UNBUFFERED) { cBuf = FileIOAligned_Malloc(sizeof(uint8) * inTotalSize); } else { cBuf = Util_SafeMalloc(sizeof(uint8) * inTotalSize); } if (!cBuf) { return FALSE; } if (isWrite) { IOV_WriteIovToBuf(inVec, inCount, cBuf, inTotalSize); } outVec->iov_base = cBuf; outVec->iov_len = inTotalSize; return TRUE; } /* *----------------------------------------------------------------------------- * * FileIODecoalesce -- * * Inverse of the coalesce optimization. For writes, its a NOOP, but * for reads, it copies the data back into the original buffer. * It also frees the memory allocated by FileIOCoalesce. * * Results: * void * * Side effects: * None * *----------------------------------------------------------------------------- */ static void FileIODecoalesce(struct iovec *coVec, // IN: Coalesced (1-entry) vector struct iovec const *origVec, // IN: Original vector int origVecCount, // IN: count for origVec size_t actualSize, // IN: # bytes to transfer back to origVec Bool isWrite, // IN: decoalesce for writing (or reading) int flags) // IN: fileIO open flags { ASSERT(coVec); ASSERT(origVec); ASSERT(actualSize <= coVec->iov_len); ASSERT_NOT_TESTED(actualSize == coVec->iov_len); if (!isWrite) { IOV_WriteBufToIov(coVec->iov_base, actualSize, origVec, origVecCount); } if (filePosixOptions.aligned || flags & FILEIO_OPEN_UNBUFFERED) { FileIOAligned_Free(coVec->iov_base); } else { free(coVec->iov_base); } } /* *---------------------------------------------------------------------- * * FileIO_Readv -- * * Wrapper for readv. In linux, we can issue a readv directly. * But the readv is not atomic, i.e, the read can succeed * on the first N vectors, and return a positive value in spite * of the fact that there was an error on the N+1st vector. There * is no way to query the exact error that happened. So, we retry * in a loop (for a max of MAX_RWV_RETRIES). * XXX: If we retried MAX_RWV_RETRIES times and gave up, we will * return FILEIO_ERROR even if errno is undefined. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR, FILEIO_READ_ERROR_EOF * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Readv(FileIODescriptor *fd, // IN: struct iovec const *v, // IN: int numEntries, // IN: size_t totalSize, // IN: size_t *actual) // OUT: { size_t bytesRead = 0, sum = 0; FileIOResult fret = FILEIO_ERROR; int nRetries = 0, maxRetries = numEntries; struct iovec coV; struct iovec const *vPtr; Bool didCoalesce; int numVec; ASSERT(fd); didCoalesce = FileIOCoalesce(v, numEntries, totalSize, FALSE, FALSE, fd->flags, &coV); VERIFY(totalSize < 0x80000000); numVec = didCoalesce ? 1 : numEntries; vPtr = didCoalesce ? &coV : v; while (nRetries < maxRetries) { ssize_t retval; int tempVec = MIN(filePosixOptions.maxIOVec, numVec); ASSERT(tempVec > 0); retval = readv(fd->posix, vPtr, tempVec); if (retval == -1) { if (errno == EINTR) { NOT_TESTED(); continue; } fret = FileIOErrno2Result(errno); break; } bytesRead += retval; if (bytesRead == totalSize) { fret = FILEIO_SUCCESS; break; } if (retval == 0) { fret = FILEIO_READ_ERROR_EOF; break; } /* * Ambigous case. Stupid Linux. If the bytesRead matches an * exact iovector boundary, we need to retry from the next * iovec. 2) If it does not match, EOF is the only error possible. * NOTE: If Linux Readv implementation changes, this * ambiguity handling may need to change. * --Ganesh, 08/15/2001. */ for (; sum < bytesRead; vPtr++, numVec--) { sum += vPtr->iov_len; /* * In each syscall, we will process atleast one iovec * or get an error back. We will therefore retry atmost * count times. If multiple iovecs were processed before * an error hit, we will retry a lesser number of times. */ nRetries++; } if (sum > bytesRead) { // A partially filled iovec can ONLY mean EOF fret = FILEIO_READ_ERROR_EOF; break; } } if (didCoalesce) { FileIODecoalesce(&coV, v, numEntries, bytesRead, FALSE, fd->flags); } if (actual) { *actual = bytesRead; } return fret; } /* *---------------------------------------------------------------------- * * FileIO_Writev -- * * Wrapper for writev. In linux, we can issue a writev directly. * But the writev is not atomic, i.e, the write can succeed * on the first N vectors, and return a positive value in spite * of the fact that there was an error on the N+1st vector. There * is no way to query the exact error that happened. So, we retry * in a loop (for a max of MAX_RWV_RETRIES). * XXX: If we retried MAX_RWV_RETRIES times and gave up, we will * return FILEIO_ERROR even if errno is undefined. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Writev(FileIODescriptor *fd, // IN: struct iovec const *v, // IN: int numEntries, // IN: size_t totalSize, // IN: size_t *actual) // OUT: { size_t bytesWritten = 0, sum = 0; FileIOResult fret = FILEIO_ERROR; int nRetries = 0, maxRetries = numEntries; struct iovec coV; struct iovec const *vPtr; Bool didCoalesce; int numVec; ASSERT(fd); didCoalesce = FileIOCoalesce(v, numEntries, totalSize, TRUE, FALSE, fd->flags, &coV); VERIFY(totalSize < 0x80000000); numVec = didCoalesce ? 1 : numEntries; vPtr = didCoalesce ? &coV : v; while (nRetries < maxRetries) { ssize_t retval; int tempVec = MIN(filePosixOptions.maxIOVec, numVec); ASSERT(tempVec > 0); retval = writev(fd->posix, vPtr, tempVec); if (retval == -1) { if (errno == EINTR) { NOT_TESTED(); continue; } fret = FileIOErrno2Result(errno); break; } bytesWritten += retval; if (bytesWritten == totalSize) { fret = FILEIO_SUCCESS; break; } for (; sum < bytesWritten; vPtr++, numVec--) { sum += vPtr->iov_len; nRetries++; } /* * writev only seems to produce a partial iovec when the disk is * out of space. Just call it an error. --probin */ if (sum != bytesWritten) { fret = FILEIO_WRITE_ERROR_NOSPC; break; } } if (didCoalesce) { FileIODecoalesce(&coV, v, numEntries, bytesWritten, TRUE, fd->flags); } if (actual) { *actual = bytesWritten; } return fret; } #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) ||\ defined(__sun__) /* *---------------------------------------------------------------------- * * FileIOPreadvCoalesced -- * * This function implements vector pread for platforms that do not * support the preadv system call. The incoming vectors are * coalesced to a single buffer to issue only one pread() * system call which reads from a specified offset. The * vectors are then decoalesced before return. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ static FileIOResult FileIOPreadvCoalesced(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to read into int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start reading size_t totalSize, // IN: totalSize(bytes) in entries size_t *actual) // OUT: number of bytes read { struct iovec const *vPtr; struct iovec coV; int count; uint64 fileOffset; FileIOResult fret; Bool didCoalesce; size_t sum = 0; didCoalesce = FileIOCoalesce(entries, numEntries, totalSize, FALSE, TRUE /* force coalescing */, fd->flags, &coV); count = didCoalesce ? 1 : numEntries; vPtr = didCoalesce ? &coV : entries; fileOffset = offset; while (count > 0) { size_t leftToRead = vPtr->iov_len; uint8 *buf = (uint8 *) vPtr->iov_base; while (leftToRead > 0) { ssize_t retval = pread(fd->posix, buf, leftToRead, fileOffset); if (retval == -1) { if (errno == EINTR) { LOG_ONCE((LGPFX" %s got EINTR. Retrying\n", __FUNCTION__)); NOT_TESTED_ONCE(); continue; } fret = FileIOErrno2Result(errno); goto exit; } if (retval == 0) { fret = FILEIO_READ_ERROR_EOF; goto exit; } buf += retval; leftToRead -= retval; sum += retval; fileOffset += retval; } count--; vPtr++; } fret = FILEIO_SUCCESS; exit: if (didCoalesce) { FileIODecoalesce(&coV, entries, numEntries, sum, FALSE, fd->flags); } if (actual) { *actual = sum; } return fret; } /* *---------------------------------------------------------------------- * * FileIOPwritevCoalesced -- * * This function implements vector pwrite for platforms that do not * support the pwritev system call. The incoming vectors are * coalesced to a single buffer to issue only one pwrite() * system call which writes from a specified offset. The * vectors are then decoalesced before return. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ static FileIOResult FileIOPwritevCoalesced(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to write from int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start writing size_t totalSize, // IN: Total size(bytes) size_t *actual) // OUT: number of bytes written { struct iovec coV; Bool didCoalesce; struct iovec const *vPtr; int count; uint64 fileOffset; FileIOResult fret; size_t sum = 0; didCoalesce = FileIOCoalesce(entries, numEntries, totalSize, TRUE, TRUE /* force coalescing */, fd->flags, &coV); count = didCoalesce ? 1 : numEntries; vPtr = didCoalesce ? &coV : entries; fileOffset = offset; while (count > 0) { size_t leftToWrite = vPtr->iov_len; uint8 *buf = (uint8 *)vPtr->iov_base; while (leftToWrite > 0) { ssize_t retval = pwrite(fd->posix, buf, leftToWrite, fileOffset); if (retval == -1) { if (errno == EINTR) { LOG_ONCE((LGPFX" %s got EINTR. Retrying\n", __FUNCTION__)); NOT_TESTED_ONCE(); continue; } fret = FileIOErrno2Result(errno); goto exit; } if (retval == 0) { NOT_TESTED(); fret = FILEIO_WRITE_ERROR_NOSPC; goto exit; } if (retval < leftToWrite) { /* * Using %zd on Android generated a warning about * expecting a "signed size_t" argument; casting retval to * "signed size_t" generated an error, though. We've * already checked for retval == -1 above, so the cast * below should be OK. Refer to bug 817761. */ LOG_ONCE((LGPFX" %s wrote %"FMTSZ"u out of %"FMTSZ"u bytes.\n", __FUNCTION__, (size_t)retval, leftToWrite)); } buf += retval; leftToWrite -= retval; sum += retval; fileOffset += retval; } count--; vPtr++; } fret = FILEIO_SUCCESS; exit: if (didCoalesce) { FileIODecoalesce(&coV, entries, numEntries, sum, TRUE, fd->flags); } if (actual) { *actual = sum; } return fret; } #endif /* defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__) */ #if defined(__linux__) && !defined(__ANDROID__) /* *---------------------------------------------------------------------- * * FileIOPreadvInternal -- * * This function implements vector pread for linux builds. Although, * support for preadv() first appeared in Linux 2.6.30, * library support was added in glibc 2.10. * Hence using weak linkage technique, we try to call the more * optimized preadv system call. If the system does not support * this, we fall back to earlier unoptimized technique. * * Note that in linux, preadv can succeed on the first N vectors, * and return a positive value in spite of the fact that there was * an error on the N+1st vector. There is no way to query the exact * error that happened. So, we retry in a loop (for a max of * MAX_RWV_RETRIES), same as FileIO_Readv(). * * XXX: If we retried MAX_RWV_RETRIES times and gave up, we will * return FILEIO_ERROR even if errno is undefined. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ static FileIOResult FileIOPreadvInternal(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to read into int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start reading size_t totalSize, // IN: totalSize(bytes) in entries size_t *actual) // OUT: number of bytes read { struct iovec const *vPtr; int numVec; size_t partialBytes = 0; size_t bytesRead = 0; size_t sum = 0; int nRetries = 0; int maxRetries = numEntries; FileIOResult fret = FILEIO_ERROR; FileIO_OptionalSafeInitialize(); numVec = numEntries; vPtr = entries; while (nRetries < maxRetries) { ssize_t retval = 0; ASSERT(numVec > 0); if (preadv64 != NULL) { int tempVec = MIN(filePosixOptions.maxIOVec, numVec); retval = preadv64(fd->posix, vPtr, tempVec, offset); } else { fret = FileIOPreadvCoalesced(fd, entries, numEntries, offset, totalSize, &bytesRead); break; } if (retval == -1) { if (errno == EINTR) { NOT_TESTED(); continue; } if (errno == ENOSYS || errno == EINVAL || errno == ENOMEM) { /* * ENOSYS is returned when the kernel does not support preadv and * will be returned the first time we ever call preadv. So, we * can assume that we are not reading partial requests here. * ENOMEM can be due to system call failure and EINVAL is when file * was opened with the O_DIRECT flag and memory is not suitably * aligned. Let's try to read the remaining vectors using the * unoptimized function and hope we don't encounter another error. */ size_t remSize = totalSize - bytesRead; uint64 tempOffset = offset + bytesRead; partialBytes = 0; fret = FileIOPreadvCoalesced(fd, vPtr, numVec, tempOffset, remSize, &partialBytes); break; } fret = FileIOErrno2Result(errno); break; } bytesRead += retval; if (bytesRead == totalSize) { fret = FILEIO_SUCCESS; break; } if (retval == 0) { fret = FILEIO_READ_ERROR_EOF; break; } /* * This is an ambiguous case in linux preadv implementation. * If the bytesRead matches an exact iovector boundary, we need * to retry from the next iovec. However, if it does not match, * EOF is the only error possible. Linux 3.4.4 continues to have * this behaviour. * NOTE: If Linux preadv implementation changes, this * ambiguity handling may need to change. */ for (; sum < bytesRead; vPtr++, numVec--) { sum += vPtr->iov_len; offset += vPtr->iov_len; /* * In each syscall, we will process atleast one iovec * or get an error back. We will therefore retry at most * count times. If multiple iovecs were processed before * an error hit, we will retry a lesser number of times. */ nRetries++; } if (sum > bytesRead) { // A partially filled iovec can ONLY mean EOF fret = FILEIO_READ_ERROR_EOF; break; } } if (actual) { *actual = bytesRead + partialBytes; } return fret; } /* *---------------------------------------------------------------------- * * FileIOPwritevInternal -- * * This function implements vector pwrite for linux builds. Although, * support for pwritev() first appeared in Linux 2.6.30, library * support was added in glibc 2.10. * Hence using weak linkage technique, we try to call the more * optimized pwritev system call. If the system does not support * this, we fall back to earlier unoptimized technique. * * Note that in linux, pwritev can succeed on the first N vectors, * and return a positive value in spite of the fact that there was * an error on the N+1st vector. There is no way to query the exact * error that happened. So, we retry in a loop (for a max of * MAX_RWV_RETRIES), same as FileIO_Writev(). * * XXX: If we retried MAX_RWV_RETRIES times and gave up, we will * return FILEIO_ERROR even if errno is undefined. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ static FileIOResult FileIOPwritevInternal(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to write from int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start writing size_t totalSize, // IN: Total size(bytes)in entries size_t *actual) // OUT: number of bytes written { struct iovec const *vPtr; int numVec; size_t partialBytes = 0; size_t bytesWritten = 0; size_t sum = 0; int nRetries = 0; int maxRetries = numEntries; FileIOResult fret = FILEIO_ERROR; FileIO_OptionalSafeInitialize(); numVec = numEntries; vPtr = entries; while (nRetries < maxRetries) { ssize_t retval = 0; ASSERT(numVec > 0); if (pwritev64 != NULL) { int tempVec = MIN(filePosixOptions.maxIOVec, numVec); retval = pwritev64(fd->posix, vPtr, tempVec, offset); } else { fret = FileIOPwritevCoalesced(fd, entries, numEntries, offset, totalSize, &bytesWritten); break; } if (retval == -1) { if (errno == EINTR) { NOT_TESTED(); continue; } if (errno == ENOSYS || errno == EINVAL || errno == ENOMEM) { /* * ENOSYS is returned when the kernel does not support pwritev and * will be returned the first time we ever call pwritev. So, we * can assume that we are not writing partial requests here. * ENOMEM can be due to system call failure and EINVAL is when file * was opened with the O_DIRECT flag and memory is not suitably * aligned. Let's try writing the remaining vectors using the * unoptimized function and hope we don't encounter another error. */ size_t remSize = totalSize - bytesWritten; uint64 tempOffset = offset + bytesWritten; partialBytes = 0; fret = FileIOPwritevCoalesced(fd, vPtr, numVec, tempOffset, remSize, &partialBytes); break; } fret = FileIOErrno2Result(errno); break; } bytesWritten += retval; if (bytesWritten == totalSize) { fret = FILEIO_SUCCESS; break; } for (; sum < bytesWritten; vPtr++, numVec--) { sum += vPtr->iov_len; offset += vPtr->iov_len; nRetries++; } /* * pwritev produces a partial iovec when the disk is * out of space. Just call it an error. */ if (sum != bytesWritten) { fret = FILEIO_WRITE_ERROR_NOSPC; break; } } if (actual) { *actual = bytesWritten + partialBytes; } return fret; } #endif /* defined(__linux__) && !defined(__ANDROID__) */ #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) ||\ defined(__sun__) /* *---------------------------------------------------------------------- * * FileIO_Preadv -- * * Implementation of vector pread. The function checks for the support * of system call preadv with the version of glibc and calls the * optimized system call. If the system call is not supported, * we fall back to the earlier technique of coalescing the vectors * and calling a single pread and decoalescing again. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Preadv(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to read into int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start reading size_t totalSize, // IN: totalSize (bytes) in entries size_t *actual) // OUT: number of bytes read { FileIOResult fret; ASSERT(fd); ASSERT(entries); ASSERT(!(fd->flags & FILEIO_ASYNCHRONOUS)); VERIFY(totalSize < 0x80000000); #if defined(__linux__) && !defined(__ANDROID__) fret = FileIOPreadvInternal(fd, entries, numEntries, offset, totalSize, actual); #else fret = FileIOPreadvCoalesced(fd, entries, numEntries, offset, totalSize, actual); #endif /* defined(__linux__ ) && !defined(__ANDROID__) */ return fret; } /* *---------------------------------------------------------------------- * * FileIO_Pwritev -- * * Implementation of vector pwrite. The function checks for the support * of system call pwritev with the version of glibc and calls the * optimized system call. If the system call is not supported, * we fall back to the earlier technique of coalescing the vectors and * calling a single pread and decoalescing again. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Pwritev(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to write from int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start writing size_t totalSize, // IN: Total size (bytes) in entries size_t *actual) // OUT: number of bytes written { FileIOResult fret; ASSERT(fd); ASSERT(entries); ASSERT(!(fd->flags & FILEIO_ASYNCHRONOUS)); VERIFY(totalSize < 0x80000000); #if defined(__linux__) && !defined(__ANDROID__) fret = FileIOPwritevInternal(fd, entries, numEntries, offset, totalSize, actual); #else fret = FileIOPwritevCoalesced(fd, entries, numEntries, offset, totalSize, actual); #endif /* defined(__linux__ ) && !defined(__ANDROID__) */ return fret; } #endif /* defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__sun__) */ /* *---------------------------------------------------------------------- * * FileIO_GetAllocSize -- * * Get logcial and alloced size of a file. * * Results: * FileIOResult. * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_GetAllocSize(const FileIODescriptor *fd, // IN: uint64 *logicalBytes, // OUT: uint64 *allocedBytes) // OUT: { struct stat statBuf; ASSERT(fd); if (fstat(fd->posix, &statBuf) == -1) { return FileIOErrno2Result(errno); } if (logicalBytes) { *logicalBytes = statBuf.st_size; } if (allocedBytes) { /* * If you don't like the magic number 512, yell at the people * who wrote sys/stat.h and tell them to add a #define for it. */ *allocedBytes = statBuf.st_blocks * 512; } return FILEIO_SUCCESS; } /* *---------------------------------------------------------------------- * * FileIO_SetAllocSize -- * * Set allocated size of file, allocating new blocks if needed. * It is an error for size to be less than the current size. * * Results: * TRUE on success. Sets errno on failure. * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool FileIO_SetAllocSize(const FileIODescriptor *fd, // IN: uint64 size) // IN: { #if defined(__APPLE__) || defined(__linux__) FileIOResult fret; uint64 curSize; uint64 preallocLen; #if defined(__APPLE__) fstore_t prealloc; #endif fret = FileIO_GetAllocSize(fd, NULL, &curSize); if (!FileIO_IsSuccess(fret)) { return FALSE; } if (curSize > size) { errno = EINVAL; return FALSE; } preallocLen = size - curSize; #if defined(__APPLE__) prealloc.fst_flags = 0; prealloc.fst_posmode = F_PEOFPOSMODE; prealloc.fst_offset = 0; prealloc.fst_length = preallocLen; prealloc.fst_bytesalloc = 0; return fcntl(fd->posix, F_PREALLOCATE, &prealloc) != -1; #elif __linux__ return syscall(SYS_fallocate, fd->posix, FALLOC_FL_KEEP_SIZE, curSize, preallocLen) == 0; #endif #else errno = ENOSYS; return FALSE; #endif } /* *---------------------------------------------------------------------- * * FileIO_GetAllocSizeByPath -- * * Get the logcial and alloced size of a file specified by path. * * Results: * FileIOResult. * * Side effects: * errno is set on error * *---------------------------------------------------------------------- */ FileIOResult FileIO_GetAllocSizeByPath(const char *pathName, // IN: uint64 *logicalBytes, // OUT: uint64 *allocedBytes) // OUT: { struct stat statBuf; if (Posix_Stat(pathName, &statBuf) == -1) { return FileIOErrno2Result(errno); } if (logicalBytes) { *logicalBytes = statBuf.st_size; } if (allocedBytes) { #if __linux__ && defined(N_PLAT_NLM) /* Netware doesn't have st_blocks. Just fall back to GetSize. */ *allocedBytes = statBuf.st_size; #else /* * If you don't like the magic number 512, yell at the people * who wrote sys/stat.h and tell them to add a #define for it. */ *allocedBytes = statBuf.st_blocks * 512; #endif } return FILEIO_SUCCESS; } /* *---------------------------------------------------------------------- * * FileIO_Access -- * * Wrapper for access syscall. We return FILEIO_SUCCESS if the file * is accessible with the specified mode. If not, we will return * FILEIO_ERROR. * * Results: * FILEIO_SUCCESS or FILEIO_ERROR. * * Side effects: * errno is set on error * *---------------------------------------------------------------------- */ FileIOResult FileIO_Access(const char *pathName, // IN: Path name. May be NULL. int accessMode) // IN: Access modes to be asserted { int mode = 0; if (pathName == NULL) { errno = EFAULT; return FILEIO_ERROR; } if (accessMode & FILEIO_ACCESS_READ) { mode |= R_OK; } if (accessMode & FILEIO_ACCESS_WRITE) { mode |= W_OK; } if (accessMode & FILEIO_ACCESS_EXEC) { mode |= X_OK; } if (accessMode & FILEIO_ACCESS_EXISTS) { mode |= F_OK; } return (Posix_Access(pathName, mode) == -1) ? FILEIO_ERROR : FILEIO_SUCCESS; } /* *---------------------------------------------------------------------- * * FileIO_GetFlags -- * * Accessor for fd->flags; * * Results: * fd->flags * * Side Effects: * None * *---------------------------------------------------------------------- */ uint32 FileIO_GetFlags(FileIODescriptor *fd) // IN: { ASSERT(fd); ASSERT(FileIO_IsValid(fd)); return fd->flags; } /* *---------------------------------------------------------------------- * * FileIO_SupportsFileSize -- * * Test whether underlying filesystem supports specified file size. * * Results: * Return TRUE if such file size is supported, FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool FileIO_SupportsFileSize(const FileIODescriptor *fd, // IN: uint64 requestedSize) // IN: { #if defined(__linux__) /* * Linux makes test on seek(), so we can do simple non-intrusive test. * Verified to work on 2.2.x, 2.4.x and 2.6.x, with ext2, ext3, smbfs, * cifs, nfs and ncpfs. Always got some reasonable value. */ Bool supported = FALSE; uint64 oldPos; ASSERT(FileIO_IsValid(fd)); oldPos = FileIO_Seek(fd, 0, FILEIO_SEEK_CURRENT); if (oldPos != (uint64)-1) { uint64 newPos; if (FileIO_Seek(fd, requestedSize, FILEIO_SEEK_BEGIN) == requestedSize) { supported = TRUE; } newPos = FileIO_Seek(fd, oldPos, FILEIO_SEEK_BEGIN); VERIFY(oldPos == newPos); } return supported; #elif defined(__APPLE__) struct statfs buf; if (fstatfs(fd->posix, &buf) == -1) { Log(LGPFX" %s fstatfs failure: %s\n", __FUNCTION__, Err_Errno2String(errno)); /* Be optimistic despite failure */ return TRUE; } /* Check for FAT and UFS file systems */ if ((Str_Strcasecmp(buf.f_fstypename, "msdos") == 0) || (Str_Strcasecmp(buf.f_fstypename, "ufs") == 0)) { /* 4 GB limit */ return requestedSize > CONST64U(0xFFFFFFFF) ? FALSE : TRUE; } /* Be optimistic... */ return TRUE; #else /* Be optimistic on FreeBSD and Solaris... */ return TRUE; #endif } /* *---------------------------------------------------------------------- * * FileIO_GetModTime -- * * Retrieve last modification time. * * Results: * Return POSIX epoch time or -1 on error. * * Side effects: * None. * *---------------------------------------------------------------------- */ int64 FileIO_GetModTime(const FileIODescriptor *fd) // IN: { struct stat statbuf; if (fstat(fd->posix, &statbuf) == 0) { return statbuf.st_mtime; } else { return -1; } } /* *---------------------------------------------------------------------- * * FileIO_PrivilegedPosixOpen -- * * Opens file with elevated privileges. * * Results: * Opened file descriptor, or -1 on failure (errno contains error code). * * Side effects: * None. * *---------------------------------------------------------------------- */ int FileIO_PrivilegedPosixOpen(const char *pathName, // IN: int flags) // IN: { int fd; Bool suDone; uid_t uid = -1; if (pathName == NULL) { errno = EFAULT; return -1; } /* * I've said *opens*. I want you really think twice before creating files * with elevated privileges, so for them you have to use Id_BeginSuperUser() * yourself. */ ASSERT((flags & (O_CREAT | O_TRUNC)) == 0); if (Id_IsSuperUser()) { suDone = FALSE; } else { uid = Id_BeginSuperUser(); suDone = TRUE; } fd = Posix_Open(pathName, flags, 0); if (suDone) { int error = errno; Id_EndSuperUser(uid); errno = error; } return fd; } /* *----------------------------------------------------------------------------- * * FileIO_DescriptorToStream * * Return a FILE * stream equivalent to the given FileIODescriptor. * This is the logical equivalent of Posix dup() then fdopen(). * * Caller should fclose the returned descriptor when finished. * * Results: * !NULL A FILE * associated with the file associated with the fd * NULL Failure * * Side effects: * New fd allocated. * *----------------------------------------------------------------------------- */ FILE * FileIO_DescriptorToStream(FileIODescriptor *fdesc, // IN: Bool textMode) // IN: unused { int dupFD; const char *mode; int tmpFlags; FILE *stream; dupFD = dup(fdesc->posix); if (dupFD == -1) { return NULL; } /* The file you pass us should be valid and opened for *something* */ ASSERT(FileIO_IsValid(fdesc)); ASSERT((fdesc->flags & (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE)) != 0); tmpFlags = fdesc->flags & (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE); if (tmpFlags == (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE)) { mode = "r+"; } else if (tmpFlags == FILEIO_OPEN_ACCESS_WRITE) { mode = "w"; } else { /* therefore (tmpFlags == FILEIO_OPEN_ACCESS_READ) */ mode = "r"; } stream = fdopen(dupFD, mode); if (stream == NULL) { close(dupFD); } return stream; } #if defined(__APPLE__) /* *---------------------------------------------------------------------- * * HostSupportsPrealloc -- * * Returns TRUE if the host OS is new enough to support F_PREALLOCATE * without data loss bugs. On OSX, this has been verified fixed * on 10.6 build with kern.osrelease 10.0.0d6. * * Results: * TRUE if the current host OS is new enough. * FALSE if it is not or we can't tell because of an error. * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool HostSupportsPrealloc(void) { static Atomic_uint32 supported = { 0 }; enum { PREALLOC_UNKNOWN = 0, PREALLOC_YES, PREALLOC_NO } val; char curRel[32]; char type; unsigned static const int req[] = { 10, 0, 0, 6 }; unsigned int cur[4], i; int num; size_t len = sizeof curRel; Bool ret = FALSE; val = Atomic_Read(&supported); if (val != PREALLOC_UNKNOWN) { return val == PREALLOC_YES; } if (sysctlbyname("kern.osrelease", (void *) &curRel, &len, NULL, 0) == -1) { goto exit; } curRel[31] = '\0'; Log("Current OS Release is %s\n", curRel); /* * Apple's osversion is in the format X.Y.Z which maps to the public * OSX version 10.X-4.Y, and Z is incremented for each publicly * released build. The Z part is of the form AB, where a and * B are version numbers and is either d (devel), a (alpha), * b (beta), rc, or fc. If the B is missing, then its a GA build. * * Since we're checking for 10.0.0d6, we can just say anything without * a type or with a type other than d is higher. For d, we compare * the last number. */ num = sscanf(curRel, "%u.%u.%u%c%u", &cur[0], &cur[1], &cur[2], &type, &cur[3]); if (num < 3) { goto exit; } for (i = 0; i < 3; i++) { if (req[i] > cur[i]) { goto exit; } else if (req[i] < cur[i]) { ret = TRUE; goto exit; } } if (num == 5 && type == 'd') { ret = req[3] <= cur[3]; goto exit; } /* * If we get a type with no letter (num == 4), thats odd. * Consider it mal-formatted and fail. */ ret = num != 4; exit: if (!ret && filePosixOptions.initialized && filePosixOptions.aioNumThreads == 1) { ret = TRUE; } Atomic_Write(&supported, ret ? PREALLOC_YES : PREALLOC_NO); return ret; } #else /* *---------------------------------------------------------------------- * * HostSupportsPrealloc -- * * fallocate() is supported for ext4 and xfs since 2.6.23 kernels * * Results: * TRUE if the current host is linux and kernel is >= 2.6.23. * FALSE if it is not . * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool HostSupportsPrealloc(void) { #if (defined(__linux__ ) && !defined(VMX86_SERVER)) if (Hostinfo_OSVersion(0) >=2 && Hostinfo_OSVersion(1) >=6 && Hostinfo_OSVersion(2) >=23) { return TRUE; } #endif return FALSE; } #endif /* *---------------------------------------------------------------------------- * * FileIO_SupportsPrealloc -- * * Checks if the HostOS/filesystem supports preallocation. * * Results: * TRUE if supported by the Host OS/filesystem. * * Side effects: * None. * *---------------------------------------------------------------------------- */ Bool FileIO_SupportsPrealloc(const char *pathName, // IN: Bool fsCheck) // IN: { Bool ret = TRUE; if (!HostSupportsPrealloc()) { return FALSE; } if (!fsCheck) { return ret; } #if (defined( __linux__) && !defined(VMX86_SERVER)) { struct statfs statBuf; char *fullPath; ret = FALSE; if (!pathName) { return ret; } fullPath = File_FullPath(pathName); if (!fullPath) { return ret; } if (Posix_Statfs(fullPath, &statBuf) == 0 && statBuf.f_type == EXT4_SUPER_MAGIC) { ret = TRUE; } free(fullPath); } #endif return ret; } /* * The FileIOAligned_* functions are only used on * hosted (see fileInt.h for rationale). */ #if !defined(VMX86_TOOLS) && !defined(VMX86_SERVER) /* *--------------------------------------------------------------------------- * * FileIOAligned_PoolInit -- * * Initialize alignedPool. Must be called before FileIOAligned_PoolMalloc. * * Result: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ void FileIOAligned_PoolInit(void) { alignedPool.lock = MXUser_CreateSingletonExclLock(&alignedPoolLockStorage, "alignedPoolLock", RANK_LEAF); VERIFY(alignedPool.lock); } /* *--------------------------------------------------------------------------- * * FileIOAligned_PoolExit -- * * Tear down alignedPool. Afterwards, PoolInit can be called again if * desired. * * Result: * None. * * Side effects: * None. * *--------------------------------------------------------------------------- */ void FileIOAligned_PoolExit(void) { if (!alignedPool.lock) { LOG_ONCE(("%s called without FileIOAligned_Pool lock\n", __FUNCTION__)); return; } MXUser_AcquireExclLock(alignedPool.lock); if (alignedPool.numBusy > 0) { LOG_ONCE(("%s: %d busy buffers! Proceeding with trepidation.\n", __FUNCTION__, alignedPool.numBusy)); } while (alignedPool.numAlloc > 0) { alignedPool.numAlloc--; Aligned_Free(alignedPool.list[alignedPool.numAlloc]); } MXUser_ReleaseExclLock(alignedPool.lock); MXUser_DestroyExclLock(alignedPool.lock); memset(&alignedPool, 0, sizeof alignedPool); } /* *--------------------------------------------------------------------------- * * FileIOAligned_PoolMalloc -- * * Alloc a chunk of memory aligned on a page boundary using a memory * pool. Result needs to be freed with FileIOAligned_PoolFree. Returns * NULL if the pool is full or the requested size cannot be satisfied from * the pool. * * Result: * A pointer. NULL if requested size is too large, or on out of memory * condition. * * Side effects: * None. * *--------------------------------------------------------------------------- */ void * FileIOAligned_PoolMalloc(size_t size) // IN: { void *buf = NULL; if (!alignedPool.lock) { LOG_ONCE(("%s called without FileIOAligned_Pool lock\n", __FUNCTION__)); return NULL; } if (size > ALIGNEDPOOL_BUFSZ) { return NULL; } MXUser_AcquireExclLock(alignedPool.lock); ASSERT(alignedPool.numBusy <= ARRAYSIZE(alignedPool.list)); ASSERT(alignedPool.numAlloc <= ARRAYSIZE(alignedPool.list)); ASSERT(alignedPool.numBusy <= alignedPool.numAlloc); if (alignedPool.numBusy == ARRAYSIZE(alignedPool.list)) { goto done; } if (alignedPool.numBusy == alignedPool.numAlloc) { buf = Aligned_UnsafeMalloc(ALIGNEDPOOL_BUFSZ); /* If allocation fails, just bail. */ if (buf) { alignedPool.list[alignedPool.numAlloc] = buf; alignedPool.numBusy = ++alignedPool.numAlloc; } goto done; } buf = alignedPool.list[alignedPool.numBusy]; alignedPool.numBusy++; done: MXUser_ReleaseExclLock(alignedPool.lock); return buf; } /* *--------------------------------------------------------------------------- * * FileIOAligned_PoolFree -- * * Test if a pointer was allocated from alignedPool, and if so, free it. * * Result: * TRUE if ptr was allocated from alignedPool. ptr is returned to pool. * FALSE otherwise. * * Side effects: * Might Aligned_Free() some entries from alignedPool if the timestamp[] * entries indicate that we have not needed them for a while. * *--------------------------------------------------------------------------- */ Bool FileIOAligned_PoolFree(void *ptr) // IN: { unsigned i; Bool ret = FALSE; VmTimeType now; if (!alignedPool.lock) { LOG_ONCE(("%s called without FileIOAligned_Pool lock\n", __FUNCTION__)); return FALSE; } MXUser_AcquireExclLock(alignedPool.lock); ASSERT(alignedPool.numBusy <= ARRAYSIZE(alignedPool.list)); ASSERT(alignedPool.numAlloc <= ARRAYSIZE(alignedPool.list)); ASSERT(alignedPool.numBusy <= alignedPool.numAlloc); for (i = 0; i < alignedPool.numBusy; i++) { if (alignedPool.list[i] == ptr) { break; } } if (i == alignedPool.numBusy) { /* The pointer wasn't allocated from our pool. */ goto done; } alignedPool.numBusy--; /* * At this point either i points to the "top" busy item, or i points to an * earlier busy item. If i points to the top, we're done, and the following * "swap" is a noop. If i points somewhere further down the busy list, we * can simply move the newly freed item to the top of the free list by * swapping its place with the not-freed item at list[numBusy]. */ alignedPool.list[i] = alignedPool.list[alignedPool.numBusy]; alignedPool.list[alignedPool.numBusy] = ptr; now = Hostinfo_SystemTimerNS(); alignedPool.timestamp[alignedPool.numBusy] = now; while (alignedPool.numAlloc > alignedPool.numBusy && now - alignedPool.timestamp[alignedPool.numAlloc - 1] > ALIGNEDPOOL_OLD_AGE) { alignedPool.numAlloc--; Aligned_Free(alignedPool.list[alignedPool.numAlloc]); alignedPool.list[alignedPool.numAlloc] = NULL; } ret = TRUE; done: MXUser_ReleaseExclLock(alignedPool.lock); return ret; } #endif open-vm-tools-10.0.7-3227872/lib/file/file.c0000644000000000000000000017010412660700525016426 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * file.c -- * * Interface to host file system. See also filePosix.c, * fileWin32.c, etc. * * If a function can be implemented such that it has no dependencies * outside of lib/misc, place the function in fileStandAlone.c, NOT * here. */ #if defined(_WIN32) #include #endif #include #include #include #include #include "safetime.h" #if defined(_WIN32) #include #define S_IXUSR 0100 #define S_IWUSR 0200 #else #include #endif #include #include #include #include "vmware.h" #include "util.h" #include "str.h" #include "msg.h" #include "log.h" #include "random.h" #include "uuid.h" #include "config.h" #include "posix.h" #include "file.h" #include "fileIO.h" #include "util.h" #include "fileInt.h" #include "dynbuf.h" #include "base64.h" #include "timeutil.h" #include "hostinfo.h" #include "hostType.h" #include "vm_atomic.h" #include "fileLock.h" #include "userlock.h" #include "unicodeOperations.h" /* *---------------------------------------------------------------------- * * File_Exists -- * * Check if a file is accessible with the process' real user ID * * XXX - This function invokes access(), which uses the real uid, * not the effective uid, so it probably does not do what you * expect. Instead it should use Posix_EuidAccess(), which * uses the effective uid, but it's too risky to fix right now. * See PR 459242. * * Results: * TRUE file is accessible with the process' real uid * FALSE file doesn't exist or an error occured * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_Exists(const char *pathName) // IN: May be NULL. { return FileIO_IsSuccess(FileIO_Access(pathName, FILEIO_ACCESS_EXISTS)); } /* *---------------------------------------------------------------------- * * File_UnlinkIfExists -- * * If the given file exists, unlink it. * * Results: * Return 0 if the unlink is successful or if the file did not exist. * Otherwise return -1. * * Side effects: * May unlink the file. * *---------------------------------------------------------------------- */ int File_UnlinkIfExists(const char *pathName) // IN: { int ret = FileDeletion(pathName, TRUE); if (ret != 0) { ret = (ret == ENOENT) ? 0 : -1; } return ret; } /* *----------------------------------------------------------------------------- * * File_SupportsMandatoryLock -- * * Determines if the underlying filesystem for a particular location * can support mandatory locking. Mandatory locking is used within * FileLock to make the advisory FileLock self-cleaning in the event * of host failure. * * Results: * TRUE if FILEIO_OPEN_EXCLUSIVE_LOCK will work, FALSE otherwise. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool File_SupportsMandatoryLock(const char *pathName) // IN: file to be locked { /* * For now, "know" that all ESX filesystems support mandatory locks * and no non-ESX filesystems support mandatory locks. */ return HostType_OSIsVMK(); } /* *---------------------------------------------------------------------- * * File_IsDirectory -- * * Check if specified file is a directory or not. * * Results: * TRUE is a directory * FALSE is not a directory or an error occured * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_IsDirectory(const char *pathName) // IN: { FileData fileData; return (FileAttributes(pathName, &fileData) == 0) && (fileData.fileType == FILE_TYPE_DIRECTORY); } /* *----------------------------------------------------------------------------- * * File_GetFilePermissions -- * * Return the read / write / execute permissions of a file. * * Results: * TRUE if success, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool File_GetFilePermissions(const char *pathName, // IN: int *mode) // OUT: file mode { FileData fileData; ASSERT(mode); if (FileAttributes(pathName, &fileData) != 0) { return FALSE; } *mode = fileData.fileMode; #if defined(_WIN32) /* * On Win32 implementation of FileAttributes does not return execution * bit. */ if (FileIO_Access(pathName, FILEIO_ACCESS_EXEC) == FILEIO_SUCCESS) { *mode |= S_IXUSR; } #endif return TRUE; } /* *---------------------------------------------------------------------- * * File_Unlink -- * * Unlink the file. * * POSIX: If name is a symbolic link, then unlink the the file the link * refers to as well as the link itself. Only one level of links are * followed. * WINDOWS: No symbolic links so no link following. * * Results: * Return 0 if the unlink is successful. Otherwise, returns -1. * * Side effects: * The file is removed. * *---------------------------------------------------------------------- */ int File_Unlink(const char *pathName) // IN: { return (FileDeletion(pathName, TRUE) == 0) ? 0 : -1; } /* *---------------------------------------------------------------------- * * File_UnlinkNoFollow -- * * Unlink the file (do not follow symbolic links). * On Windows, there are no symbolic links so this is the same as * File_Unlink * * Results: * Return 0 if the unlink is successful. Otherwise, returns -1. * * Side effects: * The file is removed. * *---------------------------------------------------------------------- */ int File_UnlinkNoFollow(const char *pathName) // IN: { return (FileDeletion(pathName, FALSE) == 0) ? 0 : -1; } /* *---------------------------------------------------------------------- * * File_CreateDirectoryEx -- * * Creates the specified directory with the specified permissions. * * Results: * True if the directory is successfully created, false otherwise. * * Side effects: * Creates the directory on disk. * *---------------------------------------------------------------------- */ Bool File_CreateDirectoryEx(const char *pathName, // IN: int mask) // IN: { int err = FileCreateDirectory(pathName, mask); return err == 0; } /* *---------------------------------------------------------------------- * * File_CreateDirectory -- * * Creates the specified directory with 0777 permissions. * * Results: * True if the directory is successfully created, false otherwise. * * Side effects: * Creates the directory on disk. * *---------------------------------------------------------------------- */ Bool File_CreateDirectory(const char *pathName) // IN: { return File_CreateDirectoryEx(pathName, 0777); } /* *---------------------------------------------------------------------- * * File_EnsureDirectoryEx -- * * If the directory doesn't exist, creates it. If the directory * already exists, do nothing and succeed. * * Results: * See above. * * Side effects: * May create a directory on disk. * *---------------------------------------------------------------------- */ Bool File_EnsureDirectoryEx(const char *pathName, // IN: int mask) // IN: { int err = FileCreateDirectory(pathName, mask); return ((err == 0) || (err == EEXIST)); } /* *---------------------------------------------------------------------- * * File_EnsureDirectory -- * * If the directory doesn't exist, creates it. If the directory * already exists, do nothing and succeed. * * Results: * See above. * * Side effects: * May create a directory on disk. * *---------------------------------------------------------------------- */ Bool File_EnsureDirectory(const char *pathName) // IN: { return File_EnsureDirectoryEx(pathName, 0777); } /* *---------------------------------------------------------------------- * * File_DeleteEmptyDirectory -- * * Deletes the specified directory if it is empty. * * Results: * True if the directory is successfully deleted, false otherwise. * * Side effects: * Deletes the directory from disk. * *---------------------------------------------------------------------- */ Bool File_DeleteEmptyDirectory(const char *pathName) // IN: { Bool returnValue = TRUE; if (FileRemoveDirectory(pathName) != 0) { #if defined(_WIN32) /* * Directory may have read-only bit set. Unset the * read-only bit and try deleting one more time. */ if (File_SetFilePermissions(pathName, S_IWUSR)) { if (FileRemoveDirectory(pathName) != 0) { returnValue = FALSE; } } else { returnValue = FALSE; } #else returnValue = FALSE; #endif } return returnValue; } /* *---------------------------------------------------------------------- * * GetOldMachineID -- * * Return the old machineID, the one based on Hostinfo_MachineID. * * Results: * The machineID is returned. It should not be freed. * * Side effects: * Memory allocated for the machineID is never freed, however the * memory is cached - there is no memory leak. * *---------------------------------------------------------------------- */ static const char * GetOldMachineID(void) { static Atomic_Ptr atomic; /* Implicitly initialized to NULL. --mbellon */ const char *machineID; machineID = Atomic_ReadPtr(&atomic); if (machineID == NULL) { char *p; uint32 hashValue; uint64 hardwareID; char encodedMachineID[16 + 1]; char rawMachineID[sizeof hashValue + sizeof hardwareID]; Hostinfo_MachineID(&hashValue, &hardwareID); /* Build the raw machineID */ memcpy(rawMachineID, &hashValue, sizeof hashValue); memcpy(&rawMachineID[sizeof hashValue], &hardwareID, sizeof hardwareID); /* Base 64 encode the binary data to obtain printable characters */ Base64_Encode(rawMachineID, sizeof rawMachineID, encodedMachineID, sizeof encodedMachineID, NULL); /* remove '/' from the encoding; no problem using it for a file name */ for (p = encodedMachineID; *p; p++) { if (*p == '/') { *p = '-'; } } p = Util_SafeStrdup(encodedMachineID); if (Atomic_ReadIfEqualWritePtr(&atomic, NULL, p)) { free(p); } machineID = Atomic_ReadPtr(&atomic); ASSERT(machineID); } return machineID; } /* *---------------------------------------------------------------------- * * FileLockGetMachineID -- * * Return the machineID, a "universally unique" identification of * of the system that calls this routine. * * An attempt is first made to use the host machine's UUID. If that * fails drop back to the older machineID method. * * Results: * The machineID is returned. It should not be freed. * * Side effects: * Memory allocated for the machineID is never freed, however the * memory is cached - there is no memory leak. * *---------------------------------------------------------------------- */ const char * FileLockGetMachineID(void) { static Atomic_Ptr atomic; /* Implicitly initialized to NULL. --mbellon */ const char *machineID; machineID = Atomic_ReadPtr(&atomic); if (machineID == NULL) { char *p; char *q; /* * UUID_GetHostRealUUID is fine on Windows. * * UUID_GetHostUUID is fine on Macs because the UUID can't be found * in /dev/mem even if it can be accessed. Macs always use the MAC * address from en0 to provide a UUID. * * UUID_GetHostUUID is problematic on Linux so it is not acceptable for * locking purposes - it accesses /dev/mem to obtain the SMBIOS UUID * and that can fail when the calling process is not priviledged. * */ #if defined(_WIN32) q = UUID_GetRealHostUUID(); #elif defined(__APPLE__) || defined(VMX86_SERVER) q = UUID_GetHostUUID(); #else q = NULL; #endif if (q == NULL) { p = Util_SafeStrdup(GetOldMachineID()); } else { p = Str_SafeAsprintf(NULL, "uuid=%s", q); free(q); /* Surpress any whitespace. */ for (q = p; *q; q++) { if (isspace((int) *q)) { *q = '-'; } } } if (Atomic_ReadIfEqualWritePtr(&atomic, NULL, p)) { free(p); } machineID = Atomic_ReadPtr(&atomic); ASSERT(machineID); } return machineID; } /* *----------------------------------------------------------------------------- * * OldMachineIDMatch -- * * Do the old-style MachineIDs match? * * Results: * TRUE Yes * FALSE No * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool OldMachineIDMatch(const char *first, // IN: const char *second) // IN: { #if defined(__APPLE__) || defined(linux) /* Ignore the host name hash */ char *p; char *q; size_t len; Bool result; uint8 rawMachineID_1[12]; uint8 rawMachineID_2[12]; for (p = Util_SafeStrdup(first), q = p; *p; p++) { if (*p == '-') { *p = '/'; } } result = Base64_Decode(q, rawMachineID_1, sizeof rawMachineID_1, &len); free(q); if ((result == FALSE) || (len != 12)) { Warning("%s: unexpected decode problem #1 (%s)\n", __FUNCTION__, first); return FALSE; } for (p = Util_SafeStrdup(second), q = p; *p; p++) { if (*p == '-') { *p = '/'; } } result = Base64_Decode(q, rawMachineID_2, sizeof rawMachineID_2, &len); free(q); if ((result == FALSE) || (len != 12)) { Warning("%s: unexpected decode problem #2 (%s)\n", __FUNCTION__, second); return FALSE; } return memcmp(&rawMachineID_1[4], &rawMachineID_2[4], 8) == 0 ? TRUE : FALSE; #else return strcmp(first, second) == 0 ? TRUE : FALSE; #endif } /* *----------------------------------------------------------------------------- * * FileLockMachineIDMatch -- * * Do the MachineIDs match? * * Results: * TRUE Yes * FALSE No * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool FileLockMachineIDMatch(const char *hostMachineID, // IN: const char *otherMachineID) // IN: { if (strncmp(hostMachineID, "uuid=", 5) == 0) { if (strncmp(otherMachineID, "uuid=", 5) == 0) { return strcmp(hostMachineID + 5, otherMachineID + 5) == 0 ? TRUE : FALSE; } else { return OldMachineIDMatch(GetOldMachineID(), otherMachineID); } } else { if (strncmp(otherMachineID, "uuid=", 5) == 0) { return FALSE; } else { return strcmp(hostMachineID, otherMachineID) == 0 ? TRUE : FALSE; } } } /* *---------------------------------------------------------------------------- * * File_IsEmptyDirectory -- * * Check if specified file is a directory and contains no files. * * Results: * Bool - TRUE -> is an empty directory, FALSE -> not an empty directory * * Side effects: * None * *---------------------------------------------------------------------------- */ Bool File_IsEmptyDirectory(const char *pathName) // IN: { int numFiles; if (!File_IsDirectory(pathName)) { return FALSE; } numFiles = File_ListDirectory(pathName, NULL); if (numFiles < 0) { return FALSE; } return numFiles == 0; } /* *---------------------------------------------------------------------------- * * File_IsOsfsVolumeEmpty -- * * Check if specified OSFS volume contains no files. * This method ignore hidden .sf files. *.sf files are VMFS * metadata files. * * OSFS based volumes are considered empty even if they * contain vmfs metadata files. This emptiness can not be * checked by File_IsEmptyDirectory API (PR 1050328). * * Results: * Bool - TRUE -> is vmfs empty directory, FALSE -> not an vmfs * empty directory * * Side effects: * None * *---------------------------------------------------------------------------- */ Bool File_IsOsfsVolumeEmpty(const char *pathName) // IN: { int i, numFiles; char **fileList = NULL; static const char vmfsSystemFilesuffix[] = ".sf"; Bool onlyVmfsSystemFilesFound = TRUE; numFiles = File_ListDirectory(pathName, &fileList); if (numFiles == -1) { return FALSE; } for (i = 0; i < numFiles; i++) { if (!Unicode_EndsWith(fileList[i], vmfsSystemFilesuffix)) { onlyVmfsSystemFilesFound = FALSE; break; } } Util_FreeStringList(fileList, numFiles); return onlyVmfsSystemFilesFound; } /* *---------------------------------------------------------------------- * * File_IsFile -- * * Check if specified file is a regular file. * * Results: * TRUE is a regular file * FALSE is not a regular file or an error occured. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_IsFile(const char *pathName) // IN: { FileData fileData; return (FileAttributes(pathName, &fileData) == 0) && (fileData.fileType == FILE_TYPE_REGULAR); } /* *---------------------------------------------------------------------- * * File_CopyFromFdToFd -- * * Write all data between the current position in the 'src' file and the * end of the 'src' file to the current position in the 'dst' file * * Results: * TRUE success * FALSE failure * * Side effects: * The current position in the 'src' file and the 'dst' file are modified * *---------------------------------------------------------------------- */ Bool File_CopyFromFdToFd(FileIODescriptor src, // IN: FileIODescriptor dst) // IN: { Err_Number err; FileIOResult fretR; do { unsigned char buf[8 * 1024]; size_t actual; FileIOResult fretW; fretR = FileIO_Read(&src, buf, sizeof buf, &actual); if (!FileIO_IsSuccess(fretR) && (fretR != FILEIO_READ_ERROR_EOF)) { err = Err_Errno(); Msg_Append(MSGID(File.CopyFromFdToFd.read.failure) "Read error: %s.\n\n", FileIO_MsgError(fretR)); Err_SetErrno(err); return FALSE; } fretW = FileIO_Write(&dst, buf, actual, NULL); if (!FileIO_IsSuccess(fretW)) { err = Err_Errno(); Msg_Append(MSGID(File.CopyFromFdToFd.write.failure) "Write error: %s.\n\n", FileIO_MsgError(fretW)); Err_SetErrno(err); return FALSE; } } while (fretR != FILEIO_READ_ERROR_EOF); return TRUE; } /* *----------------------------------------------------------------------------- * * FileCopyTree -- * * Recursively copies all files from a source path to a destination, * optionally overwriting any files. This does the actual work * for File_CopyTree. * * Results: * TRUE on success * FALSE on failure: Error messages are appended. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool FileCopyTree(const char *srcName, // IN: const char *dstName, // IN: Bool overwriteExisting, // IN: Bool followSymlinks) // IN: { int err; Bool success = TRUE; int numFiles; int i; char **fileList = NULL; numFiles = File_ListDirectory(srcName, &fileList); if (numFiles == -1) { err = Err_Errno(); Msg_Append(MSGID(File.CopyTree.walk.failure) "Unable to access '%s' when copying files.\n\n", srcName); Err_SetErrno(err); return FALSE; } File_EnsureDirectory(dstName); for (i = 0; i < numFiles && success; i++) { struct stat sb; char *srcFilename; srcFilename = File_PathJoin(srcName, fileList[i]); if (followSymlinks) { success = (Posix_Stat(srcFilename, &sb) == 0); } else { success = (Posix_Lstat(srcFilename, &sb) == 0); } if (success) { char *dstFilename = File_PathJoin(dstName, fileList[i]); switch (sb.st_mode & S_IFMT) { case S_IFDIR: success = FileCopyTree(srcFilename, dstFilename, overwriteExisting, followSymlinks); break; #if !defined(_WIN32) case S_IFLNK: if (Posix_Symlink(Posix_ReadLink(srcFilename), dstFilename) != 0) { err = Err_Errno(); Msg_Append(MSGID(File.CopyTree.symlink.failure) "Unable to symlink '%s' to '%s': %s\n\n", Posix_ReadLink(srcFilename), dstFilename, Err_Errno2String(err)); Err_SetErrno(err); success = FALSE; } break; #endif default: if (!File_Copy(srcFilename, dstFilename, overwriteExisting)) { err = Err_Errno(); Msg_Append(MSGID(File.CopyTree.copy.failure) "Unable to copy '%s' to '%s': %s\n\n", srcFilename, dstFilename, Err_Errno2String(err)); Err_SetErrno(err); success = FALSE; } break; } free(dstFilename); } else { err = Err_Errno(); Msg_Append(MSGID(File.CopyTree.stat.failure) "Unable to get information on '%s' when copying files.\n\n", srcFilename); Err_SetErrno(err); } free(srcFilename); } Util_FreeStringList(fileList, numFiles); return success; } /* *----------------------------------------------------------------------------- * * File_CopyTree -- * * Recursively copies all files from a source path to a destination, * optionally overwriting any files. * * Results: * TRUE on success * FALSE on failure: Error messages are appended. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool File_CopyTree(const char *srcName, // IN: const char *dstName, // IN: Bool overwriteExisting, // IN: Bool followSymlinks) // IN: { int err; ASSERT(srcName); ASSERT(dstName); if (!File_IsDirectory(srcName)) { err = Err_Errno(); Msg_Append(MSGID(File.CopyTree.source.notDirectory) "Source path '%s' is not a directory.", srcName); Err_SetErrno(err); return FALSE; } if (!File_IsDirectory(dstName)) { err = Err_Errno(); Msg_Append(MSGID(File.CopyTree.dest.notDirectory) "Destination path '%s' is not a directory.", dstName); Err_SetErrno(err); return FALSE; } return FileCopyTree(srcName, dstName, overwriteExisting, followSymlinks); } /* *---------------------------------------------------------------------- * * File_CopyFromFd -- * * Copy the 'src' file to 'dstName'. * If the 'dstName' file already exists, 'overwriteExisting' * decides whether to overwrite the existing file or not. * * Results: * TRUE on success * FALSE on failure: Messages are appended * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_CopyFromFd(FileIODescriptor src, // IN: const char *dstName, // IN: Bool overwriteExisting) // IN: { Bool success; Err_Number err; FileIOResult fret; FileIODescriptor dst; FileIOOpenAction action; ASSERT(dstName); FileIO_Invalidate(&dst); action = overwriteExisting ? FILEIO_OPEN_CREATE_EMPTY : FILEIO_OPEN_CREATE_SAFE; fret = FileIO_Open(&dst, dstName, FILEIO_OPEN_ACCESS_WRITE, action); if (!FileIO_IsSuccess(fret)) { err = Err_Errno(); Msg_Append(MSGID(File.CopyFromFdToName.create.failure) "Unable to create a new '%s' file: %s.\n\n", dstName, FileIO_MsgError(fret)); Err_SetErrno(err); return FALSE; } success = File_CopyFromFdToFd(src, dst); err = Err_Errno(); if (!FileIO_IsSuccess(FileIO_Close(&dst))) { if (success) { // Report close failure when there isn't another error err = Err_Errno(); } Msg_Append(MSGID(File.CopyFromFdToName.close.failure) "Unable to close the '%s' file: %s.\n\n", dstName, Msg_ErrString()); success = FALSE; } if (!success) { /* The copy failed: ensure the destination file is removed */ File_Unlink(dstName); } Err_SetErrno(err); return success; } /* *---------------------------------------------------------------------- * * File_Copy -- * * Copy the 'srcName' file to 'dstName'. * If 'srcName' doesn't exist, an error is reported * If the 'dstName' file already exists, 'overwriteExisting' * decides whether to overwrite the existing file or not. * * Results: * TRUE on success * FALSE on failure: Messages are appended * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_Copy(const char *srcName, // IN: const char *dstName, // IN: Bool overwriteExisting) // IN: { Bool success; Err_Number err; FileIOResult fret; FileIODescriptor src; ASSERT(srcName); ASSERT(dstName); FileIO_Invalidate(&src); fret = FileIO_Open(&src, srcName, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); if (!FileIO_IsSuccess(fret)) { err = Err_Errno(); Msg_Append(MSGID(File.Copy.open.failure) "Unable to open the '%s' file for read access: %s.\n\n", srcName, FileIO_MsgError(fret)); Err_SetErrno(err); return FALSE; } success = File_CopyFromFd(src, dstName, overwriteExisting); err = Err_Errno(); if (!FileIO_IsSuccess(FileIO_Close(&src))) { if (success) { // Report close failure when there isn't another error err = Err_Errno(); } Msg_Append(MSGID(File.Copy.close.failure) "Unable to close the '%s' file: %s.\n\n", srcName, Msg_ErrString()); success = FALSE; } Err_SetErrno(err); return success; } /* *---------------------------------------------------------------------- * * File_Move -- * * Moves a file from one place to the other as efficiently as possible. * This can be used to rename a file but, since file copying may be * necessary, there is no assurance of atomicity. For efficiency * purposes copying only results if the native rename ability fails. * * Results: * TRUE succeeded * FALSE otherwise * * Side effects: * src file is no more, but dst file exists * *---------------------------------------------------------------------- */ Bool File_Move(const char *oldFile, // IN: const char *newFile, // IN: Bool *asRename) // OUT/OPT: result occurred due to rename/copy { Bool ret; Bool duringRename; if (File_Rename(oldFile, newFile) == 0) { duringRename = TRUE; ret = TRUE; Err_SetErrno(0); } else { duringRename = FALSE; if (File_Copy(oldFile, newFile, TRUE)) { // Allow overwrite File_Unlink(oldFile); // Explicitly ignore errors ret = TRUE; Err_SetErrno(0); } else { ret = FALSE; } } if (asRename) { *asRename = duringRename; } return ret; } /* *----------------------------------------------------------------------------- * * File_MoveTree -- * * Moves a directory from one place to the other. * - If dstName indicates a path that does not exist a directory will be * created with that path filled with the contents from srcName. * - If dstName is an existing directory then the contents will be moved * into that directory. * - If dstName indicates a file then File_MoveTree fails. * * First we'll attempt to rename the directory, failing that we copy the * contents from src->destination and unlink the src. If the copy is * succesful then we will report success even if the unlink fails for some * reason. In that event we will append error messages. * * Results: * TRUE - on success * FALSE - on failure with error messages appended * * Side effects: * - Deletes the originating directory * - In the event of a failed copy we'll leave the new directory in a state * *----------------------------------------------------------------------------- */ Bool File_MoveTree(const char *srcName, // IN: const char *dstName, // IN: Bool overwriteExisting, // IN: Bool *asMove) // OUT/OPT: { Bool ret = FALSE; Bool createdDir = FALSE; ASSERT(srcName); ASSERT(dstName); if (asMove) { *asMove = FALSE; } if (!File_IsDirectory(srcName)) { Msg_Append(MSGID(File.MoveTree.source.notDirectory) "Source path '%s' is not a directory.", srcName); return FALSE; } if (File_Rename(srcName, dstName) == 0) { if (asMove) { *asMove = TRUE; } ret = TRUE; } else { struct stat statbuf; if (-1 == Posix_Stat(dstName, &statbuf)) { int err = Err_Errno(); if (ENOENT == err) { if (!File_CreateDirectoryHierarchy(dstName, NULL)) { Msg_Append(MSGID(File.MoveTree.dst.couldntCreate) "Could not create '%s'.\n\n", dstName); return FALSE; } createdDir = TRUE; } else { Msg_Append(MSGID(File.MoveTree.statFailed) "%d:Failed to stat destination '%s'.\n\n", err, dstName); return FALSE; } } else { if (!File_IsDirectory(dstName)) { Msg_Append(MSGID(File.MoveTree.dest.notDirectory) "The destination path '%s' is not a directory.\n\n", dstName); return FALSE; } } #if !defined(__FreeBSD__) && !defined(sun) /* * File_GetFreeSpace is not defined for FreeBSD */ if (createdDir) { /* * Check for free space on destination filesystem. * We only check for free space if the destination directory * did not exist. In this case, we will not be overwriting any existing * paths, so we need as much space as srcName. */ int64 srcSize; int64 freeSpace; srcSize = File_GetSizeEx(srcName); freeSpace = File_GetFreeSpace(dstName, TRUE); if (freeSpace < srcSize) { char *spaceStr = Msg_FormatSizeInBytes(srcSize); Msg_Append(MSGID(File.MoveTree.dst.insufficientSpace) "There is not enough space in the file system to " "move the directory tree. Free %s and try again.", spaceStr); free(spaceStr); return FALSE; } } #endif if (File_CopyTree(srcName, dstName, overwriteExisting, FALSE)) { ret = TRUE; if (!File_DeleteDirectoryTree(srcName)) { Msg_Append(MSGID(File.MoveTree.cleanupFailed) "Forced to copy '%s' into '%s' but unable to remove " "source directory.\n\n", srcName, dstName); } } else { ret = FALSE; Msg_Append(MSGID(File.MoveTree.copyFailed) "Could not rename and failed to copy source directory " "'%s'.\n\n", srcName); if (createdDir) { /* * Only clean up if we created the directory. Not attempting to * clean up partial failures. */ File_DeleteDirectoryTree(dstName); } } } return ret; } /* *---------------------------------------------------------------------- * * File_GetModTimeString -- * * Returns a human-readable string denoting the last modification * time of a file. * ctime() returns string terminated with newline, which we replace * with a '\0'. * * Results: * Last modification time string on success, NULL on error. * * Side effects: * None. * *---------------------------------------------------------------------- */ char * File_GetModTimeString(const char *pathName) // IN: { int64 modTime; modTime = File_GetModTime(pathName); return (modTime == -1) ? NULL : TimeUtil_GetTimeFormat(modTime, TRUE, TRUE); } /* *---------------------------------------------------------------------------- * * File_GetSize -- * * Get size of file. Try File_GetSizeEx to get size of directory/symlink. * * Results: * Size of file or -1. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int64 File_GetSize(const char *pathName) // IN: { int64 ret; if (pathName == NULL) { ret = -1; } else { FileIODescriptor fd; FileIOResult res; FileIO_Invalidate(&fd); res = FileIO_Open(&fd, pathName, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); if (FileIO_IsSuccess(res)) { ret = FileIO_GetSize(&fd); FileIO_Close(&fd); } else { ret = -1; } } return ret; } /* *---------------------------------------------------------------------- * * File_SupportsLargeFiles -- * * Check if the given file is on an FS that supports 4GB files. * Require 4GB support so we rule out FAT filesystems, which * support 4GB-1 on both Linux and Windows. * * Results: * TRUE if FS supports files over 4GB. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_SupportsLargeFiles(const char *pathName) // IN: { return File_SupportsFileSize(pathName, CONST64U(0x100000000)); } /* *---------------------------------------------------------------------------- * * File_GetSizeEx -- * * Get size of file or directory or symlink. File_GetSize can only get * size of file. * * Results: * Size of file/directory/symlink or -1. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int64 File_GetSizeEx(const char *pathName) // IN: { int numFiles; int i; char **fileList = NULL; struct stat sb; int64 totalSize = 0; if (pathName == NULL) { return -1; } if (-1 == Posix_Lstat(pathName, &sb)) { return -1; } if (S_IFDIR != (sb.st_mode & S_IFMT)) { return sb.st_size; } numFiles = File_ListDirectory(pathName, &fileList); if (-1 == numFiles) { return -1; } for (i = 0; i < numFiles; i++) { char *fileName; int64 fileSize; fileName = File_PathJoin(pathName, fileList[i]); fileSize = File_GetSizeEx(fileName); free(fileName); if (-1 == fileSize) { totalSize = -1; break; } else { totalSize += fileSize; } } Util_FreeStringList(fileList, numFiles); return totalSize; } /* *---------------------------------------------------------------------------- * * File_GetSizeByPath -- * * Get size of a file without opening it. * * Results: * Size of file or -1. * * Side effects: * None. * *---------------------------------------------------------------------------- */ int64 File_GetSizeByPath(const char *pathName) // IN: { return (pathName == NULL) ? -1 : FileIO_GetSizeByPath(pathName); } /* *----------------------------------------------------------------------------- * * File_CreateDirectoryHierarchyEx -- * * Create a directory including any parents that don't already exist. * All the created directories are tagged with the specified permission. * Returns the topmost directory which was created, to allow calling code * to remove it after in case later operations fail. * * Results: * TRUE on success, FALSE on failure. * * If topmostCreated is not NULL, it returns the result of the hierarchy * creation. If no directory was created, *topmostCreated is set to NULL. * Otherwise *topmostCreated is set to the topmost directory which was * created. *topmostCreated is set even in case of failure. * * The caller most free the resulting string. * * Side effects: * Only the obvious. * *----------------------------------------------------------------------------- */ Bool File_CreateDirectoryHierarchyEx(const char *pathName, // IN: int mask, // IN: char **topmostCreated) // OUT/OPT: { char *volume; UnicodeIndex index; UnicodeIndex length; if (topmostCreated != NULL) { *topmostCreated = NULL; } if (pathName == NULL) { return TRUE; } length = Unicode_LengthInCodePoints(pathName); if (length == 0) { return TRUE; } /* * Skip past any volume/share. */ File_SplitName(pathName, &volume, NULL, NULL); index = Unicode_LengthInCodePoints(volume); free(volume); if (index >= length) { return File_IsDirectory(pathName); } /* * Iterate parent directories, splitting on appropriate dir separators. */ while (TRUE) { Bool failed; char *temp; index = FileFirstSlashIndex(pathName, index + 1); temp = Unicode_Substr(pathName, 0, (index == UNICODE_INDEX_NOT_FOUND) ? -1 : index); /* * If we check if the directory already exists and then we create it, * there is a race between these two operations - that might cause this * operation to fail with no reason. * This is why we reverse the attempt and the check. */ failed = !File_CreateDirectoryEx(temp, mask); if (failed) { if (File_IsDirectory(temp)) { failed = FALSE; } } else if (topmostCreated != NULL && *topmostCreated == NULL) { *topmostCreated = temp; temp = NULL; } free(temp); if (failed) { return FALSE; } if (index == UNICODE_INDEX_NOT_FOUND) { break; } } return TRUE; } /* *----------------------------------------------------------------------------- * * File_CreateDirectoryHierarchy -- * * Create a directory including any parents that don't already exist. * All the created directories are tagged with 0777 permissions. * Returns the topmost directory which was created, to allow calling code * to remove it after in case later operations fail. * * Results: * TRUE on success, FALSE on failure. * * If topmostCreated is not NULL, it returns the result of the hierarchy * creation. If no directory was created, *topmostCreated is set to NULL. * Otherwise *topmostCreated is set to the topmost directory which was * created. *topmostCreated is set even in case of failure. * * The caller most free the resulting string. * * Side effects: * Only the obvious. * *----------------------------------------------------------------------------- */ Bool File_CreateDirectoryHierarchy(const char *pathName, // IN: char **topmostCreated) // OUT/OPT: { return File_CreateDirectoryHierarchyEx(pathName, 0777, topmostCreated); } /* *---------------------------------------------------------------------- * * FileDeleteDirectoryTree -- * * Deletes the specified directory tree. If filesystem errors are * encountered along the way, the function will continue to delete what * it can but will return FALSE. If contentOnly is TRUE it does not * delete the directory itself. * * Results: * TRUE the entire tree was deleted or didn't exist * FALSE otherwise. * * Side effects: * Deletes the directory tree from disk. * *---------------------------------------------------------------------- */ static INLINE Bool FileDeleteDirectoryTree(const char *pathName, // IN: directory to delete Bool contentOnly) // IN: Content only or not { int i; int numFiles; int err = 0; char *base; char **fileList = NULL; Bool sawFileError = FALSE; if (Posix_EuidAccess(pathName, F_OK) != 0) { /* * If Posix_EuidAccess failed with errno == ENOSYS, then fall back * to FileAttributes. */ if (errno == ENOSYS) { /* FileAttributes returns the error code instead of setting errno. */ err = FileAttributes(pathName, NULL); } else { /* Use the error value that was set by Posix_EuidAccess. */ err = errno; } } switch (err) { case ENOENT: case ENOTDIR: /* path does not exist or is inaccessible */ return TRUE; default: break; } /* get list of files in current directory */ numFiles = File_ListDirectory(pathName, &fileList); if (numFiles == -1) { return FALSE; } /* delete everything in the directory */ base = Unicode_Append(pathName, DIRSEPS); for (i = 0; i < numFiles; i++) { char *curPath; struct stat statbuf; curPath = Unicode_Append(base, fileList[i]); if (Posix_Lstat(curPath, &statbuf) == 0) { switch (statbuf.st_mode & S_IFMT) { case S_IFDIR: /* Directory, recurse */ if (!FileDeleteDirectoryTree(curPath, FALSE)) { sawFileError = TRUE; } break; #if !defined(_WIN32) case S_IFLNK: /* Delete symlink, not what it points to */ if (FileDeletion(curPath, FALSE) != 0) { sawFileError = TRUE; } break; #endif default: if (FileDeletion(curPath, FALSE) != 0) { #if defined(_WIN32) if (File_SetFilePermissions(curPath, S_IWUSR)) { if (FileDeletion(curPath, FALSE) != 0) { sawFileError = TRUE; } } else { sawFileError = TRUE; } #else sawFileError = TRUE; #endif } break; } } else { sawFileError = TRUE; } free(curPath); } free(base); if (!contentOnly) { /* * Call File_DeleteEmptyDirectory() only if there is no prior error * while deleting the children. */ if (!sawFileError && !File_DeleteEmptyDirectory(pathName)) { sawFileError = TRUE; } } Util_FreeStringList(fileList, numFiles); return !sawFileError; } /* *---------------------------------------------------------------------- * * File_DeleteDirectoryContent -- * * Deletes the specified directory content. If filesystem errors are * encountered along the way, the function will continue to delete what * it can but will return FALSE. * * Results: * TRUE the entire content was deleted or there were no files and the * directoy was empty * FALSE otherwise. * * Side effects: * Deletes the directory content from disk. * *---------------------------------------------------------------------- */ Bool File_DeleteDirectoryContent(const char *pathName) // IN: directory to delete { return FileDeleteDirectoryTree(pathName, TRUE); } /* *---------------------------------------------------------------------- * * File_DeleteDirectoryTree -- * * Deletes the specified directory tree. If filesystem errors are * encountered along the way, the function will continue to delete what * it can but will return FALSE. * * Results: * TRUE the entire tree was deleted or didn't exist * FALSE otherwise. * * Side effects: * Deletes the directory tree from disk. * *---------------------------------------------------------------------- */ Bool File_DeleteDirectoryTree(const char *pathName) // IN: directory to delete { return FileDeleteDirectoryTree(pathName, FALSE); } /* *----------------------------------------------------------------------------- * * File_FindFileInSearchPath -- * * Search all the directories in searchPath for a filename. * If searchPath has a relative path take it with respect to cwd. * searchPath must be ';' delimited. * * Results: * TRUE if a file is found. FALSE otherwise. * * Side effects: * If result is non Null allocate a string for the filename found. * *----------------------------------------------------------------------------- */ Bool File_FindFileInSearchPath(const char *fileIn, // IN: const char *searchPath, // IN: const char *cwd, // IN: char **result) // OUT/OPT: { char *cur; char *tok; Bool found; Bool full; char *saveptr = NULL; char *sp = NULL; char *dir = NULL; char *file = NULL; ASSERT(fileIn); ASSERT(cwd); ASSERT(searchPath); /* * First check the usual places - the fullpath or the cwd. */ full = File_IsFullPath(fileIn); if (full) { cur = Util_SafeStrdup(fileIn); } else { cur = Str_SafeAsprintf(NULL, "%s%s%s", cwd, DIRSEPS, fileIn); } if (Posix_EuidAccess(cur, F_OK) == 0) { goto done; } if (errno == ENOSYS && FileAttributes(cur, NULL) == 0) { goto done; } free(cur); cur = NULL; if (full) { goto done; } File_GetPathName(fileIn, &dir, &file); /* * Search path applies only if filename is simple basename. */ if (Unicode_LengthInCodePoints(dir) != 0) { goto done; } /* * Didn't find it in the usual places so strip it to its bare minimum and * start searching. */ sp = Util_SafeStrdup(searchPath); tok = strtok_r(sp, FILE_SEARCHPATHTOKEN, &saveptr); while (tok) { if (File_IsFullPath(tok)) { /* Fully Qualified Path. Use it. */ cur = Str_SafeAsprintf(NULL, "%s%s%s", tok, DIRSEPS, file); } else { /* Relative Path. Prepend the cwd. */ if (Str_Strcasecmp(tok, ".") == 0) { /* Don't append "." */ cur = Str_SafeAsprintf(NULL, "%s%s%s", cwd, DIRSEPS, file); } else { cur = Str_SafeAsprintf(NULL, "%s%s%s%s%s", cwd, DIRSEPS, tok, DIRSEPS, file); } } if (Posix_EuidAccess(cur, F_OK) == 0) { break; } if ((errno == ENOSYS) && (FileAttributes(cur, NULL) == 0)) { break; } free(cur); cur = NULL; tok = strtok_r(NULL, FILE_SEARCHPATHTOKEN, &saveptr); } done: if (cur) { found = TRUE; if (result) { *result = File_FullPath(cur); if (*result == NULL) { found = FALSE; } } free(cur); } else { found = FALSE; } free(sp); free(dir); free(file); return found; } /* *---------------------------------------------------------------------- * * File_ExpandAndCheckDir -- * * Expand any environment variables in the given path and check that * the named directory is writeable. * * Results: * NULL if error, the expanded path otherwise. * * Side effects: * The result is allocated. * *---------------------------------------------------------------------- */ char * File_ExpandAndCheckDir(const char *dirName) // IN: { if (dirName != NULL) { char *edirName = Util_ExpandString(dirName); if ((edirName != NULL) && FileIsWritableDir(edirName)) { size_t len = strlen(edirName) - 1; if (edirName[len] == DIRSEPC) { edirName[len] = '\0'; } return edirName; } } return NULL; } /* *----------------------------------------------------------------------------- * * FileSimpleRandom -- * * Return a random number in the range of 0 and 2^32-1. * * Results: * Random number is returned. * * Side Effects: * None. * *----------------------------------------------------------------------------- */ uint32 FileSimpleRandom(void) { static Atomic_Ptr lckStorage; static rqContext *context = NULL; uint32 result; MXUserExclLock *lck = MXUser_CreateSingletonExclLock(&lckStorage, "fileSimpleRandomLock", RANK_LEAF); VERIFY(lck != NULL); MXUser_AcquireExclLock(lck); if (UNLIKELY(context == NULL)) { uint32 value; #if defined(_WIN32) value = GetCurrentProcessId(); #else value = getpid(); #endif context = Random_QuickSeed(value); ASSERT(context); } result = Random_Quick(context); MXUser_ReleaseExclLock(lck); return result; } /* *---------------------------------------------------------------------- * * FileSleeper * * Sleep for a random amount of time, no less than the specified minimum * and no more than the specified maximum sleep time values. This often * proves useful to "jitter" retries such that multiple threads don't * easily get into resonance performing necessary actions. * * Results: * Somnambulistic behavior; the amount of time slept is returned. * * Side effects: * None * *---------------------------------------------------------------------- */ uint32 FileSleeper(uint32 msecMinSleepTime, // IN: uint32 msecMaxSleepTime) // IN: { uint32 variance; uint32 msecActualSleepTime; ASSERT(msecMinSleepTime <= msecMaxSleepTime); variance = msecMaxSleepTime - msecMinSleepTime; if (variance == 0) { msecActualSleepTime = msecMinSleepTime; } else { float fpRand = ((float) FileSimpleRandom()) / ((float) ~((uint32) 0)); msecActualSleepTime = msecMinSleepTime + (uint32) (fpRand * variance); } Util_Usleep(1000 * msecActualSleepTime); return msecActualSleepTime; } /* *---------------------------------------------------------------------- * * FileRotateByRename -- * * The oldest indexed file should be removed so that the consequent * rename succeeds. * * The last dst is 'fileName' and should not be deleted. * * Results: * If newFileName is non-NULL: the new path is returned to *newFileName * if the rotation succeeded, otherwise NULL is returned in *newFileName. * The caller is responsible for freeing the string returned in * *newFileName. * * Side effects: * Rename backup old files kept so far. * *---------------------------------------------------------------------- */ static void FileRotateByRename(const char *fileName, // IN: full path to file const char *baseName, // IN: filename w/o extension. const char *ext, // IN: extension int n, // IN: number of old files to keep char **newFileName) // OUT/OPT: new path to file { char *src = NULL; char *dst = NULL; int i; int result; if (newFileName != NULL) { *newFileName = NULL; } for (i = n; i >= 0; i--) { src = (i == 0) ? (char *) fileName : Str_SafeAsprintf(NULL, "%s-%d%s", baseName, i - 1, ext); if (dst == NULL) { result = File_UnlinkIfExists(src); if (result == -1) { Log(LGPFX" %s: failed to remove %s: %s\n", __FUNCTION__, src, Msg_ErrString()); } } else { result = Posix_Rename(src, dst); if (result == -1) { int error = Err_Errno(); if (error != ENOENT) { Log(LGPFX" %s: failed to rename %s -> %s: %s\n", src, dst, __FUNCTION__, Err_Errno2String(error)); } } } if ((src == fileName) && (newFileName != NULL) && (result == 0)) { *newFileName = Util_SafeStrdup(dst); } ASSERT(dst != fileName); free(dst); dst = src; } } /* *---------------------------------------------------------------------- * * FileNumberCompare -- * * Helper function for comparing the contents of two * uint32 pointers a and b, suitable for use by qsort * to order an array of file numbers. * * Results: * The contents of 'a' minus the contents of 'b'. * * Side effects: * None. */ static int FileNumberCompare(const void *a, // IN: const void *b) // IN: { return *(uint32 *) a - *(uint32 *) b; } /* *---------------------------------------------------------------------- * * FileRotateByRenumber -- * * File rotation scheme optimized for vmfs: * 1) find highest numbered file (maxNr) * 2) rename . to -. * 3) delete (nFound - numToKeep) lowest numbered files. * * Wrap around is handled incorrectly. * * Results: * If newFilePath is non-NULL: the new path is returned to *newFilePath * if the rotation succeeded, otherwise NULL is returned in *newFilePath. * The caller is responsible for freeing the string returned in * *newFilePath. * * Side effects: * Files renamed / deleted. * *---------------------------------------------------------------------- */ static void FileRotateByRenumber(const char *filePath, // IN: full path to file const char *filePathNoExt, // IN: filename w/o extension. const char *ext, // IN: extension int n, // IN: number old files to keep char **newFilePath) // OUT/OPT: new path to file { char *baseDir = NULL, *fmtString = NULL, *baseName = NULL, *tmp; char *fullPathNoExt = NULL; uint32 maxNr = 0; int i, nrFiles, nFound = 0; char **fileList = NULL; uint32 *fileNumbers = NULL; int result; if (newFilePath != NULL) { *newFilePath = NULL; } fullPathNoExt = File_FullPath(filePathNoExt); if (fullPathNoExt == NULL) { Log(LGPFX" %s: failed to get full path for '%s'.\n", __FUNCTION__, filePathNoExt); goto cleanup; } File_GetPathName(fullPathNoExt, &baseDir, &baseName); if ((baseDir[0] == '\0') || (baseName[0] == '\0')) { Log(LGPFX" %s: failed to get base dir for path '%s'.\n", __FUNCTION__, filePathNoExt); goto cleanup; } fmtString = Str_SafeAsprintf(NULL, "%s-%%d%s%%n", baseName, ext); nrFiles = File_ListDirectory(baseDir, &fileList); if (nrFiles == -1) { Log(LGPFX" %s: failed to read the directory '%s'.\n", __FUNCTION__, baseDir); goto cleanup; } fileNumbers = Util_SafeCalloc(nrFiles, sizeof(uint32)); for (i = 0; i < nrFiles; i++) { uint32 curNr; int bytesProcessed = 0; /* * Make sure the whole file name matched what we expect for the file. */ if ((sscanf(fileList[i], fmtString, &curNr, &bytesProcessed) >= 1) && (bytesProcessed == strlen(fileList[i]))) { fileNumbers[nFound++] = curNr; } free(fileList[i]); } if (nFound > 0) { qsort(fileNumbers, nFound, sizeof(uint32), FileNumberCompare); maxNr = fileNumbers[nFound - 1]; } /* rename the existing file to the next number */ tmp = Str_SafeAsprintf(NULL, "%s/%s-%d%s", baseDir, baseName, maxNr + 1, ext); result = Posix_Rename(filePath, tmp); if (result == -1) { int error = Err_Errno(); if (error != ENOENT) { Log(LGPFX" %s: failed to rename %s -> %s failed: %s\n", __FUNCTION__, filePath, tmp, Err_Errno2String(error)); } } if (newFilePath == NULL || result == -1) { free(tmp); } else { *newFilePath = tmp; } if (nFound >= n) { /* Delete the extra files. */ for (i = 0; i <= nFound - n; i++) { tmp = Str_SafeAsprintf(NULL, "%s/%s-%d%s", baseDir, baseName, fileNumbers[i], ext); if (Posix_Unlink(tmp) == -1) { Log(LGPFX" %s: failed to remove %s: %s\n", __FUNCTION__, tmp, Msg_ErrString()); } free(tmp); } } cleanup: free(fileNumbers); free(fileList); free(fmtString); free(baseDir); free(baseName); free(fullPathNoExt); } /* *---------------------------------------------------------------------- * * File_Rotate -- * * Rotate old files. The 'noRename' option is useful for filesystems * where rename is hideously expensive (*cough* vmfs). * * Results: * If newFileName is non-NULL: the new path is returned to * *newFileName if the rotation succeeded, otherwise NULL * is returned in *newFileName. The caller is responsible * for freeing the string returned in *newFileName. * * Side effects: * Files are renamed / deleted. * *---------------------------------------------------------------------- */ void File_Rotate(const char *fileName, // IN: original file int n, // IN: number of backup files Bool noRename, // IN: don't rename all files char **newFileName) // OUT/OPT: new path to file { const char *ext; size_t baseLen; char *baseName; ASSERT(fileName); if ((ext = Str_Strrchr(fileName, '.')) == NULL) { ext = fileName + strlen(fileName); } baseLen = ext - fileName; /* * Backup base of file name. * * Since the Str_Asprintf(...) doesn't like format of %.*s and crashes * in Windows 2000. (Daniel Liu) */ baseName = Util_SafeStrdup(fileName); baseName[baseLen] = '\0'; if (noRename) { FileRotateByRenumber(fileName, baseName, ext, n, newFileName); } else { FileRotateByRename(fileName, baseName, ext, n, newFileName); } free(baseName); } /* *----------------------------------------------------------------------------- * * File_GetFSMountInfo -- * * Platform-independent wrapper around File_GetVMFSMountInfo * * Results: * On failure return -1. Otherwise, return fsType, version, * remoteIP, remoteMountPoint, and localMountPoint. * * Side effects: * None * *----------------------------------------------------------------------------- */ int File_GetFSMountInfo(const char *pathName, char **fsType, uint32 *version, char **remoteIP, char **remoteMountPoint, char **localMountPoint) { #if defined VMX86_SERVER return File_GetVMFSMountInfo(pathName, fsType, version, remoteIP, remoteMountPoint, localMountPoint); #else return -1; #endif } open-vm-tools-10.0.7-3227872/lib/file/fileStandAlone.c0000644000000000000000000005015512660700525020402 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileStandAlone.c -- * * This file contains lib/file routines which are unentangled - they do * not depend on other libraries besides lib/misc and its dependencies. */ #if defined(_WIN32) #include #endif #include #include #include #include #include "safetime.h" #if !defined(_WIN32) #include #endif #include #include #include #include "vmware.h" #include "util.h" #include "str.h" #include "strutil.h" #include "posix.h" #include "file.h" #include "unicodeOperations.h" /* *---------------------------------------------------------------------- * * File_GetModTime -- * * Get the last modification time of a file and return it. The time * unit is seconds since the POSIX/UNIX/Linux epoch. * * Results: * Last modification time of file or -1 if error. * * Side effects: * None. * *---------------------------------------------------------------------- */ int64 File_GetModTime(const char *pathName) // IN: { int64 theTime; struct stat statbuf; if (Posix_Stat(pathName, &statbuf) == 0) { theTime = statbuf.st_mtime; } else { theTime = -1; } return theTime; } /* *---------------------------------------------------------------------- * * FileFirstSlashIndex -- * * Finds the first pathname slash index in a path (both slashes count * for Win32, only forward slash for Unix). * * Results: * As described. * * Side effects: * None. * *---------------------------------------------------------------------- */ UnicodeIndex FileFirstSlashIndex(const char *pathName, // IN: UnicodeIndex startIndex) // IN: { UnicodeIndex firstFS; #if defined(_WIN32) UnicodeIndex firstBS; #endif ASSERT(pathName); firstFS = Unicode_FindSubstrInRange(pathName, startIndex, -1, "/", 0, 1); #if defined(_WIN32) firstBS = Unicode_FindSubstrInRange(pathName, startIndex, -1, "\\", 0, 1); if ((firstFS != UNICODE_INDEX_NOT_FOUND) && (firstBS != UNICODE_INDEX_NOT_FOUND)) { return MIN(firstFS, firstBS); } else { return (firstFS == UNICODE_INDEX_NOT_FOUND) ? firstBS : firstFS; } #else return firstFS; #endif } /* *---------------------------------------------------------------------- * * FileLastSlashIndex -- * * Finds the last pathname slash index in a path (both slashes count * for Win32, only forward slash for Unix). * * Results: * As described. * * Side effects: * None. * *---------------------------------------------------------------------- */ static UnicodeIndex FileLastSlashIndex(const char *pathName, // IN: UnicodeIndex startIndex) // IN: { UnicodeIndex lastFS; #if defined(_WIN32) UnicodeIndex lastBS; #endif ASSERT(pathName); lastFS = Unicode_FindLastSubstrInRange(pathName, startIndex, -1, "/", 0, 1); #if defined(_WIN32) lastBS = Unicode_FindLastSubstrInRange(pathName, startIndex, -1, "\\", 0, 1); if ((lastFS != UNICODE_INDEX_NOT_FOUND) && (lastBS != UNICODE_INDEX_NOT_FOUND)) { return MAX(lastFS, lastBS); } else { return (lastFS == UNICODE_INDEX_NOT_FOUND) ? lastBS : lastFS; } #else return lastFS; #endif } /* *---------------------------------------------------------------------- * * File_SplitName -- * * Split a file name into three components: VOLUME, DIRECTORY, * BASE. The return values must be freed. * * VOLUME is empty for an empty string or a UNIX-style path, the * drive letter and colon for a Win32 drive-letter path, or the * construction "\\server\share" for a Win32 UNC path. * * BASE is the longest string at the end that begins after the * volume string and after the last directory separator. * * DIRECTORY is everything in-between VOLUME and BASE. * * The concatenation of VOLUME, DIRECTORY, and BASE produces the * original string, so any of those strings may be empty. * * A NULL pointer may be passed for one or more OUT parameters, in * which case that parameter is not returned. * * Able to handle both UNC and drive-letter paths on Windows. * * Results: * As described. * * Side effects: * None. * *---------------------------------------------------------------------- */ void File_SplitName(const char *pathName, // IN: char **volume, // OUT/OPT: char **directory, // OUT/OPT: char **base) // OUT/OPT: { char *vol; char *dir; char *bas; UnicodeIndex volEnd; UnicodeIndex length; UnicodeIndex baseBegin; WIN32_ONLY(UnicodeIndex pathLen); ASSERT(pathName); /* * Get volume. */ volEnd = 0; #if defined(_WIN32) pathLen = Unicode_LengthInCodePoints(pathName); if ((pathLen > 2) && (StrUtil_StartsWith(pathName, "\\\\") || StrUtil_StartsWith(pathName, "//"))) { /* UNC path */ volEnd = FileFirstSlashIndex(pathName, 2); if (volEnd == UNICODE_INDEX_NOT_FOUND) { /* we have \\foo, which is just bogus */ volEnd = 0; } else { volEnd = FileFirstSlashIndex(pathName, volEnd + 1); if (volEnd == UNICODE_INDEX_NOT_FOUND) { /* we have \\foo\bar, which is legal */ volEnd = pathLen; } } } else if ((pathLen >= 2) && (Unicode_FindSubstrInRange(pathName, 1, 1, ":", 0, 1) != UNICODE_INDEX_NOT_FOUND)) { /* drive-letter path */ volEnd = 2; } if (volEnd > 0) { vol = Unicode_Substr(pathName, 0, volEnd); } else { vol = Unicode_Duplicate(""); } #else vol = Unicode_Duplicate(""); #endif /* _WIN32 */ /* * Get base. */ baseBegin = FileLastSlashIndex(pathName, 0); baseBegin = (baseBegin == UNICODE_INDEX_NOT_FOUND) ? 0 : baseBegin + 1; if (baseBegin >= volEnd) { bas = Unicode_Substr(pathName, baseBegin, -1); } else { bas = Unicode_Duplicate(""); } /* * Get dir. */ length = baseBegin - volEnd; if (length > 0) { dir = Unicode_Substr(pathName, volEnd, length); } else { dir = Unicode_Duplicate(""); } /* * Return what needs to be returned. */ if (volume) { *volume = vol; } else { free(vol); } if (directory) { *directory = dir; } else { free(dir); } if (base) { *base = bas; } else { free(bas); } } /* *--------------------------------------------------------------------------- * * File_PathJoin -- * * Join the dirName and baseName together to create a (full) path. * * This code concatenates two strings together and omits a redundant * directory separator between the two. * * On Windows, the 'baseName' argument may not be a fully qualified path. * That is, it may not be an absolute path containing a drive letter nor * may it be a UNC path. * * Examples: * File_PathJoin("", "b") -> "/b" * File_PathJoin("/", "b") -> "/b" * File_PathJoin("a", "b") -> "a/b" * File_PathJoin("a/", "b") -> "a/b" * File_PathJoin("a/////", "b") -> "a/b" * File_PathJoin("a", "") -> "a/" * File_PathJoin("a", "/") -> "a/" * File_PathJoin("a", "/b") -> "a/b" * File_PathJoin("a", "/////b") -> "a/b" (only posix) * File_PathJoin("a/", "/b") -> "a/b" * File_PathJoin("a/////", "/////b") -> "a/b" (only posix) * * Results: * The constructed path which must be freed by the caller. * * Side effects: * None * *--------------------------------------------------------------------------- */ char * File_PathJoin(const char *dirName, // IN: const char *baseName) // IN: See above. { char *result; char *newDir = NULL; ASSERT(dirName); ASSERT(baseName); /* * Remove ALL directory separators from baseName begin. */ #if defined(_WIN32) { const char *oldBaseName = baseName; /* * Reject drive letters in baseName. */ ASSERT(Unicode_LengthInCodePoints(baseName) < 2 || Unicode_FindSubstrInRange(baseName, 1, 1, ":", 0, 1) == UNICODE_INDEX_NOT_FOUND); while (*baseName == '/' || *baseName == '\\') { baseName++; } /* * Reject UNC paths for baseName. */ ASSERT(baseName - oldBaseName < 2); } #else while (*baseName == '/') { baseName++; } #endif /* * Remove ALL directory separators from dirName end. */ newDir = File_StripSlashes(dirName); result = Unicode_Join(newDir, DIRSEPS, baseName, NULL); free(newDir); return result; } /* *--------------------------------------------------------------------------- * * File_GetPathName -- * * Behaves like File_SplitName by splitting the fullpath into * pathname & filename components. * * The trailing directory separator [\|/] is stripped off the * pathname component. This in turn means that on Linux the root * directory will be returned as the empty string "". On Windows * it will be returned as X: where X is the drive letter. It is * important that callers of this functions are aware that the "" * on Linux means root "/". * * A NULL pointer may be passed for one or more OUT parameters, * in which case that parameter is not returned. * * Results: * As described. * * Side effects: * The return values must be freed. * *--------------------------------------------------------------------------- */ void File_GetPathName(const char *fullPath, // IN: char **pathName, // OUT/OPT: char **baseName) // OUT/OPT: { char *volume; UnicodeIndex len; UnicodeIndex curLen; File_SplitName(fullPath, &volume, pathName, baseName); if (pathName == NULL) { free(volume); return; } /* * The volume component may be empty. */ if (!Unicode_IsEmpty(volume)) { char *temp = Unicode_Append(volume, *pathName); free(*pathName); *pathName = temp; } free(volume); /* * Remove any trailing directory separator characters. */ len = Unicode_LengthInCodePoints(*pathName); curLen = len; while ((curLen > 0) && (FileFirstSlashIndex(*pathName, curLen - 1) == curLen - 1)) { curLen--; } if (curLen < len) { char *temp = Unicode_Substr(*pathName, 0, curLen); free(*pathName); *pathName = temp; } } /* *---------------------------------------------------------------------- * * File_StripSlashes -- * * Strip trailing slashes from the end of a path. * * Results: * The stripped filename. * * Side effects: * None. * *---------------------------------------------------------------------- */ char * File_StripSlashes(const char *path) // IN: { char *result; char *volume; char *dir; char *base; /* * SplitName handles all drive letter/UNC/whatever cases, all we * have to do is make sure the dir part is stripped of slashes if * there isn't a base part. */ File_SplitName(path, &volume, &dir, &base); if (!Unicode_IsEmpty(dir) && Unicode_IsEmpty(base)) { char *dir2 = Unicode_GetAllocBytes(dir, STRING_ENCODING_UTF8); size_t i = strlen(dir2); /* * Don't strip first slash on Windows, since we want at least * one slash to trail a drive letter/colon or UNC specifier. */ #if defined(_WIN32) while ((i > 1) && (('/' == dir2[i - 1]) || ('\\' == dir2[i - 1]))) { #else while ((i > 0) && ('/' == dir2[i - 1])) { #endif i--; } free(dir); dir = Unicode_AllocWithLength(dir2, i, STRING_ENCODING_UTF8); free(dir2); } result = Unicode_Join(volume, dir, base, NULL); free(volume); free(dir); free(base); return result; } /* *----------------------------------------------------------------------------- * * File_MapPathPrefix -- * * Given a path and a newPrefix -> oldPrefix mapping, transform * oldPath according to the mapping. * * Results: * The new path, or NULL if there is no mapping. * * Side effects: * The returned string is allocated, free it. * *----------------------------------------------------------------------------- */ char * File_MapPathPrefix(const char *oldPath, // IN: const char **oldPrefixes, // IN: const char **newPrefixes, // IN: size_t numPrefixes) // IN: { int i; size_t oldPathLen = strlen(oldPath); for (i = 0; i < numPrefixes; i++) { char *newPath; char *oldPrefix; char *newPrefix; size_t oldPrefixLen; oldPrefix = File_StripSlashes(oldPrefixes[i]); newPrefix = File_StripSlashes(newPrefixes[i]); oldPrefixLen = strlen(oldPrefix); /* * If the prefix matches on a DIRSEPS boundary, or the prefix is the * whole string, replace it. * * If we don't insist on matching a whole directory name, we could * mess things of if one directory is a substring of another. * * Perform a case-insensitive compare on Windows. (There are * case-insensitive filesystems on MacOS also, but the problem * is more acute with Windows because of frequent drive-letter * case mismatches. So in lieu of actually asking the * filesystem, let's just go with a simple ifdef for now.) */ if ((oldPathLen >= oldPrefixLen) && #ifdef _WIN32 (Str_Strncasecmp(oldPath, oldPrefix, oldPrefixLen) == 0) && #else (Str_Strncmp(oldPath, oldPrefix, oldPrefixLen) == 0) && #endif (strchr(VALID_DIRSEPS, oldPath[oldPrefixLen]) || (oldPath[oldPrefixLen] == '\0'))) { size_t newPrefixLen = strlen(newPrefix); size_t newPathLen = (oldPathLen - oldPrefixLen) + newPrefixLen; ASSERT(newPathLen > 0); ASSERT(oldPathLen >= oldPrefixLen); newPath = Util_SafeMalloc((newPathLen + 1) * sizeof(char)); memcpy(newPath, newPrefix, newPrefixLen); memcpy(newPath + newPrefixLen, oldPath + oldPrefixLen, oldPathLen - oldPrefixLen + 1); /* * It should only match once. Weird self-referencing mappings * aren't allowed. */ free(oldPrefix); free(newPrefix); return newPath; } free(oldPrefix); free(newPrefix); } return NULL; } /* *----------------------------------------------------------------------------- * * File_PrependToPath -- * * This function checks if the elem is already present in the * searchPath, if it is then it is moved forward in the search path. * Otherwise it is prepended to the searchPath. * * Results: * Return file search path with elem in front. * * Side effects: * Caller must free returned string. * *----------------------------------------------------------------------------- */ char * File_PrependToPath(const char *searchPath, // IN: const char *elem) // IN: { const char sep = FILE_SEARCHPATHTOKEN[0]; char *newPath; char *path; size_t n; ASSERT(searchPath); ASSERT(elem); newPath = Str_SafeAsprintf(NULL, "%s%s%s", elem, FILE_SEARCHPATHTOKEN, searchPath); n = strlen(elem); path = newPath + n + 1; for (;;) { char *next = Str_Strchr(path, sep); size_t len = next ? next - path : strlen(path); if ((len == n) && (Str_Strncmp(path, elem, len) == 0)) { if (next) { memmove(path, next + 1, strlen(next + 1) + 1); } else { *--path = '\0'; } break; } if (!next) { break; } path = next + 1; } return newPath; } /* *----------------------------------------------------------------------------- * * File_ReplaceExtension -- * * Replaces the extension in input with newExtension. * * If the old extension exists in the list of extensions specified in ..., * truncate it before appending the new extension. * * If the extension is not found in the list, the newExtension is * just appended. * * If there isn't a list of extensions specified (numExtensions == 0), * truncate the old extension unconditionally. * * NB: newExtension and the extension list must have .'s. * * Results: * The name with newExtension added to it. The caller is responsible to * free it when they are done with it. * * Side effects: * None. * *----------------------------------------------------------------------------- */ char * File_ReplaceExtension(const char *pathName, // IN: const char *newExtension, // IN: uint32 numExtensions, // IN: ...) // IN: { char *path; char *base; char *result; va_list arguments; UnicodeIndex index; ASSERT(pathName); ASSERT(newExtension); ASSERT(*newExtension == '.'); File_GetPathName(pathName, &path, &base); index = Unicode_FindLast(base, "."); if (index != UNICODE_INDEX_NOT_FOUND) { char *oldBase = base; if (numExtensions) { uint32 i; /* * Only truncate the old extension from the base if it exists in * in the valid extensions list. */ va_start(arguments, numExtensions); for (i = 0; i < numExtensions ; i++) { char *oldExtension = va_arg(arguments, char *); ASSERT(*oldExtension == '.'); if (Unicode_CompareRange(base, index, -1, oldExtension, 0, -1, FALSE) == 0) { base = Unicode_Truncate(oldBase, index); // remove '.' break; } } va_end(arguments); } else { /* Always truncate the old extension if extension list is empty . */ base = Unicode_Truncate(oldBase, index); // remove '.' } if (oldBase != base) { free(oldBase); } } if (Unicode_IsEmpty(path)) { result = Unicode_Append(base, newExtension); } else { result = Unicode_Join(path, DIRSEPS, base, newExtension, NULL); } free(path); free(base); return result; } /* *----------------------------------------------------------------------------- * * File_RemoveExtension -- * * Return a copy of the given path name with the extension * removed. We ASSERT that the given path does have an extension. * * Results: * A newly allocated buffer with the modified string. The caller * is responsible to free it when they are done with it. * * Side effects: * None. * *----------------------------------------------------------------------------- */ char * File_RemoveExtension(const char *pathName) // IN: { UnicodeIndex index; ASSERT(pathName); index = Unicode_FindLast(pathName, "."); ASSERT(index != UNICODE_INDEX_NOT_FOUND); return Unicode_Truncate(pathName, index); } open-vm-tools-10.0.7-3227872/lib/file/fileInt.h0000644000000000000000000002335212660700525017110 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileInt.h -- * * Things internal to the file library. */ #if !defined(__FILE_INTERNAL_H__) #define __FILE_INTERNAL_H__ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "err.h" #include "posix.h" #include "file.h" #include "fileIO.h" #include "fileLock.h" #include "unicodeTypes.h" #include "memaligned.h" /* * Max supported file size is 64 TB. */ #define MAX_SUPPORTED_FILE_SIZE CONST64U(0x400000000000) #if defined __linux__ /* * These magic constants are used only for parsing Linux statfs data. * So they make sense only for Linux build. If you need them on other OSes, * think once more. */ #define ADFS_SUPER_MAGIC 0xadf5 #define AFFS_SUPER_MAGIC 0xADFF #define EXT_SUPER_MAGIC 0x137D #define EXT2_OLD_SUPER_MAGIC 0xEF51 #define EXT2_SUPER_MAGIC 0xEF53 #define EXT3_SUPER_MAGIC 0xEF53 #define EXT4_SUPER_MAGIC 0xEF53 #define HFSPLUS_SUPER_MAGIC 0x482B #define NFS_SUPER_MAGIC 0x6969 #define SMB_SUPER_MAGIC 0x517B #define ISOFS_SUPER_MAGIC 0x9660 #define JFFS2_SUPER_MAGIC 0x72b6 #define PROC_SUPER_MAGIC 0x9fa0 #define OPENPROM_SUPER_MAGIC 0x9fa1 #define USBDEVICE_SUPER_MAGIC 0x9fa2 #define AUTOFS_SUPER_MAGIC 0x0187 #if !defined(MSDOS_SUPER_MAGIC) #define MSDOS_SUPER_MAGIC 0x4D44 #endif #define XENIX_SUPER_MAGIC 0x012FF7B4 #define SYSV4_SUPER_MAGIC 0x012FF7B5 #define SYSV2_SUPER_MAGIC 0x012FF7B6 #define COH_SUPER_MAGIC 0x012FF7B7 #define UFS_SUPER_MAGIC 0x00011954 #define XFS_SUPER_MAGIC 0x58465342 #define VMFS_SUPER_MAGIC 0x2fABF15E #define TMPFS_SUPER_MAGIC 0x01021994 #define JFS_SUPER_MAGIC 0x3153464a #define AFS_SUPER_MAGIC 0x5346414F #define CIFS_SUPER_MAGIC 0xFF534D42 #if !defined(REISERFS_SUPER_MAGIC) #define REISERFS_SUPER_MAGIC 0x52654973 #endif #endif // linux #define LGPFX "FILE:" #define FILE_TYPE_REGULAR 0 #define FILE_TYPE_DIRECTORY 1 #define FILE_TYPE_BLOCKDEVICE 2 #define FILE_TYPE_CHARDEVICE 3 #define FILE_TYPE_SYMLINK 4 #define FILE_TYPE_FIFO 5 #define FILE_TYPE_SOCKET 6 #define FILE_TYPE_UNCERTAIN 7 typedef struct FileData { uint64 fileAccessTime; uint64 fileCreationTime; uint64 fileModificationTime; uint64 fileSize; int fileType; int fileMode; int fileOwner; int fileGroup; } FileData; #define FILE_MAX_WAIT_TIME_MS 2000 // maximum wait time in milliseconds void FileIOResolveLockBits(int *access); #if defined(_WIN32) int FileMapErrorToErrno(const char *functionName, Err_Number status); Bool FileRetryThisError(DWORD error, uint32 numCodes, DWORD *codes); int FileAttributesRetry(const char *pathName, uint32 msecMaxWaitTime, FileData *fileData); int FileDeletionRetry(const char *pathName, Bool handleLink, uint32 msecMaxWaitTime); int FileCreateDirectoryRetry(const char *pathName, int mask, uint32 msecMaxWaitTime); int FileRemoveDirectoryRetry(const char *pathName, uint32 msecMaxWaitTime); int FileListDirectoryRetry(const char *pathName, uint32 msecMaxWaitTime, char ***ids); #define FileAttributes(a, b) FileAttributesRetry((a), 0, (b)) #define FileDeletion(a, b) FileDeletionRetry((a), (b), 0) #define FileCreateDirectory(a, b) FileCreateDirectoryRetry((a), (b), 0) #define FileRemoveDirectory(a) FileRemoveDirectoryRetry((a), 0) #define FileListDirectoryRobust(a, b) \ FileListDirectoryRetry((a), FILE_MAX_WAIT_TIME_MS, (b)) #define FileAttributesRobust(a, b) \ FileAttributesRetry((a), FILE_MAX_WAIT_TIME_MS, (b)) #define FileRenameRobust(a, b) \ File_RenameRetry((a), (b), FILE_MAX_WAIT_TIME_MS) #define FileDeletionRobust(a, b) \ FileDeletionRetry((a), (b), FILE_MAX_WAIT_TIME_MS) #define FileCreateDirectoryRobust(a, b) \ FileCreateDirectoryRetry((a), (b), FILE_MAX_WAIT_TIME_MS) #define FileRemoveDirectoryRobust(a) \ FileRemoveDirectoryRetry((a), FILE_MAX_WAIT_TIME_MS) #else static INLINE int FileMapErrorToErrno(const char *functionName, Err_Number status) { return status; } char *FilePosixGetBlockDevice(char const *path); int FileAttributes(const char *pathName, FileData *fileData); int FileDeletion(const char *pathName, Bool handleLink); int FileCreateDirectory(const char *pathName, int mask); int FileRemoveDirectory(const char *pathName); #define FileListDirectoryRobust(a, b) File_ListDirectory((a), (b)) #define FileAttributesRobust(a, b) FileAttributes((a), (b)) #define FileRenameRobust(a, b) File_Rename((a), (b)) #define FileDeletionRobust(a, b) FileDeletion((a), (b)) #define FileCreateDirectoryRobust(a, b) FileCreateDirectory((a), (b)) #define FileRemoveDirectoryRobust(a) FileRemoveDirectory((a)) #endif typedef struct active_lock { struct active_lock *next; uint32 age; Bool marked; char *dirName; } ActiveLock; typedef struct lock_values { char *machineID; char *executionID; char *lockType; char *locationChecksum; char *memberName; unsigned int lamportNumber; Bool exclusivity; uint32 waitTime; uint32 msecMaxWaitTime; ActiveLock *lockList; } LockValues; #include "file_extensions.h" #define FILELOCK_SUFFIX "." LOCK_FILE_EXTENSION #define FILELOCK_DATA_SIZE 512 uint32 FileSleeper(uint32 msecMinSleepTime, uint32 msecMaxSleepTime); uint32 FileSimpleRandom(void); const char *FileLockGetMachineID(void); char *FileLockGetExecutionID(void); Bool FileLockMachineIDMatch(const char *host, const char *second); int FileLockMemberValues(const char *lockDir, const char *fileName, char *buffer, size_t size, LockValues *memberValues); FileLockToken *FileLockIntrinsic(const char *filePathName, Bool exclusivity, uint32 msecMaxWaitTime, int *err); int FileUnlockIntrinsic(FileLockToken *tokenPtr); Bool FileLockIsLocked(const char *filePath, int *err); Bool FileLockValidExecutionID(const char *executionID); Bool FileLockValidName(const char *fileName); void FileLockAppendMessage(MsgList **msgs, int err); Bool FileIsWritableDir(const char *dirName); UnicodeIndex FileFirstSlashIndex(const char *pathName, UnicodeIndex startIndex); FileIOResult FileIOCreateRetry(FileIODescriptor *fd, const char *pathName, int access, FileIOOpenAction action, int mode, uint32 msecMaxWaitTime); /* * FileIOAligned_* are useful on hosted platforms where malloc/memalign/valloc * for "large buffers" (in the range 64 KiB - 1 MiB) will generally fall * through to mmap/munmap, which is expensive due to page table modifications * and the attendant TLB flushing (which requires IPIs and possibly world * switches) on other threads running in the same address space. In particular, * on Mac OS 10.6.6 on a Westmere-class Mac Pro, mmap + memcpy + munmap adds * around a millisecond of CPU time and a hundred IPIs to a 512 KiB write. See * PR#685845. * * This isn't applicable to ESX because * 1. we don't use this path for disk IO * 2. we don't want to do extra large allocations * 3. we don't have the same alignment constraints * so simply define it away to nothing. * * Tools is another case, we can use this path for IO but we don't want to add * MXUserExclLock dependencies. */ #if defined(VMX86_TOOLS) || defined(VMX86_SERVER) #define FileIOAligned_PoolInit() /* nothing */ #define FileIOAligned_PoolExit() /* nothing */ #define FileIOAligned_PoolMalloc(sz) NULL #define FileIOAligned_PoolFree(ptr) FALSE #else void FileIOAligned_PoolInit(void); void FileIOAligned_PoolExit(void); void *FileIOAligned_PoolMalloc(size_t); Bool FileIOAligned_PoolFree(void *); #endif static INLINE void * FileIOAligned_Malloc(size_t sz) // IN: { void *buf = FileIOAligned_PoolMalloc(sz); if (!buf) { buf = Aligned_Malloc(sz); } return buf; } static INLINE void FileIOAligned_Free(void *ptr) // IN: { if (!FileIOAligned_PoolFree(ptr)) { Aligned_Free(ptr); } } #if defined(__APPLE__) int PosixFileOpener(const char *pathName, int flags, mode_t mode); #else #define PosixFileOpener(a, b, c) Posix_Open(a, b, c); #endif #endif open-vm-tools-10.0.7-3227872/lib/file/filePosix.c0000644000000000000000000023541112660700525017454 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * filePosix.c -- * * Interface to Posix-specific file functions. */ #include /* Needed before sys/vfs.h with glibc 2.0 --hpreg */ #if defined(__FreeBSD__) # include # include #else # if !defined(__APPLE__) # include # endif # include # include /* Needed before sys/mnttab.h in Solaris */ # if defined(sun) # include # elif __APPLE__ # include # else # include # endif #include #endif #include #include #include #include #include #include #include #if defined(__linux__) # include #endif #include "vmware.h" #include "posix.h" #include "file.h" #include "fileInt.h" #include "msg.h" #include "util.h" #include "str.h" #include "util.h" #include "timeutil.h" #include "dynbuf.h" #include "localconfig.h" #include "hostType.h" #include "vmfs.h" #include "hashTable.h" #define LOGLEVEL_MODULE main #include "loglevel_user.h" #include "unicodeOperations.h" #if !defined(__FreeBSD__) && !defined(sun) #if !defined(__APPLE__) static char *FilePosixLookupMountPoint(char const *canPath, Bool *bind); #endif static char *FilePosixNearestExistingAncestor(char const *path); #if defined(VMX86_SERVER) #define VMFS3CONST 256 #include "hostType.h" /* Needed for VMFS implementation of File_GetFreeSpace() */ # include # endif #endif #if defined(VMX86_SERVER) #include "fs_user.h" #endif struct WalkDirContextImpl { int cnt; int iter; char **files; }; /* A string for NFS on ESX file system type */ #define FS_NFS_PREFIX_LEN 3 #define FS_NFS_ON_ESX "NFS" /* A string for VMFS on ESX file system type */ #define FS_VMFS_ON_ESX "VMFS" #define FS_VSAN_URI_PREFIX "vsan:" #if defined __ANDROID__ /* * Android doesn't support setmntent(), endmntent() or MOUNTED. */ #define NO_SETMNTENT #define NO_ENDMNTENT #endif /* Long path chunk growth size */ #define FILE_PATH_GROW_SIZE 1024 /* *----------------------------------------------------------------------------- * * FileRemoveDirectory -- * * Delete a directory. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * May change the host file system. * *----------------------------------------------------------------------------- */ int FileRemoveDirectory(const char *pathName) // IN: { return (Posix_Rmdir(pathName) == -1) ? errno : 0; } /* *----------------------------------------------------------------------------- * * File_Rename -- * * Rename a file. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * May change the host file system. * *----------------------------------------------------------------------------- */ int File_Rename(const char *oldName, // IN: const char *newName) // IN: { return (Posix_Rename(oldName, newName) == -1) ? errno : 0; } int File_RenameRetry(const char *oldFile, // IN: const char *newFile, // IN: uint32 msecMaxWaitTime) // IN: Unused. { return File_Rename(oldFile, newFile); } /* *---------------------------------------------------------------------- * * FileDeletion -- * Delete the specified file. A NULL pathName will result in an error * and errno will be set to EFAULT. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * May change the host file system. errno may be set. * *---------------------------------------------------------------------- */ int FileDeletion(const char *pathName, // IN: const Bool handleLink) // IN: { int err; if (pathName == NULL) { errno = EFAULT; return errno; } if (handleLink) { char *linkPath = Posix_ReadLink(pathName); if (linkPath == NULL) { /* If there is no link involved, continue */ err = errno; if (err != EINVAL) { goto bail; } } else { err = (Posix_Unlink(linkPath) == -1) ? errno : 0; free(linkPath); /* Ignore a file that has already disappeared */ if (err != ENOENT) { goto bail; } } } err = (Posix_Unlink(pathName) == -1) ? errno : 0; bail: return err; } /* *----------------------------------------------------------------------------- * * File_UnlinkDelayed -- * * Same as File_Unlink for POSIX systems since we can unlink anytime. * * Results: * Return 0 if the unlink is successful. Otherwise, returns -1. * * Side effects: * None. * *----------------------------------------------------------------------------- */ int File_UnlinkDelayed(const char *pathName) // IN: { return (FileDeletion(pathName, TRUE) == 0) ? 0 : -1; } /* *----------------------------------------------------------------------------- * * FileAttributes -- * * Return the attributes of a file. Time units are in OS native time. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * None * *----------------------------------------------------------------------------- */ int FileAttributes(const char *pathName, // IN: FileData *fileData) // OUT: { int err; struct stat statbuf; if (Posix_Stat(pathName, &statbuf) == -1) { err = errno; } else { if (fileData != NULL) { fileData->fileCreationTime = statbuf.st_ctime; fileData->fileModificationTime = statbuf.st_mtime; fileData->fileAccessTime = statbuf.st_atime; fileData->fileSize = statbuf.st_size; switch (statbuf.st_mode & S_IFMT) { case S_IFREG: fileData->fileType = FILE_TYPE_REGULAR; break; case S_IFDIR: fileData->fileType = FILE_TYPE_DIRECTORY; break; case S_IFBLK: fileData->fileType = FILE_TYPE_BLOCKDEVICE; break; case S_IFCHR: fileData->fileType = FILE_TYPE_CHARDEVICE; break; case S_IFLNK: fileData->fileType = FILE_TYPE_SYMLINK; break; default: fileData->fileType = FILE_TYPE_UNCERTAIN; break; } fileData->fileMode = statbuf.st_mode; fileData->fileOwner = statbuf.st_uid; fileData->fileGroup = statbuf.st_gid; } err = 0; } return err; } /* *---------------------------------------------------------------------- * * File_IsRemote -- * * Determine whether a file is on a remote filesystem. * * On ESX all files are treated as local files, as all * callers of this function wants to do is to post message * that performance will be degraded on remote filesystems. * On ESX (a) performance should be acceptable with remote * files, and (b) even if it is not, we should not ask users * whether they are aware that it is poor. ESX has * performance monitoring which can notify user if something * is wrong. * * On hosted platform we report remote files as faithfully * as we can because having mainmem file on NFS is known * to badly affect VM consistency when NFS filesystem gets * reconnected. Due to that we are conservative, and report * filesystem as remote if there was some problem with * determining file remoteness. * * Results: * The answer. * * Side effects: * None * *---------------------------------------------------------------------- */ #if !defined(__FreeBSD__) && !defined(sun) Bool File_IsRemote(const char *pathName) // IN: Path name { if (HostType_OSIsVMK()) { /* * All files and file systems are treated as "directly attached" * on ESX. See bug 158284. */ return FALSE; } else { struct statfs sfbuf; if (Posix_Statfs(pathName, &sfbuf) == -1) { Log(LGPFX" %s: statfs(%s) failed: %s\n", __func__, pathName, Err_Errno2String(errno)); return TRUE; } #if defined(__APPLE__) return sfbuf.f_flags & MNT_LOCAL ? FALSE : TRUE; #else if (NFS_SUPER_MAGIC == sfbuf.f_type) { return TRUE; } if (SMB_SUPER_MAGIC == sfbuf.f_type) { return TRUE; } if (CIFS_SUPER_MAGIC == sfbuf.f_type) { return TRUE; } return FALSE; #endif } } #endif /* !FreeBSD && !sun */ /* *---------------------------------------------------------------------- * * File_IsSymLink -- * * Check if the specified file is a symbolic link or not * * Results: * Bool - TRUE -> is a symlink, FALSE -> not a symlink or error * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_IsSymLink(const char *pathName) // IN: { struct stat statbuf; return (Posix_Lstat(pathName, &statbuf) == 0) && S_ISLNK(statbuf.st_mode); } /* *---------------------------------------------------------------------- * * File_Cwd -- * * Find the current directory on drive DRIVE. DRIVE is either NULL * (current drive) or a string starting with [A-Za-z]. * * Results: * NULL if error. * * Side effects: * The result is allocated * *---------------------------------------------------------------------- */ char * File_Cwd(const char *drive) // IN: { size_t size; char *buffer; char *path; if ((drive != NULL) && !Unicode_IsEmpty(drive)) { Warning(LGPFX" %s: Drive letter %s on Linux?\n", __FUNCTION__, drive); } size = FILE_PATH_GROW_SIZE; buffer = Util_SafeMalloc(size); while (TRUE) { if (getcwd(buffer, size) != NULL) { break; } free(buffer); buffer = NULL; if (errno != ERANGE) { break; } size += FILE_PATH_GROW_SIZE; buffer = Util_SafeMalloc(size); } if (buffer == NULL) { Msg_Append(MSGID(filePosix.getcwd) "Unable to retrieve the current working directory: %s. " "Check if the directory has been deleted or unmounted.\n", Msg_ErrString()); Warning(LGPFX" %s: getcwd() failed: %s\n", __FUNCTION__, Msg_ErrString()); return NULL; } path = Unicode_Alloc(buffer, STRING_ENCODING_DEFAULT); free(buffer); return path; } /* *---------------------------------------------------------------------- * * FileStripFwdSlashes -- * * Returns a new string with the extraneous forward slashes ("/") removed. * * Results: * As documented. * * Side effects: * None * *---------------------------------------------------------------------- */ static char * FileStripFwdSlashes(const char *pathName) // IN: { char *ptr; char *path; char *cptr; char *prev; char *result; ASSERT(pathName); path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_UTF8); ASSERT(path != NULL); ptr = path; cptr = path; prev = NULL; /* * Copy over if not DIRSEPC. If yes, copy over only if previous * character was not DIRSEPC. */ while (*ptr != '\0') { if (*ptr == DIRSEPC) { if (prev != ptr - 1) { *cptr++ = *ptr; } prev = ptr; } else { *cptr++ = *ptr; } ptr++; } *cptr = '\0'; result = Unicode_AllocWithUTF8(path); free(path); return result; } /* *---------------------------------------------------------------------- * * File_FullPath -- * * Compute the full path of a file. If the file if NULL or "", the * current directory is returned * * Results: * NULL if error (reported to the user) * * Side effects: * The result is allocated * *---------------------------------------------------------------------- */ char * File_FullPath(const char *pathName) // IN: { char *cwd; char *ret; if ((pathName != NULL) && File_IsFullPath(pathName)) { cwd = NULL; } else { cwd = File_Cwd(NULL); if (cwd == NULL) { return NULL; } } if ((pathName == NULL) || Unicode_IsEmpty(pathName)) { ret = Unicode_Duplicate(cwd); } else if (File_IsFullPath(pathName)) { ret = Posix_RealPath(pathName); if (ret == NULL) { ret = FileStripFwdSlashes(pathName); } } else { char *path = Unicode_Join(cwd, DIRSEPS, pathName, NULL); ret = Posix_RealPath(path); if (ret == NULL) { ret = FileStripFwdSlashes(path); } free(path); } free(cwd); return ret; } /* *---------------------------------------------------------------------- * * File_IsFullPath -- * * Is this a full path? * * Results: * TRUE if full path. * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool File_IsFullPath(const char *pathName) // IN: { /* start with a slash? */ return (pathName == NULL) ? FALSE : Unicode_StartsWith(pathName, DIRSEPS); } /* *---------------------------------------------------------------------- * * File_GetTimes -- * * Get the date and time that a file was created, last accessed, * last modified and last attribute changed. * * Results: * TRUE if succeed or FALSE if error. * * Side effects: * If a particular time is not available, -1 will be returned for * that time. * *---------------------------------------------------------------------- */ Bool File_GetTimes(const char *pathName, // IN: VmTimeType *createTime, // OUT: Windows NT time format VmTimeType *accessTime, // OUT: Windows NT time format VmTimeType *writeTime, // OUT: Windows NT time format VmTimeType *attrChangeTime) // OUT: Windows NT time format { struct stat statBuf; ASSERT(createTime && accessTime && writeTime && attrChangeTime); *createTime = -1; *accessTime = -1; *writeTime = -1; *attrChangeTime = -1; if (Posix_Lstat(pathName, &statBuf) == -1) { Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__, pathName, Err_Errno2String(errno)); return FALSE; } /* * XXX We should probably use the MIN of all Unix times for the creation * time, so that at least times are never inconsistent in the * cross-platform format. Maybe atime is always that MIN. We should * check and change the code if it is not. * * XXX atime is almost always MAX. */ #if defined(__FreeBSD__) /* * FreeBSD: All supported versions have timestamps with nanosecond * resolution. FreeBSD 5+ has also file creation time. */ # if defined(__FreeBSD_version) && __FreeBSD_version >= 500043 *createTime = TimeUtil_UnixTimeToNtTime(statBuf.st_birthtimespec); # endif *accessTime = TimeUtil_UnixTimeToNtTime(statBuf.st_atimespec); *writeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_mtimespec); *attrChangeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_ctimespec); #elif defined(linux) /* * Linux: Glibc 2.3+ has st_Xtim. Glibc 2.1/2.2 has st_Xtime/__unusedX on * same place (see below). We do not support Glibc 2.0 or older. */ # if (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 3) && !defined(__UCLIBC__) { /* * stat structure is same between glibc 2.3 and older glibcs, just * these __unused fields are always zero. If we'll use __unused* * instead of zeroes, we get automatically nanosecond timestamps * when running on host which provides them. */ struct timespec timeBuf; timeBuf.tv_sec = statBuf.st_atime; timeBuf.tv_nsec = statBuf.__unused1; *accessTime = TimeUtil_UnixTimeToNtTime(timeBuf); timeBuf.tv_sec = statBuf.st_mtime; timeBuf.tv_nsec = statBuf.__unused2; *writeTime = TimeUtil_UnixTimeToNtTime(timeBuf); timeBuf.tv_sec = statBuf.st_ctime; timeBuf.tv_nsec = statBuf.__unused3; *attrChangeTime = TimeUtil_UnixTimeToNtTime(timeBuf); } # elif defined(__ANDROID__) { struct timespec timeBuf; timeBuf.tv_sec = statBuf.st_atime; timeBuf.tv_nsec = statBuf.st_atime_nsec; *accessTime = TimeUtil_UnixTimeToNtTime(timeBuf); timeBuf.tv_sec = statBuf.st_mtime; timeBuf.tv_nsec = statBuf.st_mtime_nsec; *writeTime = TimeUtil_UnixTimeToNtTime(timeBuf); timeBuf.tv_sec = statBuf.st_ctime; timeBuf.tv_nsec = statBuf.st_ctime_nsec; *attrChangeTime = TimeUtil_UnixTimeToNtTime(timeBuf); } # else *accessTime = TimeUtil_UnixTimeToNtTime(statBuf.st_atim); *writeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_mtim); *attrChangeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_ctim); # endif #elif defined(__APPLE__) /* Mac: No file create timestamp. */ *accessTime = TimeUtil_UnixTimeToNtTime(statBuf.st_atimespec); *writeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_mtimespec); *attrChangeTime = TimeUtil_UnixTimeToNtTime(statBuf.st_ctimespec); #else { /* Solaris: No nanosecond timestamps, no file create timestamp. */ struct timespec timeBuf; timeBuf.tv_nsec = 0; timeBuf.tv_sec = statBuf.st_atime; *accessTime = TimeUtil_UnixTimeToNtTime(timeBuf); timeBuf.tv_sec = statBuf.st_mtime; *writeTime = TimeUtil_UnixTimeToNtTime(timeBuf); timeBuf.tv_sec = statBuf.st_ctime; *attrChangeTime = TimeUtil_UnixTimeToNtTime(timeBuf); } #endif return TRUE; } /* *---------------------------------------------------------------------- * * File_SetTimes -- * * Set the date and time that a file was created, last accessed, or * last modified. * * Results: * TRUE if succeed or FALSE if error. * * Side effects: * If fileName is a symlink, target's timestamps will be updated. * Symlink itself's timestamps will not be changed. * *---------------------------------------------------------------------- */ Bool File_SetTimes(const char *pathName, // IN: VmTimeType createTime, // IN: ignored VmTimeType accessTime, // IN: Windows NT time format VmTimeType writeTime, // IN: Windows NT time format VmTimeType attrChangeTime) // IN: ignored { struct timeval times[2]; struct timeval *aTime, *wTime; struct stat statBuf; char *path; int err; if (pathName == NULL) { return FALSE; } path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); if (path == NULL) { Log(LGPFX" %s: failed to convert \"%s\" to current encoding\n", __FUNCTION__, pathName); return FALSE; } err = (lstat(path, &statBuf) == -1) ? errno : 0; if (err != 0) { Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__, pathName, Err_Errno2String(err)); free(path); return FALSE; } aTime = ×[0]; wTime = ×[1]; /* * Preserve old times if new time <= 0. * XXX Need a better implementation to preserve tv_usec. */ aTime->tv_sec = statBuf.st_atime; aTime->tv_usec = 0; wTime->tv_sec = statBuf.st_mtime; wTime->tv_usec = 0; if (accessTime > 0) { struct timespec ts; TimeUtil_NtTimeToUnixTime(&ts, accessTime); aTime->tv_sec = ts.tv_sec; aTime->tv_usec = ts.tv_nsec / 1000; } if (writeTime > 0) { struct timespec ts; TimeUtil_NtTimeToUnixTime(&ts, writeTime); wTime->tv_sec = ts.tv_sec; wTime->tv_usec = ts.tv_nsec / 1000; } err = (utimes(path, times) == -1) ? errno : 0; free(path); if (err != 0) { Log(LGPFX" %s: utimes error on file \"%s\": %s\n", __FUNCTION__, pathName, Err_Errno2String(err)); return FALSE; } return TRUE; } /* *---------------------------------------------------------------------- * * File_SetFilePermissions -- * * Set file permissions. * * Results: * TRUE if succeed or FALSE if error. * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool File_SetFilePermissions(const char *pathName, // IN: int perms) // IN: permissions { ASSERT(pathName); if (Posix_Chmod(pathName, perms) == -1) { /* The error is not critical, just log it. */ Log(LGPFX" %s: failed to change permissions on file \"%s\": %s\n", __FUNCTION__, pathName, Err_Errno2String(errno)); return FALSE; } return TRUE; } #if !defined(__FreeBSD__) && !defined(sun) /* *----------------------------------------------------------------------------- * * FilePosixGetParent -- * * The input buffer is a canonical path name. Change it in place to the * canonical path name of its parent directory. * * Although this code is quite simple, we encapsulate it in a function * because it is easy to get it wrong. * * Results: * TRUE The input buffer was (and remains) the root directory. * FALSE The input buffer was not the root directory and was changed in * place to its parent directory. * * Example: "/foo/bar" -> "/foo" FALSE * "/foo" -> "/" FALSE * "/" -> "/" TRUE * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool FilePosixGetParent(char **canPath) // IN/OUT: Canonical file path { char *pathName; char *baseName; ASSERT(canPath); ASSERT(File_IsFullPath(*canPath)); if (Unicode_Compare(*canPath, DIRSEPS) == 0) { return TRUE; } File_GetPathName(*canPath, &pathName, &baseName); free(*canPath); if (Unicode_IsEmpty(pathName)) { /* empty string which denotes "/" */ free(pathName); *canPath = Unicode_Duplicate("/"); } else { if (Unicode_IsEmpty(baseName)) { // Directory File_GetPathName(pathName, canPath, NULL); free(pathName); } else { // File *canPath = pathName; } } free(baseName); return FALSE; } /* *----------------------------------------------------------------------------- * * File_GetParent -- * * The input buffer is a canonical path name. Change it in place to the * canonical path name of its parent directory. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool File_GetParent(char **canPath) // IN/OUT: Canonical file path { return FilePosixGetParent(canPath); } /* *---------------------------------------------------------------------- * * FileGetStats -- * * Calls statfs on a full path (eg. something returned from File_FullPath). * If doNotAscend is FALSE, climb up the directory chain and call statfs * on each level until it succeeds. * * Results: * TRUE statfs succeeded * FALSE unable to statfs anything along the path * * Side effects: * None * *---------------------------------------------------------------------- */ static Bool FileGetStats(const char *pathName, // IN: Bool doNotAscend, // IN: struct statfs *pstatfsbuf) // OUT: { Bool retval = TRUE; char *dupPath = NULL; while (Posix_Statfs(dupPath ? dupPath : pathName, pstatfsbuf) == -1) { if (errno != ENOENT || doNotAscend) { retval = FALSE; break; } if (dupPath == NULL) { /* Dup fullPath, so as not to modify input parameters */ dupPath = Unicode_Duplicate(pathName); } FilePosixGetParent(&dupPath); } free(dupPath); return retval; } /* *---------------------------------------------------------------------- * * File_GetFreeSpace -- * * Return the free space (in bytes) available to the user on a disk where * a file is or would be. If doNotAscend is FALSE, the helper function * ascends the directory chain on system call errors in order to obtain * the file system information. * * Results: * -1 if error (reported to the user) * * Side effects: * None * *---------------------------------------------------------------------- */ uint64 File_GetFreeSpace(const char *pathName, // IN: File name Bool doNotAscend) // IN: Do not ascend dir chain { uint64 ret; char *fullPath; struct statfs statfsbuf; fullPath = File_FullPath(pathName); if (fullPath == NULL) { return -1; } if (FileGetStats(fullPath, doNotAscend, &statfsbuf)) { ret = (uint64) statfsbuf.f_bavail * statfsbuf.f_bsize; } else { Warning("%s: Couldn't statfs %s\n", __func__, fullPath); ret = -1; } free(fullPath); return ret; } #if defined(VMX86_SERVER) /* *---------------------------------------------------------------------- * * File_GetVMFSAttributes -- * * Acquire the attributes for a given file or directory on a VMFS volume. * * Results: * Integer return value and populated FS_PartitionListResult * * Side effects: * Will fail if file is not on VMFS or not enough memory for partition * query results * *---------------------------------------------------------------------- */ int File_GetVMFSAttributes(const char *pathName, // IN: File/dir to test FS_PartitionListResult **fsAttrs) // IN/OUT: VMFS Info { int fd; int ret; char *fullPath; char *directory = NULL; fullPath = File_FullPath(pathName); if (fullPath == NULL) { ret = -1; goto bail; } if (File_IsDirectory(fullPath)) { directory = Unicode_Duplicate(fullPath); } else { File_SplitName(fullPath, NULL, &directory, NULL); } if (!HostType_OSIsVMK()) { Log(LGPFX" %s: File %s not on VMFS volume\n", __func__, pathName); ret = -1; goto bail; } *fsAttrs = Util_SafeMalloc(FS_PARTITION_ARR_SIZE(FS_PLIST_DEF_MAX_PARTITIONS)); memset(*fsAttrs, 0, FS_PARTITION_ARR_SIZE(FS_PLIST_DEF_MAX_PARTITIONS)); (*fsAttrs)->ioctlAttr.maxPartitions = FS_PLIST_DEF_MAX_PARTITIONS; (*fsAttrs)->ioctlAttr.getAttrSpec = FS_ATTR_SPEC_BASIC; fd = Posix_Open(directory, O_RDONLY, 0); if (fd == -1) { Log(LGPFX" %s: could not open %s: %s\n", __func__, pathName, Err_Errno2String(errno)); ret = -1; free(*fsAttrs); *fsAttrs = NULL; goto bail; } ret = ioctl(fd, IOCTLCMD_VMFS_FS_GET_ATTR, (char *) *fsAttrs); if (ret == -1) { Log(LGPFX" %s: Could not get volume attributes (ret = %d): %s\n", __func__, ret, Err_Errno2String(errno)); free(*fsAttrs); *fsAttrs = NULL; } close(fd); bail: free(fullPath); free(directory); return ret; } /* *---------------------------------------------------------------------- * * File_GetVMFSFSType -- * * Get the filesystem type number of the file system on which the * given file/directory resides. * * Caller can specify either a pathname or an already opened fd of * the file/dir whose filesystem he wants to determine. * 'fd' takes precedence over 'pathName' so 'pathName' is used only * if 'fd' is -1. * * Results: * On success : return value 0 and file type number in 'fsTypeNum'. * On failure : return value -1 (errno will be set appropriately). * * Side effects: * On failure errno will be set. * *---------------------------------------------------------------------- */ int File_GetVMFSFSType(const char *pathName, // IN: File name to test int fd, // IN: fd of an already opened file uint16 *fsTypeNum) // OUT: Filesystem type number { int ret, savedErrno; Bool fdArg = (fd >= 0); /* fd or pathname ? */ if (!fsTypeNum || (!fdArg && !pathName)) { savedErrno = EINVAL; goto exit; } if (!fdArg) { fd = Posix_Open(pathName, O_RDONLY, 0); if (fd < 0) { savedErrno = errno; Log(LGPFX" %s : Could not open %s : %s\n", __func__, pathName, Err_Errno2String(savedErrno)); goto exit; } } ret = ioctl(fd, IOCTLCMD_VMFS_GET_FSTYPE, fsTypeNum); /* * Save errno to avoid close() affecting it. */ savedErrno = errno; if (!fdArg) { close(fd); } if (ret == -1) { Log(LGPFX" %s : Could not get filesystem type for %s (fd %d) : %s\n", __func__, (!fdArg ? pathName : "__na__"), fd, Err_Errno2String(savedErrno)); goto exit; } return 0; exit: errno = savedErrno; ASSERT(errno != 0); return -1; } /* *---------------------------------------------------------------------- * * File_GetVMFSVersion -- * * Get the version number of the VMFS file system on which the * given file resides. * * Results: * Integer return value and version number. * * Side effects: * Will fail if file is not on VMFS or not enough memory for partition * query results. * *---------------------------------------------------------------------- */ int File_GetVMFSVersion(const char *pathName, // IN: File name to test uint32 *versionNum) // OUT: Version number { int ret = -1; FS_PartitionListResult *fsAttrs = NULL; if (!versionNum) { errno = EINVAL; goto exit; } ret = File_GetVMFSAttributes(pathName, &fsAttrs); if (ret < 0) { Log(LGPFX" %s: File_GetVMFSAttributes failed\n", __func__); } else { *versionNum = fsAttrs->versionNumber; } if (fsAttrs) { free(fsAttrs); } exit: return ret; } /* *---------------------------------------------------------------------- * * File_GetVMFSBlockSize -- * * Acquire the blocksize for a given file on a VMFS file system. * * Results: * Integer return value and block size * * Side effects: * Will fail if file is not on VMFS or not enough memory for partition * query results * *---------------------------------------------------------------------- */ int File_GetVMFSBlockSize(const char *pathName, // IN: File name to test uint32 *blockSize) // IN/OUT: VMFS block size { int ret = -1; FS_PartitionListResult *fsAttrs = NULL; if (!blockSize) { errno = EINVAL; goto exit; } ret = File_GetVMFSAttributes(pathName, &fsAttrs); if (ret < 0) { Log(LGPFX" %s: File_GetVMFSAttributes failed\n", __func__); } else { *blockSize = fsAttrs->fileBlockSize; } if (fsAttrs) { free(fsAttrs); } exit: return ret; } /* *---------------------------------------------------------------------- * * File_GetVMFSMountInfo -- * * Acquire the FS mount point info such as fsType, major version, * local mount point (/vmfs/volumes/xyz), and for NFS, * remote IP and remote mount point for a given file. * * Results: * Integer return value and allocated data * * Side effects: * Only implemented on ESX. Will fail on other platforms. * remoteIP and remoteMountPoint are only populated for files on NFS. * *---------------------------------------------------------------------- */ int File_GetVMFSMountInfo(const char *pathName, // IN: char **fsType, // OUT: uint32 *version, // OUT: char **remoteIP, // OUT: char **remoteMountPoint, // OUT: char **localMountPoint) // OUT: { int ret; FS_PartitionListResult *fsAttrs = NULL; *localMountPoint = File_GetUniqueFileSystemID(pathName); if (*localMountPoint == NULL) { return -1; } /* Get file IP and mount point */ ret = File_GetVMFSAttributes(pathName, &fsAttrs); if (ret >= 0 && fsAttrs) { *version = fsAttrs->versionNumber; *fsType = Util_SafeStrdup(fsAttrs->fsType); /* * We only compare the first 3 characters 'NFS'xx. * This will cover both NFSv3 and NFSv4.1. */ if (strncmp(fsAttrs->fsType, FS_NFS_ON_ESX, FS_NFS_PREFIX_LEN) == 0) { char *sep = strchr(fsAttrs->logicalDevice, ' '); if (sep) { *sep++ = 0; *remoteIP = Util_SafeStrdup(fsAttrs->logicalDevice); *remoteMountPoint = Util_SafeStrdup(sep); } else { *remoteIP = NULL; *remoteMountPoint = NULL; } } else { *remoteIP = NULL; *remoteMountPoint = NULL; } free(fsAttrs); } return ret; } #endif /* *---------------------------------------------------------------------- * * FileIsVMFS -- * * Is the given file on a filesystem that supports vmfs-specific * features like zeroed-thick and multiwriter files? * * Results: * TRUE if we're on VMFS. * * Side effects: * None * *---------------------------------------------------------------------- */ static Bool FileIsVMFS(const char *pathName) // IN: { Bool result = FALSE; #if defined(VMX86_SERVER) /* Right now only VMFS supports zeroedThick and multiWriter. */ FS_PartitionListResult *fsAttrs = NULL; if (File_GetVMFSAttributes(pathName, &fsAttrs) >= 0) { /* We want to match anything that starts with VMFS */ result = strncmp(fsAttrs->fsType, FS_VMFS_ON_ESX, strlen(FS_VMFS_ON_ESX)) == 0; } else { Log(LGPFX" %s: File_GetVMFSAttributes failed\n", __func__); } if (fsAttrs) { free(fsAttrs); } #endif return result; } /* *---------------------------------------------------------------------- * * File_SupportsZeroedThick -- * * Check if the given file is on an FS supports creation of * the zeroed-thick files. * Currently only VMFS on ESX does support zeroed-thick files, but * this may change in the future. * * Results: * TRUE if FS supports creation of the zeroed-thick files. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_SupportsZeroedThick(const char *pathName) // IN: { return FileIsVMFS(pathName); } /* *---------------------------------------------------------------------- * * File_SupportsMultiWriter -- * * Check if the given file is on an FS supports opening files * in multi-writer mode. * Currently only VMFS on ESX supports multi-writer mode, but * this may change in the future. * * Results: * TRUE if FS supports opening files in multi-writer mode. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_SupportsMultiWriter(const char *pathName) // IN: { return FileIsVMFS(pathName); } /* *---------------------------------------------------------------------- * * File_GetCapacity -- * * Return the total capacity (in bytes) available to the user on a disk * where a file is or would be * * Results: * -1 if error (reported to the user) * * Side effects: * None * *---------------------------------------------------------------------- */ uint64 File_GetCapacity(const char *pathName) // IN: Path name { uint64 ret; char *fullPath; struct statfs statfsbuf; fullPath = File_FullPath(pathName); if (fullPath == NULL) { return -1; } if (FileGetStats(fullPath, FALSE, &statfsbuf)) { ret = (uint64) statfsbuf.f_blocks * statfsbuf.f_bsize; } else { Warning(LGPFX" %s: Couldn't statfs\n", __func__); ret = -1; } free(fullPath); return ret; } /* *----------------------------------------------------------------------------- * * File_GetUniqueFileSystemID -- * * Returns a string which uniquely identifies the underlying filesystem * for a given path. * * 'path' can be relative (including empty) or absolute, and any number * of non-existing components at the end of 'path' are simply ignored. * * XXX: On POSIX systems, we choose the underlying device's name as the * unique ID. I make no claim that this is 100% unique so if you * need this functionality to be 100% perfect, I suggest you think * about it more deeply than I did. -meccleston * * Results: * On success: Allocated and NUL-terminated filesystem ID. * On failure: NULL. * * Side effects: * None * *----------------------------------------------------------------------------- */ char * File_GetUniqueFileSystemID(char const *path) // IN: File path { #ifdef VMX86_SERVER char vmfsVolumeName[FILE_MAXPATH]; char *existPath; char *canPath; existPath = FilePosixNearestExistingAncestor(path); canPath = Posix_RealPath(existPath); /* * Returns "/vmfs/devices" for DEVFS. Since /vmfs/devices is symbol linker, * We don't use realpath here. */ if (strncmp(existPath, DEVFS_MOUNT_POINT, strlen(DEVFS_MOUNT_POINT)) == 0) { char devfsName[FILE_MAXPATH]; if (sscanf(existPath, DEVFS_MOUNT_PATH "%[^/]%*s", devfsName) == 1) { free(existPath); free(canPath); return Str_SafeAsprintf(NULL, "%s/%s", DEVFS_MOUNT_POINT, devfsName); } } free(existPath); if (canPath == NULL) { return NULL; } /* * VCFS doesn't have real mount points, so the mount point lookup below * returns "/vmfs", instead of the VCFS mount point. * * See bug 61646 for why we care. */ if (strncmp(canPath, VCFS_MOUNT_POINT, strlen(VCFS_MOUNT_POINT)) != 0 || sscanf(canPath, VCFS_MOUNT_PATH "%[^/]%*s", vmfsVolumeName) != 1) { free(canPath); goto exit; } /* * If the path points to a file or directory that is on a vsan datastore, * we have to determine which namespace object is involved. */ if (strncmp(vmfsVolumeName, FS_VSAN_URI_PREFIX, strlen(FS_VSAN_URI_PREFIX)) == 0) { FS_PartitionListResult *fsAttrs = NULL; int res; res = File_GetVMFSAttributes(canPath, &fsAttrs); if (res >= 0 && fsAttrs != NULL && strncmp(fsAttrs->fsType, FS_VMFS_ON_ESX, strlen(FS_VMFS_ON_ESX)) == 0) { char *unique; unique = Str_SafeAsprintf(NULL, "%s/%s/%s", VCFS_MOUNT_POINT, vmfsVolumeName, fsAttrs->name); free(fsAttrs); free(canPath); return unique; } free(fsAttrs); } free(canPath); return Str_SafeAsprintf(NULL, "%s/%s", VCFS_MOUNT_POINT, vmfsVolumeName); exit: #endif return FilePosixGetBlockDevice(path); } #if !defined(__APPLE__) /* *----------------------------------------------------------------------------- * * FilePosixLookupMountPoint -- * * Looks up passed in canonical file path in list of mount points. * If there is a match, it returns the underlying device name of the * mount point along with a flag indicating whether the mount point is * mounted with the "--[r]bind" option. * * Results: * On success: The allocated, NUL-terminated mounted "device". * On failure: NULL. * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * FilePosixLookupMountPoint(char const *canPath, // IN: Canonical file path Bool *bind) // OUT: Mounted with --[r]bind? { #if defined NO_SETMNTENT || defined NO_ENDMNTENT NOT_IMPLEMENTED(); errno = ENOSYS; return NULL; #else FILE *f; struct mntent mnt; char *buf; size_t size; size_t used; char *ret = NULL; ASSERT(canPath); ASSERT(bind); size = 4 * FILE_MAXPATH; // Should suffice for most locales retry: f = setmntent(MOUNTED, "r"); if (f == NULL) { return NULL; } buf = Util_SafeMalloc(size); while (Posix_Getmntent_r(f, &mnt, buf, size) != NULL) { /* * Our Posix_Getmntent_r graciously sets errno when the buffer * is too small, but on UTF-8 based platforms Posix_Getmntent_r * is #defined to the system's getmntent_r, which can simply * truncate the strings with no other indication. See how much * space it used and increase the buffer size if needed. Note * that if some of the strings are empty, they may share a * common nul in the buffer, and the resulting size calculation * will be a little over-zealous. */ used = 0; if (mnt.mnt_fsname) { used += strlen(mnt.mnt_fsname) + 1; } if (mnt.mnt_dir) { used += strlen(mnt.mnt_dir) + 1; } if (mnt.mnt_type) { used += strlen(mnt.mnt_type) + 1; } if (mnt.mnt_opts) { used += strlen(mnt.mnt_opts) + 1; } if (used >= size || !mnt.mnt_fsname || !mnt.mnt_dir || !mnt.mnt_type || !mnt.mnt_opts) { size += 4 * FILE_MAXPATH; ASSERT(size <= 32 * FILE_MAXPATH); free(buf); endmntent(f); goto retry; } /* * NB: A call to realpath is not needed as getmntent() already * returns it in canonical form. Additionally, it is bad * to call realpath() as often a mount point is down, and * realpath calls stat which can block trying to stat * a filesystem that the caller of the function is not at * all expecting. */ if (strcmp(mnt.mnt_dir, canPath) == 0) { /* * The --bind and --rbind options behave differently. See * FilePosixGetBlockDevice() for details. * * Sadly (I blame a bug in 'mount'), there is no way to tell them * apart in /etc/mtab: the option recorded there is, in both cases, * always "bind". */ *bind = strstr(mnt.mnt_opts, "bind") != NULL; ret = Util_SafeStrdup(mnt.mnt_fsname); break; } } // 'canPath' is not a mount point. endmntent(f); free(buf); return ret; #endif } #endif /* *----------------------------------------------------------------------------- * * FilePosixGetBlockDevice -- * * Retrieve the block device that backs file path 'path'. * * 'path' can be relative (including empty) or absolute, and any number of * non-existing components at the end of 'path' are simply ignored. * * Results: * On success: The allocated, NUL-terminated block device absolute path. * On failure: NULL. * * Side effects: * None * *----------------------------------------------------------------------------- */ char * FilePosixGetBlockDevice(char const *path) // IN: File path { char *existPath; Bool failed; #if defined(__APPLE__) struct statfs buf; #else char canPath[FILE_MAXPATH]; char canPath2[FILE_MAXPATH]; unsigned int retries = 0; char *realPath; #endif existPath = FilePosixNearestExistingAncestor(path); #if defined(__APPLE__) failed = statfs(existPath, &buf) == -1; free(existPath); if (failed) { return NULL; } return Util_SafeStrdup(buf.f_mntfromname); #else realPath = Posix_RealPath(existPath); free(existPath); if (realPath == NULL) { return NULL; } Str_Strcpy(canPath, realPath, sizeof canPath); free(realPath); retry: Str_Strcpy(canPath2, canPath, sizeof canPath2); /* Find the nearest ancestor of 'canPath' that is a mount point. */ for (;;) { char *x; Bool bind = FALSE; char *ptr; ptr = FilePosixLookupMountPoint(canPath, &bind); if (ptr) { if (bind) { /* * 'canPath' is a mount point mounted with --[r]bind. This is the * mount equivalent of a hard link. Follow the rabbit... * * --bind and --rbind behave differently. Consider this mount * table: * * /dev/sda1 / ext3 * exit14:/vol/vol0/home /exit14/home nfs * / /bind (mounted with --bind) * / /rbind (mounted with --rbind) * * then what we _should_ return for these paths is: * * /bind/exit14/home -> /dev/sda1 * /rbind/exit14/home -> exit14:/vol/vol0/home * * XXX but currently because we cannot easily tell the difference, * we always assume --rbind and we return: * * /bind/exit14/home -> exit14:/vol/vol0/home * /rbind/exit14/home -> exit14:/vol/vol0/home */ Bool rbind = TRUE; if (rbind) { /* * Compute 'canPath = ptr + (canPath2 - canPath)' using and * preserving the structural properties of all canonical * paths involved in the expression. */ size_t canPathLen = strlen(canPath); char const *diff = canPath2 + (canPathLen > 1 ? canPathLen : 0); if (*diff != '\0') { Str_Sprintf(canPath, sizeof canPath, "%s%s", strlen(ptr) > 1 ? ptr : "", diff); } else { Str_Strcpy(canPath, ptr, sizeof canPath); } } else { Str_Strcpy(canPath, ptr, sizeof canPath); } free(ptr); /* * There could be a series of these chained together. It is * possible for the mounts to get into a loop, so limit the total * number of retries to something reasonable like 10. */ retries++; if (retries > 10) { Warning(LGPFX" %s: The --[r]bind mount count exceeds %u. Giving " "up.\n", __func__, 10); return NULL; } goto retry; } return ptr; } /* XXX temporary work-around until this function is Unicoded. */ x = Util_SafeStrdup(canPath); failed = FilePosixGetParent(&x); Str_Strcpy(canPath, x, sizeof canPath); free(x); /* * Prevent an infinite loop in case FilePosixLookupMountPoint() even * fails on "/". */ if (failed) { return NULL; } } #endif } /* *----------------------------------------------------------------------------- * * FilePosixNearestExistingAncestor -- * * Find the nearest existing ancestor of 'path'. * * 'path' can be relative (including empty) or absolute, and 'path' can * have any number of non-existing components at its end. * * Results: * The allocated, NUL-terminated, non-empty path of the * nearest existing ancestor. * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * FilePosixNearestExistingAncestor(char const *path) // IN: File path { size_t resultSize; char *result; struct stat statbuf; resultSize = MAX(strlen(path), 1) + 1; result = Util_SafeMalloc(resultSize); Str_Strcpy(result, path, resultSize); for (;;) { char *ptr; if (*result == '\0') { Str_Strcpy(result, *path == DIRSEPC ? "/" : ".", resultSize); break; } if (Posix_Stat(result, &statbuf) == 0) { break; } ptr = strrchr(result, DIRSEPC); if (!ptr) { ptr = result; } *ptr = '\0'; } return result; } #endif /* !FreeBSD && !sun */ /* *---------------------------------------------------------------------------- * * File_IsSameFile -- * * Determine whether both paths point to the same file. * * Caveats - While local files are matched based on inode and device * ID, some older versions of NFS return buggy device IDs, so the * determination cannot be done with 100% confidence across NFS. * Paths that traverse NFS mounts are matched based on device, inode * and all of the fields of the stat structure except for times. * This introduces a race condition in that if the target files are not * locked, they can change out from underneath this function yielding * false negative results. Cloned files sytems mounted across an old * version of NFS may yield a false positive. * * Results: * TRUE if both paths point to the same file, FALSE otherwise. * * Side effects: * Changes errno, maybe. * *---------------------------------------------------------------------------- */ Bool File_IsSameFile(const char *path1, // IN: const char *path2) // IN: { struct stat st1; struct stat st2; #if !defined(sun) // Solaris does not have statfs struct statfs stfs1; struct statfs stfs2; #endif ASSERT(path1); ASSERT(path2); /* * First take care of the easy checks. If the paths are identical, or if * the inode numbers or resident devices don't match, we're done. */ if (Unicode_Compare(path1, path2) == 0) { return TRUE; } if (Posix_Stat(path1, &st1) == -1) { return FALSE; } if (Posix_Stat(path2, &st2) == -1) { return FALSE; } if (st1.st_ino != st2.st_ino) { return FALSE; } if (st1.st_dev != st2.st_dev) { return FALSE; } if (HostType_OSIsVMK()) { /* * On ESX, post change 1074635 the st_dev field of the stat structure * is valid and differentiates between resident devices or NFS file * systems - no need to use statfs to obtain file system information. */ return TRUE; } #if !defined(sun) // Solaris does not have statfs if (Posix_Statfs(path1, &stfs1) != 0) { return FALSE; } if (Posix_Statfs(path2, &stfs2) != 0) { return FALSE; } #if defined(__APPLE__) || defined(__FreeBSD__) if ((stfs1.f_flags & MNT_LOCAL) && (stfs2.f_flags & MNT_LOCAL)) { return TRUE; } #else if ((stfs1.f_type != NFS_SUPER_MAGIC) && (stfs2.f_type != NFS_SUPER_MAGIC)) { return TRUE; } #endif #endif /* * At least one of the paths traverses NFS and some older NFS * implementations can set st_dev incorrectly. Do some extra checks of the * stat structure to increase our confidence. Since the st_ino numbers had * to match to get this far, the overwhelming odds are the two files are * the same. * * If another process was actively writing or otherwise modifying the file * while we stat'd it, then the following test could fail and we could * return a false negative. On the other hand, if NFS lies about st_dev * and the paths point to a cloned file system, then the we will return a * false positive. */ if ((st1.st_mode == st2.st_mode) && (st1.st_nlink == st2.st_nlink) && (st1.st_uid == st2.st_uid) && (st1.st_gid == st2.st_gid) && (st1.st_rdev == st2.st_rdev) && (st1.st_size == st2.st_size) && (st1.st_blksize == st2.st_blksize) && (st1.st_blocks == st2.st_blocks)) { return TRUE; } return FALSE; } /* *----------------------------------------------------------------------------- * * File_Replace -- * * Replace old file (destination) with new file (source), and attempt to * reproduce file permissions. A NULL value for either the oldName or * newName will result in failure and errno will be set to EFAULT. * * Results: * TRUE on success. * * Side effects: * errno may be set. * *----------------------------------------------------------------------------- */ Bool File_Replace(const char *oldName, // IN: old file const char *newName) // IN: new file { int status = 0; Bool result = FALSE; char *newPath = NULL; char *oldPath = NULL; struct stat st; if (newName == NULL) { status = EFAULT; goto bail; } else if ((newPath = Unicode_GetAllocBytes(newName, STRING_ENCODING_DEFAULT)) == NULL) { status = UNICODE_CONVERSION_ERRNO; Msg_Append(MSGID(filePosix.replaceConversionFailed) "Failed to convert file path \"%s\" to current encoding\n", newName); goto bail; } if (oldName == NULL) { status = EFAULT; goto bail; } else if ((oldPath = Unicode_GetAllocBytes(oldName, STRING_ENCODING_DEFAULT)) == NULL) { status = UNICODE_CONVERSION_ERRNO; Msg_Append(MSGID(filePosix.replaceConversionFailed) "Failed to convert file path \"%s\" to current encoding\n", oldName); goto bail; } if ((stat(oldPath, &st) == 0) && (chmod(newPath, st.st_mode) == -1)) { status = errno; Msg_Append(MSGID(filePosix.replaceChmodFailed) "Failed to duplicate file permissions from " "\"%s\" to \"%s\": %s\n", oldName, newName, Msg_ErrString()); goto bail; } if (rename(newPath, oldPath) < 0) { status = errno; Msg_Append(MSGID(filePosix.replaceRenameFailed) "Failed to rename \"%s\" to \"%s\": %s\n", newName, oldName, Msg_ErrString()); goto bail; } result = TRUE; bail: free(newPath); free(oldPath); errno = status; return result; } /* *---------------------------------------------------------------------- * * FilePosixGetMaxOrSupportsFileSize -- * * Given a file descriptor to a file on a volume, either find out the * max file size for the volume on which the file is located or check * if the volume supports the given file size. * If getMaxFileSize is set then find out the max file size and store it * in *maxFileSize on success, otherwise figure out if *fileSize is * supported. * * Results: * If getMaxFileSize was set: * TRUE with max file size stored in *fileSize. * Otherwise: * TRUE fileSize is supported. * FALSE fileSize not supported or could not figure out the answer. * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool FilePosixGetMaxOrSupportsFileSize(FileIODescriptor *fd, // IN: uint64 *fileSize, // IN/OUT: Bool getMaxFileSize) // IN: { uint64 value = 0; uint64 mask; ASSERT(fd); ASSERT(fileSize); if (!getMaxFileSize) { return FileIO_SupportsFileSize(fd, *fileSize); } /* * Try to do a binary search and figure out the max supported file size. */ for (mask = (1ULL << 62); mask != 0; mask >>= 1) { if (FileIO_SupportsFileSize(fd, value | mask)) { value |= mask; } } *fileSize = value; return TRUE; } /* *---------------------------------------------------------------------- * * FilePosixCreateTestGetMaxOrSupportsFileSize -- * * Given a path to a dir on a volume, either find out the max file size * for the volume on which the dir is located or check if the volume * supports the given file size. * If getMaxFileSize is set then find out the max file size and store it * in *maxFileSize on success, otherwise figure out if *fileSize is * supported. * * Results: * If getMaxFileSize was set: * TRUE if figured out the max file size. * FALSE failed to figure out the max file size. * Otherwise: * TRUE fileSize is supported. * FALSE fileSize not supported or could not figure out the answer. * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool FilePosixCreateTestGetMaxOrSupportsFileSize(const char *dirName, // IN: test dir uint64 *fileSize, // IN/OUT: Bool getMaxFileSize) // IN: { Bool retVal; int posixFD; char *temp; char *path; FileIODescriptor fd; ASSERT(fileSize); temp = Unicode_Append(dirName, "/.vmBigFileTest"); posixFD = File_MakeSafeTemp(temp, &path); free(temp); if (posixFD == -1) { Log(LGPFX" %s: Failed to create temporary file in dir: %s\n", __func__, dirName); return FALSE; } fd = FileIO_CreateFDPosix(posixFD, O_RDWR); retVal = FilePosixGetMaxOrSupportsFileSize(&fd, fileSize, getMaxFileSize); /* Eventually perform destructive tests here... */ FileIO_Close(&fd); File_Unlink(path); free(path); return retVal; } #ifdef VMX86_SERVER /* *---------------------------------------------------------------------- * * FileVMKGetMaxFileSize -- * * Given a path to a file on a volume, find out the max file size for * the volume on which the file is located. * Max file size gets stored in *maxFileSize on success. * * Results: * TRUE if figured out the max file size. * FALSE failed to figure out the max file size. * * Side effects: * None * *---------------------------------------------------------------------- */ static Bool FileVMKGetMaxFileSize(const char *pathName, // IN: uint64 *maxFileSize) // OUT: { int fd; Bool retval = TRUE; char *fullPath; char *dirPath = NULL; ASSERT(maxFileSize); fullPath = File_FullPath(pathName); if (fullPath == NULL) { Log(LGPFX" %s: Failed to get the full path for %s\n", __func__, pathName); retval = FALSE; goto bail; } if (File_IsDirectory(fullPath)) { dirPath = Unicode_Duplicate(fullPath); } else { dirPath = NULL; File_SplitName(fullPath, NULL, &dirPath, NULL); } /* * We always try to open the dir in order to avoid any contention on VMDK * descriptor file with those threads which already have descriptor file * opened for writing. */ fd = Posix_Open(dirPath, O_RDONLY, 0); if (fd == -1) { Log(LGPFX" %s: could not open %s: %s\n", __func__, dirPath, Err_Errno2String(errno)); retval = FALSE; goto bail; } if (ioctl(fd, IOCTLCMD_VMFS_GET_MAX_FILE_SIZE, maxFileSize) == -1) { Log(LGPFX" %s: Could not get max file size for path: %s, error: %s\n", __func__, pathName, Err_Errno2String(errno)); retval = FALSE; } close(fd); bail: free(fullPath); free(dirPath); return retval; } #endif /* *---------------------------------------------------------------------- * * FileVMKGetMaxOrSupportsFileSize -- * * Given a path to a file on a volume, either find out the max file size * for the volume on which the file is located or check if the volume * supports the given file size. * If getMaxFileSize is set then find out the max file size and store it * in *maxFileSize on success, otherwise figure out if *fileSize is * supported. * * Results: * If getMaxFileSize was set: * TRUE if figured out the max file size. * FALSE failed to figure out the max file size. * Otherwise: * TRUE fileSize is supported. * FALSE fileSize not supported or could not figure out the answer. * * Side effects: * None * *---------------------------------------------------------------------- */ static Bool FileVMKGetMaxOrSupportsFileSize(const char *pathName, // IN: uint64 *fileSize, // IN/OUT: Bool getMaxFileSize) // IN: { #if defined(VMX86_SERVER) FS_PartitionListResult *fsAttrs = NULL; uint64 maxFileSize; /* * Let's first try IOCTL to figure out max file size. */ if (FileVMKGetMaxFileSize(pathName, &maxFileSize)) { if (getMaxFileSize) { *fileSize = maxFileSize; return TRUE; } return (*fileSize <= maxFileSize); } /* * Try the old way if IOCTL failed. */ LOG(0, (LGPFX" %s: Failed to figure out max file size via " "IOCTLCMD_VMFS_GET_MAX_FILE_SIZE. Falling back to old method.\n", __func__)); maxFileSize = -1; if (File_GetVMFSAttributes(pathName, &fsAttrs) < 0) { Log(LGPFX" %s: File_GetVMFSAttributes Failed\n", __func__); return FALSE; } if (strcmp(fsAttrs->fsType, FS_VMFS_ON_ESX) == 0) { if (fsAttrs->versionNumber == 3) { maxFileSize = (VMFS3CONST * (uint64) fsAttrs->fileBlockSize * 1024); } else if (fsAttrs->versionNumber >= 5) { /* Get ready for 64 TB on VMFS5 and perform sanity check on version */ maxFileSize = (uint64) 0x400000000000ULL; } else { Log(LGPFX" %s: Unsupported filesystem version, %u\n", __func__, fsAttrs->versionNumber); free(fsAttrs); return FALSE; } free(fsAttrs); if (maxFileSize == -1) { Log(LGPFX" %s: Failed to figure out the max file size for %s\n", __func__, pathName); return FALSE; } if (getMaxFileSize) { *fileSize = maxFileSize; return TRUE; } else { return *fileSize <= maxFileSize; } } else { char *fullPath; char *parentPath; Bool supported; Log(LGPFX" %s: Trying create file and seek approach.\n", __func__); fullPath = File_FullPath(pathName); if (fullPath == NULL) { Log(LGPFX" %s: Error acquiring full path\n", __func__); free(fsAttrs); return FALSE; } File_GetPathName(fullPath, &parentPath, NULL); supported = FilePosixCreateTestGetMaxOrSupportsFileSize(parentPath, fileSize, getMaxFileSize); free(fsAttrs); free(fullPath); free(parentPath); return supported; } #endif Log(LGPFX" %s: did not execute properly\n", __func__); return FALSE; /* happy compiler */ } /* *---------------------------------------------------------------------- * * FileGetMaxOrSupportsFileSize -- * * Given a path to a file on a volume, either find out the max file size * for the volume on which the file is located or check if the volume * supports the given file size. * If getMaxFileSize is set then find out the max file size and store it * in *maxFileSize on success, otherwise figure out if *fileSize is * supported. * * Results: * If getMaxFileSize was set: * TRUE if figured out the max file size. * FALSE failed to figure out the max file size. * Otherwise: * TRUE fileSize is supported. * FALSE fileSize not supported or could not figure out the answer. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool FileGetMaxOrSupportsFileSize(const char *pathName, // IN: uint64 *fileSize, // IN/OUT: Bool getMaxFileSize) // IN: { char *fullPath; char *folderPath; Bool retval = FALSE; ASSERT(fileSize); /* * We acquire the full path name for testing in * FilePosixCreateTestGetMaxOrSupportsFileSize(). This is also done in the * event that a user tries to create a virtual disk in the directory that * they want a vmdk created in (setting filePath only to the disk name, * not the entire path.). */ fullPath = File_FullPath(pathName); if (fullPath == NULL) { Log(LGPFX" %s: Error acquiring full path for path: %s.\n", __func__, pathName); goto out; } if (HostType_OSIsVMK()) { retval = FileVMKGetMaxOrSupportsFileSize(fullPath, fileSize, getMaxFileSize); goto out; } if (File_IsFile(fullPath)) { FileIOResult res; FileIODescriptor fd; FileIO_Invalidate(&fd); res = FileIO_Open(&fd, fullPath, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); if (FileIO_IsSuccess(res)) { retval = FilePosixGetMaxOrSupportsFileSize(&fd, fileSize, getMaxFileSize); FileIO_Close(&fd); goto out; } } /* * On unknown filesystems create a temporary file in the argument file's * parent directory and use it as a test. */ if (File_IsDirectory(pathName)) { folderPath = Unicode_Duplicate(fullPath); } else { folderPath = NULL; File_SplitName(fullPath, NULL, &folderPath, NULL); } retval = FilePosixCreateTestGetMaxOrSupportsFileSize(folderPath, fileSize, getMaxFileSize); free(folderPath); out: free(fullPath); return retval; } /* *---------------------------------------------------------------------- * * File_GetMaxFileSize -- * * Given a path to a file on a volume, return the max file size for that * volume. The max file size is stored on *maxFileSize on success. * The function caps the max file size to be MAX_SUPPORTED_FILE_SIZE on * any type of FS. * * Results: * TRUE on success. * FALSE failed to figure out max file size due to some reasons. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_GetMaxFileSize(const char *pathName, // IN: uint64 *maxFileSize) // OUT: { Bool result; if (!maxFileSize) { Log(LGPFX" %s: maxFileSize passed as NULL.\n", __func__); return FALSE; } result = FileGetMaxOrSupportsFileSize(pathName, maxFileSize, TRUE); if (result) { /* * Cap the max supported file size at MAX_SUPPORTED_FILE_SIZE. */ if (*maxFileSize > MAX_SUPPORTED_FILE_SIZE) { *maxFileSize = MAX_SUPPORTED_FILE_SIZE; } } return result; } /* *---------------------------------------------------------------------- * * File_SupportsFileSize -- * * Check if the given file is on an FS that supports such file size. * The function caps the max supported file size to be * MAX_SUPPORTED_FILE_SIZE on any type of FS. * * Results: * TRUE if FS supports such file size. * FALSE otherwise (file size not supported, invalid path, read-only, ...) * * Side effects: * None * *---------------------------------------------------------------------- */ Bool File_SupportsFileSize(const char *pathName, // IN: uint64 fileSize) // IN: { /* * All supported filesystems can hold at least 2GB-1 bytes files. */ if (fileSize <= 0x7FFFFFFF) { return TRUE; } /* * Cap the max supported file size at MAX_SUPPORTED_FILE_SIZE. */ if (fileSize > MAX_SUPPORTED_FILE_SIZE) { return FALSE; } return FileGetMaxOrSupportsFileSize(pathName, &fileSize, FALSE); } /* *----------------------------------------------------------------------------- * * FileCreateDirectory -- * * Create a directory. The umask is honored. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * May change the host file system. * *----------------------------------------------------------------------------- */ int FileCreateDirectory(const char *pathName, // IN: int mask) // IN: { int err; if (pathName == NULL) { err = errno = EFAULT; } else { err = (Posix_Mkdir(pathName, mask) == -1) ? errno : 0; } return err; } /* *---------------------------------------------------------------------- * * File_ListDirectory -- * * Gets the list of files (and directories) in a directory. * * Results: * Returns the number of files returned or -1 on failure. * * Side effects: * If ids is provided and the function succeeds, memory is * allocated for both the unicode strings and the array itself * and must be freed. (See Util_FreeStringList.) * The memory allocated for the array may be larger than necessary. * The caller may trim it with realloc() if it cares. * * A file name that cannot be represented in the default encoding * will appear as a string of three UTF8 substitution characters. * *---------------------------------------------------------------------- */ static int FileKeyDispose(const char *key, // IN: void *value, // IN: void *clientData) // IN: { free((void *) key); return 0; } static int FileUnique(const char *key, // IN: void *value, // IN: void *clientData) // IN/OUT: a DynBuf { DynBuf *b = clientData; DynBuf_Append(b, &key, sizeof key); return 0; } int File_ListDirectory(const char *pathName, // IN: char ***ids) // OUT: relative paths { int err; DIR *dir; int count; HashTable *hash; ASSERT(pathName != NULL); dir = Posix_OpenDir(pathName); if (dir == NULL) { // errno is preserved return -1; } hash = HashTable_Alloc(256, HASH_STRING_KEY, NULL); count = 0; while (TRUE) { struct dirent *entry; errno = 0; entry = readdir(dir); if (entry == NULL) { err = errno; break; } /* Strip out undesirable paths. No one ever cares about these. */ if ((strcmp(entry->d_name, ".") == 0) || (strcmp(entry->d_name, "..") == 0)) { continue; } /* Don't create the file list if we aren't providing it to the caller. */ if (ids) { char *id; if (Unicode_IsBufferValid(entry->d_name, -1, STRING_ENCODING_DEFAULT)) { id = Unicode_Alloc(entry->d_name, STRING_ENCODING_DEFAULT); } else { id = Unicode_EscapeBuffer(entry->d_name, -1, STRING_ENCODING_DEFAULT); Warning("%s: file '%s' in directory '%s' cannot be converted to " "UTF8\n", __FUNCTION__, pathName, id); free(id); id = Unicode_Duplicate(UNICODE_SUBSTITUTION_CHAR UNICODE_SUBSTITUTION_CHAR UNICODE_SUBSTITUTION_CHAR); } /* * It is possible for a directory operation to change the contents * of a directory while this routine is running. If the OS decides * to physically rearrange the contents of the directory it is * possible for readdir to report a file more than once. Only add * a file to the return data if it is unique within the return * data. */ if (HashTable_Insert(hash, id, NULL)) { count++; } else { free(id); } } else { count++; } } closedir(dir); if (ids) { ASSERT(count == HashTable_GetNumElements(hash)); if (err == 0) { DynBuf b; DynBuf_Init(&b); HashTable_ForEach(hash, FileUnique, &b); *ids = DynBuf_Detach(&b); DynBuf_Destroy(&b); } else { HashTable_ForEach(hash, FileKeyDispose, NULL); } } HashTable_Free(hash); return (errno = err) == 0 ? count : -1; } /* *----------------------------------------------------------------------------- * * File_WalkDirectoryEnd -- * * End the directory traversal. * * Results: * None * * Side effects: * The context is now invalid. * *----------------------------------------------------------------------------- */ void File_WalkDirectoryEnd(WalkDirContext context) // IN: { if (context != NULL) { if (context->cnt > 0) { Util_FreeStringList(context->files, context->cnt); } free(context); } } /* *----------------------------------------------------------------------------- * * File_WalkDirectoryStart -- * * Start a directory tree walk at 'parentPath'. * * To read each entry, repeatedly pass the returned context to * File_WalkDirectoryNext() until that function returns FALSE. * * We assume no thread will change the working directory between the calls * to File_WalkDirectoryStart and File_WalkDirectoryEnd. * * Results: * A context used in subsequent calls to File_WalkDirectoryNext() or NULL * if an error is encountered. * * Side effects: * None * *----------------------------------------------------------------------------- */ WalkDirContext File_WalkDirectoryStart(const char *parentPath) // IN: { WalkDirContextImpl *context = malloc(sizeof *context); if (context != NULL) { context->files = NULL; context->iter = 0; context->cnt = File_ListDirectory(parentPath, &context->files); if (context->cnt == -1) { File_WalkDirectoryEnd(context); context = NULL; } } return context; } /* *----------------------------------------------------------------------------- * * File_WalkDirectoryNext -- * * Get the next entry in a directory traversal started with * File_WalkDirectoryStart. * * Results: * TRUE iff the traversal hasn't completed. * * If TRUE, *path holds an allocated string of a directory entry that the * caller must free (see free). * * If FALSE, errno is 0 iff the walk completed sucessfully. * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool File_WalkDirectoryNext(WalkDirContext context, // IN: char **path) // OUT: { ASSERT(context); ASSERT(path); errno = 0; // Any errors showed up at "start time". if (context->iter < context->cnt) { *path = Util_SafeStrdup(context->files[context->iter++]); return TRUE; } return FALSE; } /* *---------------------------------------------------------------------- * * FileIsGroupsMember -- * * Determine if a gid is in the gid list of the current process * * Results: * FALSE if error (reported to the user) * * Side effects: * None * *---------------------------------------------------------------------- */ static Bool FileIsGroupsMember(gid_t gid) // IN: { int nr_members; gid_t *members; int res; int ret; members = NULL; nr_members = 0; for (;;) { gid_t *new; res = getgroups(nr_members, members); if (res == -1) { Warning(LGPFX" %s: Couldn't getgroups\n", __FUNCTION__); ret = FALSE; goto end; } if (res == nr_members) { break; } /* Was bug 17760 --hpreg */ new = realloc(members, res * sizeof *members); if (new == NULL) { Warning(LGPFX" %s: Couldn't realloc\n", __FUNCTION__); ret = FALSE; goto end; } members = new; nr_members = res; } for (res = 0; res < nr_members; res++) { if (members[res] == gid) { ret = TRUE; goto end; } } ret = FALSE; end: free(members); return ret; } /* *---------------------------------------------------------------------- * * FileIsWritableDir -- * * Determine in a non-intrusive way if the user can create a file in a * directory * * Results: * FALSE if error (reported to the user) * * Side effects: * None * * Bug: * It would be cleaner to use the POSIX access(2), which deals well * with read-only filesystems. Unfortunately, access(2) doesn't deal with * the effective [u|g]ids. * *---------------------------------------------------------------------- */ Bool FileIsWritableDir(const char *dirName) // IN: { int err; uid_t euid; FileData fileData; err = FileAttributes(dirName, &fileData); if ((err != 0) || (fileData.fileType != FILE_TYPE_DIRECTORY)) { return FALSE; } euid = geteuid(); if (euid == 0) { /* Root can read or write any file. Well... This is not completely true because of read-only filesystems and NFS root squashing... What a nightmare --hpreg */ return TRUE; } if (fileData.fileOwner == euid) { fileData.fileMode >>= 6; } else if (FileIsGroupsMember(fileData.fileGroup)) { fileData.fileMode >>= 3; } /* Check for Read and Execute permissions */ return (fileData.fileMode & 3) == 3; } /* *---------------------------------------------------------------------- * * File_MakeCfgFileExecutable -- * * Make a .vmx file executable. This is sometimes necessary * to enable MKS access to the VM. * * Owner always gets rwx. Group/other get x where r is set. * * Results: * FALSE if error * * Side effects: * errno is set on error * *---------------------------------------------------------------------- */ Bool File_MakeCfgFileExecutable(const char *pathName) // IN: { struct stat s; if (Posix_Stat(pathName, &s) == 0) { mode_t newMode = s.st_mode; newMode |= S_IRUSR | S_IWUSR | S_IXUSR; ASSERT_ON_COMPILE(S_IRGRP >> 2 == S_IXGRP && S_IROTH >> 2 == S_IXOTH); newMode |= ((newMode & (S_IRGRP | S_IROTH)) >> 2); return newMode == s.st_mode || Posix_Chmod(pathName, newMode); } return FALSE; } /* *---------------------------------------------------------------------------- * * File_GetSizeAlternate -- * * An alternate way to determine the filesize. Useful for finding * problems with files on remote fileservers, such as described in bug * 19036. However, in Linux we do not have an alternate way, yet, to * determine the problem, so we call back into the regular getSize * function. * * Results: * Size of file or -1. * * Side effects: * None * *---------------------------------------------------------------------------- */ int64 File_GetSizeAlternate(const char *pathName) // IN: { return File_GetSize(pathName); } /* *---------------------------------------------------------------------------- * * File_IsCharDevice -- * * This function checks whether the given file is a char device * and return TRUE in such case. This is often useful on Windows * where files like COM?, LPT? must be differentiated from "normal" * disk files. * * Results: * TRUE is a character device * FALSE is not a character device or error * * Side effects: * None * *---------------------------------------------------------------------------- */ Bool File_IsCharDevice(const char *pathName) // IN: { FileData fileData; return (FileAttributes(pathName, &fileData) == 0) && (fileData.fileType == FILE_TYPE_CHARDEVICE); } open-vm-tools-10.0.7-3227872/lib/file/fileIO.c0000644000000000000000000006537512660700525016673 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileIO.c -- * * Basic (non internationalized) implementation of error messages for the * Files library. * * File locking/unlocking routines. * */ #include #include #include #include "vmware.h" #include "util.h" #include "fileIO.h" #include "fileLock.h" #include "fileInt.h" #include "msg.h" #include "unicodeOperations.h" #include "hostType.h" #if defined(_WIN32) #include #else #include #include #include #include #include #endif #if defined(VMX86_SERVER) #include "fs_public.h" #endif /* *---------------------------------------------------------------------- * * FileIO_ErrorEnglish -- * * Return the message associated with a status code * * Results: * The message * * Side effects: * None * *---------------------------------------------------------------------- */ const char * FileIO_ErrorEnglish(FileIOResult status) // IN { return Msg_StripMSGID(FileIO_MsgError(status)); } /* *---------------------------------------------------------------------- * * FileIO_MsgError -- * * Return the message associated with a status code * * Results: * The message. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * FileIO_MsgError(FileIOResult status) // IN { const char *result = NULL; switch (status) { case FILEIO_SUCCESS: /* * Most of the time, you don't call this function with this value * because there is no error */ result = MSGID(fileio.success) "Success"; break; case FILEIO_CANCELLED: /* * Most of the time, you don't call this function with this value * because you don't want to display error messages after a user has * cancelled an operation. */ result = MSGID(fileio.cancel) "The operation was cancelled by the user"; break; case FILEIO_ERROR: /* * Most of the time, you don't call this function with this value * because you can call your native function to retrieve a more * accurate message. */ result = MSGID(fileio.generic) "Error"; break; case FILEIO_OPEN_ERROR_EXIST: result = MSGID(fileio.exists) "The file already exists"; break; case FILEIO_LOCK_FAILED: result = MSGID(fileio.lock) "Failed to lock the file"; break; case FILEIO_READ_ERROR_EOF: result = MSGID(fileio.eof) "Tried to read beyond the end of the file"; break; case FILEIO_FILE_NOT_FOUND: result = MSGID(fileio.notfound) "Could not find the file"; break; case FILEIO_NO_PERMISSION: result = MSGID(fileio.noPerm) "Insufficient permission to access the file"; break; case FILEIO_FILE_NAME_TOO_LONG: result = MSGID(fileio.namelong) "The file name is too long"; break; case FILEIO_WRITE_ERROR_FBIG: result = MSGID(fileio.fBig) "The file is too large"; break; case FILEIO_WRITE_ERROR_NOSPC: result = MSGID(fileio.noSpc) "There is no space left on the device"; break; case FILEIO_WRITE_ERROR_DQUOT: result = MSGID(fileio.dQuot) "There is no space left on the device"; break; case FILEIO_ERROR_LAST: NOT_IMPLEMENTED(); break; /* * We do not provide a default case on purpose, so that the compiler can * detect changes in the error set and reminds us to implement the * associated messages --hpreg */ } if (!result) { Warning("%s: bad code %d\n", __FUNCTION__, status); ASSERT(0); result = MSGID(fileio.unknown) "Unknown error"; } return result; } /* *---------------------------------------------------------------------- * * FileIO_Init -- * * Initialize invalid FileIODescriptor. Expects that caller * prepared structure with FileIO_Invalidate. * * Results: * None. * * Side effects: * None * *---------------------------------------------------------------------- */ void FileIO_Init(FileIODescriptor *fd, // IN/OUT: const char *pathName) // IN: { ASSERT(fd); ASSERT(pathName); fd->fileName = Unicode_Duplicate(pathName); } /* *---------------------------------------------------------------------- * * FileIO_Cleanup -- * * Undo resource allocation done by FileIO_Init. You do not want to * call this function directly, you most probably want FileIO_Close. * * Results: * None. * * Side effects: * None * *---------------------------------------------------------------------- */ void FileIO_Cleanup(FileIODescriptor *fd) // IN/OUT: { ASSERT(fd); if (fd->fileName) { free(fd->fileName); fd->fileName = NULL; } } /* *---------------------------------------------------------------------- * * FileIOResolveLockBits -- * * Resolve the multitude of lock bits from historical public names * to newer internal names. * * Input flags: FILEIO_OPEN_LOCKED a.k.a. FILEIO_OPEN_LOCK_BEST, * FILEIO_OPEN_EXCLUSIVE_LOCK * Output flags: FILEIO_OPEN_LOCK_MANDATORY, FILEIO_OPEN_LOCK_ADVISORY * * Results: * None * * Side effects: * Only output flags are set in *access. * *---------------------------------------------------------------------- */ void FileIOResolveLockBits(int *access) // IN/OUT: FILEIO_OPEN_* bits { /* * Lock types: * none: no locking at all * advisory: open() ignores lock, FileIO_ respects lock. * mandatory: open() and FileIO_ respect lock. * "best": downgrades to advisory or mandatory based on OS support */ if ((*access & FILEIO_OPEN_EXCLUSIVE_LOCK) != 0) { *access &= ~FILEIO_OPEN_EXCLUSIVE_LOCK; *access |= FILEIO_OPEN_LOCK_MANDATORY; } if ((*access & FILEIO_OPEN_LOCK_BEST) != 0) { /* "Best effort" bit: mandatory if OS supports, advisory otherwise */ *access &= ~FILEIO_OPEN_LOCK_BEST; if (HostType_OSIsVMK()) { *access |= FILEIO_OPEN_LOCK_MANDATORY; } else { *access |= FILEIO_OPEN_LOCK_ADVISORY; } } /* Only one lock type (or none at all) allowed */ ASSERT(((*access & FILEIO_OPEN_LOCK_ADVISORY) == 0) || ((*access & FILEIO_OPEN_LOCK_MANDATORY) == 0)); } /* *---------------------------------------------------------------------- * * FileIO_Lock -- * * Call the FileLock module to lock the given file. * * Results: * FILEIO_ERROR A serious error occured. * FILEIO_SUCCESS All is well * FILEIO_LOCK_FAILED Requested lock on file was not acquired * FILEIO_FILE_NOT_FOUND Unable to find the specified file * FILEIO_NO_PERMISSION Permissions issues * FILEIO_FILE_NAME_TOO_LONG The path name is too long * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Lock(FileIODescriptor *file, // IN/OUT: int access) // IN: { FileIOResult ret = FILEIO_SUCCESS; /* * Lock the file if necessary. */ ASSERT(file); ASSERT(file->lockToken == NULL); FileIOResolveLockBits(&access); ASSERT((access & FILEIO_OPEN_LOCKED) == 0); #if !defined(__FreeBSD__) && !defined(sun) if ((access & FILEIO_OPEN_LOCK_MANDATORY) != 0) { /* Mandatory file locks are available only when opening a file */ ret = FILEIO_LOCK_FAILED; } else if ((access & FILEIO_OPEN_LOCK_ADVISORY) != 0) { int err = 0; file->lockToken = FileLock_Lock(file->fileName, (access & FILEIO_OPEN_ACCESS_WRITE) == 0, FILELOCK_DEFAULT_WAIT, &err, NULL); if (file->lockToken == NULL) { /* Describe the lock not acquired situation in detail */ Warning(LGPFX" %s on '%s' failed: %s\n", __FUNCTION__, file->fileName, (err == 0) ? "Lock timed out" : strerror(err)); /* Return a serious failure status if the locking code did */ switch (err) { case 0: // File is currently locked case EROFS: // Attempt to lock for write on RO FS ret = FILEIO_LOCK_FAILED; break; case ENAMETOOLONG: // Path is too long ret = FILEIO_FILE_NAME_TOO_LONG; break; case ENOENT: // No such file or directory ret = FILEIO_FILE_NOT_FOUND; break; case EACCES: // Permissions issues ret = FILEIO_NO_PERMISSION; break; default: // Some sort of locking error ret = FILEIO_ERROR; } } } #endif // !__FreeBSD__ && !sun return ret; } /* *---------------------------------------------------------------------- * * FileIO_UnLock -- * * Call the FileLock module to unlock the given file. * * Results: * FILEIO_SUCCESS All is well * FILEIO_ERROR A serious error occured. * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Unlock(FileIODescriptor *file) // IN/OUT: { FileIOResult ret = FILEIO_SUCCESS; ASSERT(file); #if !defined(__FreeBSD__) && !defined(sun) if (file->lockToken != NULL) { int err = 0; if (!FileLock_Unlock(file->lockToken, &err, NULL)) { Warning(LGPFX" %s on '%s' failed: %s\n", __FUNCTION__, file->fileName, strerror(err)); ret = FILEIO_ERROR; } file->lockToken = NULL; } #else ASSERT(file->lockToken == NULL); #endif // !__FreeBSD__ && !sun return ret; } /* *---------------------------------------------------------------------- * * FileIO_GetSize -- * * Get size of file. * * Results: * Size of file or -1. * * Side effects: * errno is set on error. * *---------------------------------------------------------------------- */ int64 FileIO_GetSize(const FileIODescriptor *fd) // IN: { int64 logicalBytes; return (FileIO_GetAllocSize(fd, &logicalBytes, NULL) != FILEIO_SUCCESS) ? -1 : logicalBytes; } /* *---------------------------------------------------------------------- * * FileIO_GetSizeByPath -- * * Get size of a file specified by path. * * Results: * Size of file or -1. * * Side effects: * errno is set on error * *---------------------------------------------------------------------- */ int64 FileIO_GetSizeByPath(const char *pathName) // IN: { int64 logicalBytes; return (FileIO_GetAllocSizeByPath(pathName, &logicalBytes, NULL) != FILEIO_SUCCESS) ? -1 : logicalBytes; } /* *---------------------------------------------------------------------- * * FileIO_Filename -- * * Returns the filename that was used to open a FileIODescriptor * * Results: * Filename. You DON'T own the memory - use Unicode_Duplicate if * you want to keep it for yourself. In particular, if the file * gets closed the string will almost certainly become invalid. * * Side effects: * None. * *---------------------------------------------------------------------- */ const char * FileIO_Filename(FileIODescriptor *fd) // IN: { ASSERT(fd); return fd->fileName; } /* *---------------------------------------------------------------------- * * FileIO_CloseAndUnlink * * Closes and unlinks the file associated with a FileIODescriptor. * * Results: * FILEIO_SUCCESS: The file was closed and unlinked. The FileIODescriptor * is no longer valid. * FILEIO_ERROR: An error occurred. * * Side effects: * File is probably closed and unlinked. * *---------------------------------------------------------------------- */ FileIOResult FileIO_CloseAndUnlink(FileIODescriptor *fd) // IN: { char *path; FileIOResult ret; ASSERT(fd); ASSERT(FileIO_IsValid(fd)); path = Unicode_Duplicate(fd->fileName); ret = FileIO_Close(fd); if (FileIO_IsSuccess(ret)) { if (File_UnlinkIfExists(path) == -1) { ret = FILEIO_ERROR; } } free(path); return ret; } #if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) || \ defined(__FreeBSD__) || defined(sun) /* *---------------------------------------------------------------------- * * FileIO_Pread -- * * Reads from a file starting at a specified offset. * * Note: This function may update the file pointer so you will need to * call FileIO_Seek before calling FileIO_Read/Write afterwards. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Pread(FileIODescriptor *fd, // IN: File descriptor void *buf, // IN: Buffer to read into size_t len, // IN: Length of the buffer uint64 offset) // IN: Offset to start reading { struct iovec iov; ASSERT(fd); iov.iov_base = buf; iov.iov_len = len; return FileIO_Preadv(fd, &iov, 1, offset, len, NULL); } /* *---------------------------------------------------------------------- * * FileIO_Pwrite -- * * Writes to a file starting at a specified offset. * * Note: This function may update the file pointer so you will need to * call FileIO_Seek before calling FileIO_Read/Write afterwards. * * Results: * FILEIO_SUCCESS, FILEIO_ERROR * * Side effects: * None * *---------------------------------------------------------------------- */ FileIOResult FileIO_Pwrite(FileIODescriptor *fd, // IN: File descriptor void const *buf, // IN: Buffer to write from size_t len, // IN: Length of the buffer uint64 offset) // IN: Offset to start writing { struct iovec iov; ASSERT(fd); /* The cast is safe because FileIO_Pwritev() will not write to '*buf'. */ iov.iov_base = (void *)buf; iov.iov_len = len; return FileIO_Pwritev(fd, &iov, 1, offset, len, NULL); } #endif #if defined(sun) && __GNUC__ < 3 /* *----------------------------------------------------------------------------- * * FileIO_IsSuccess -- * * XXX: See comment in fileIO.h. For reasonable compilers, this * function is implemented as "static inline" in fileIO.h; for * unreasonable compilers, it can't be static so we implement it here. * * Results: * TRUE if the input indicates success. * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool FileIO_IsSuccess(FileIOResult res) // IN: { return res == FILEIO_SUCCESS; } #endif /* *----------------------------------------------------------------------------- * * FileIO_AtomicTempPath * * Return a temp path name in the same directory as the argument path. * The path is the full path of the source file with a '~' appended. * The caller must free the path when done. * * Results: * UTF8 path if successful, NULL on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ char * FileIO_AtomicTempPath(const char *path) // IN: { char *srcPath; char *retPath; srcPath = File_FullPath(path); if (!srcPath) { Log("%s: File_FullPath of '%s' failed.\n", __FUNCTION__, path); return NULL; } retPath = Unicode_Join(srcPath, "~", NULL); free(srcPath); return retPath; } /* *----------------------------------------------------------------------------- * * FileIO_AtomicTempFile * * Create a temp file in the same directory as the argument file. * On non-Windows attempts to create the temp file with the same * permissions and owner/group as the argument file. * * Results: * FileIOResult of call that failed or FILEIO_SUCCESS * * Side effects: * Creates a new file. * *----------------------------------------------------------------------------- */ FileIOResult FileIO_AtomicTempFile(FileIODescriptor *fileFD, // IN: FileIODescriptor *tempFD) // OUT: { char *tempPath = NULL; int permissions; FileIOResult status; #if !defined(_WIN32) int ret; struct stat stbuf; #endif ASSERT(FileIO_IsValid(fileFD)); ASSERT(tempFD && !FileIO_IsValid(tempFD)); tempPath = FileIO_AtomicTempPath(FileIO_Filename(fileFD)); if (!tempPath) { status = FILEIO_ERROR; goto bail; } #if defined(_WIN32) permissions = 0; File_UnlinkIfExists(tempPath); #else if (fstat(fileFD->posix, &stbuf)) { Log("%s: Failed to fstat '%s', errno: %d.\n", __FUNCTION__, FileIO_Filename(fileFD), errno); status = FILEIO_ERROR; goto bail; } permissions = stbuf.st_mode; /* Clean up a previously created temp file; if one exists. */ ret = Posix_Unlink(tempPath); if (ret != 0 && errno != ENOENT) { Log("%s: Failed to unlink temporary file, errno: %d\n", __FUNCTION__, errno); /* Fall through; FileIO_Create will report the actual error. */ } #endif status = FileIO_Create(tempFD, tempPath, FILEIO_ACCESS_READ | FILEIO_ACCESS_WRITE, FILEIO_OPEN_CREATE_SAFE, permissions); if (!FileIO_IsSuccess(status)) { Log("%s: Failed to create temporary file, %s (%d). errno: %d\n", __FUNCTION__, FileIO_ErrorEnglish(status), status, Err_Errno()); goto bail; } #if !defined(_WIN32) /* * On ESX we always use the vmkernel atomic file swap primitive, so * there's no need to set the permissions and owner of the temp file. * * XXX this comment is not true for NFS on ESX -- we use rename rather * than "vmkernel atomic file swap primitive" -- but we do not care * because files are always owned by root. Sigh. Bug 839283. */ if (!HostType_OSIsVMK()) { if (fchmod(tempFD->posix, stbuf.st_mode)) { Log("%s: Failed to chmod temporary file, errno: %d\n", __FUNCTION__, errno); status = FILEIO_ERROR; goto bail; } if (fchown(tempFD->posix, stbuf.st_uid, stbuf.st_gid)) { Log("%s: Failed to chown temporary file, errno: %d\n", __FUNCTION__, errno); status = FILEIO_ERROR; goto bail; } } #endif free(tempPath); return FILEIO_SUCCESS; bail: ASSERT(!FileIO_IsSuccess(status)); if (FileIO_IsValid(tempFD)) { FileIO_Close(tempFD); #if defined(_WIN32) File_UnlinkIfExists(tempPath); #else ret = Posix_Unlink(tempPath); if (ret != 0) { Log("%s: Failed to clean up temporary file, errno: %d\n", __FUNCTION__, errno); } ASSERT(ret == 0); #endif } free(tempPath); return status; } /* *----------------------------------------------------------------------------- * * FileIO_AtomicUpdate -- * * On ESX when the target files reside on vmfs, exchanges the contents * of two files using code modeled from VmkfsLib_SwapFiles. Both "curr" * and "new" are left open. * * On hosted products, uses rename to swap files, so "new" becomes "curr", * and path to "new" no longer exists on success. * * On success the caller must call FileIO_IsValid on newFD to verify it * is still open before using it again. * * Results: * TRUE if successful, FALSE otherwise * errno is preserved. * * Side effects: * Disk I/O. * *----------------------------------------------------------------------------- */ Bool FileIO_AtomicUpdate(FileIODescriptor *newFD, // IN/OUT: file IO descriptor FileIODescriptor *currFD) // IN/OUT: file IO descriptor { char *currPath = NULL; char *newPath = NULL; #if defined(_WIN32) uint32 currAccess; uint32 newAccess; FileIOResult status; FileIODescriptor tmpFD; #else int fd; #endif int savedErrno = 0; Bool ret = FALSE; ASSERT(FileIO_IsValid(newFD)); ASSERT(FileIO_IsValid(currFD)); if (HostType_OSIsVMK()) { #if defined(VMX86_SERVER) FS_SwapFilesArgs *args = NULL; char *dirName = NULL; char *fileName = NULL; char *dstDirName = NULL; char *dstFileName = NULL; currPath = File_FullPath(FileIO_Filename(currFD)); if (!currPath) { savedErrno = errno; Log("%s: File_FullPath of '%s' failed.\n", __FUNCTION__, FileIO_Filename(currFD)); goto swapdone; } newPath = File_FullPath(FileIO_Filename(newFD)); if (!newPath) { savedErrno = errno; Log("%s: File_FullPath of '%s' failed.\n", __FUNCTION__, FileIO_Filename(newFD)); goto swapdone; } File_GetPathName(newPath, &dirName, &fileName); File_GetPathName(currPath, &dstDirName, &dstFileName); ASSERT(dirName); ASSERT(fileName && *fileName); ASSERT(dstDirName); ASSERT(dstFileName && *dstFileName); ASSERT(File_IsSameFile(dirName, dstDirName)); args = Util_SafeCalloc(1, sizeof *args); if (Str_Snprintf(args->srcFile, sizeof args->srcFile, "%s", fileName) < 0) { Log("%s: Path too long \"%s\".\n", __FUNCTION__, fileName); savedErrno = ENAMETOOLONG; goto swapdone; } if (Str_Snprintf(args->dstFilePath, sizeof args->dstFilePath, "%s/%s", dstDirName, dstFileName) < 0) { Log("%s: Path too long \"%s\".\n", __FUNCTION__, dstFileName); savedErrno = ENAMETOOLONG; goto swapdone; } /* * Issue the ioctl on the directory rather than on the file, * because the file could be open. */ if (!*dirName) { /* need a proper root directory string for Posix_Open() */ free(dirName); dirName = Util_SafeStrdup("/"); } fd = Posix_Open(dirName, O_RDONLY); if (fd < 0) { Log("%s: Open failed \"%s\" %d.\n", __FUNCTION__, dirName, errno); ASSERT(errno != EBUSY); /* #615124. */ savedErrno = errno; goto swapdone; } if (ioctl(fd, IOCTLCMD_VMFS_SWAP_FILES, args) != 0) { savedErrno = errno; if (errno != ENOSYS && errno != ENOTTY) { Log("%s: ioctl failed %d.\n", __FUNCTION__, errno); ASSERT(errno != EBUSY); /* #615124. */ } } else { ret = TRUE; } close(fd); /* * Did we fail because we are on a file system that does not * support the IOCTLCMD_VMFS_SWAP_FILES ioctl? If so fallback to * using rename. * * Check for both ENOSYS and ENOTTY. PR 957695 */ if (savedErrno == ENOSYS || savedErrno == ENOTTY) { /* * NFS allows renames of locked files, even if both files * are locked. The file lock follows the file handle, not * the name, so after the rename we can swap the underlying * file descriptors instead of closing and reopening the * target file. * * This is different than the hosted path below because * ESX uses native file locks and hosted does not. * * We assume that all ESX file systems that support rename * have the same file lock semantics as NFS. */ if (File_Rename(newPath, currPath)) { Log("%s: rename of '%s' to '%s' failed %d.\n", __FUNCTION__, newPath, currPath, errno); savedErrno = errno; goto swapdone; } ret = TRUE; fd = newFD->posix; newFD->posix = currFD->posix; currFD->posix = fd; FileIO_Close(newFD); } swapdone: free(args); free(dirName); free(fileName); free(dstDirName); free(dstFileName); free(currPath); free(newPath); errno = savedErrno; return ret; #else NOT_REACHED(); #endif } #if defined(_WIN32) currPath = Unicode_Duplicate(FileIO_Filename(currFD)); newPath = Unicode_Duplicate(FileIO_Filename(newFD)); newAccess = newFD->flags; currAccess = currFD->flags; FileIO_Close(newFD); /* * The current file needs to be closed and reopened, * but we don't want to drop the file lock by calling * FileIO_Close() on it. Instead, use native close primitives. * We'll reopen it later with FileIO_Open. Set the * descriptor/handle to an invalid value while we're in the * middle of transferring ownership. */ CloseHandle(currFD->win32); currFD->win32 = INVALID_HANDLE_VALUE; if (File_RenameRetry(newPath, currPath, 10) == 0) { ret = TRUE; } else { savedErrno = errno; ASSERT(!ret); } FileIO_Invalidate(&tmpFD); /* * Clear the locking bits from the requested access so that reopening * the file ignores the advisory lock. */ ASSERT((currAccess & FILEIO_OPEN_LOCK_MANDATORY) == 0); currAccess &= ~(FILEIO_OPEN_LOCK_MANDATORY | FILEIO_OPEN_LOCK_ADVISORY | FILEIO_OPEN_LOCK_BEST | FILEIO_OPEN_LOCKED); status = FileIO_Open(&tmpFD, currPath, currAccess, FILEIO_OPEN); if (!FileIO_IsSuccess(status)) { Panic("Failed to reopen dictionary after renaming " "\"%s\" to \"%s\": %s (%d)\n", newPath, currPath, FileIO_ErrorEnglish(status), status); } ASSERT(tmpFD.lockToken == NULL); currFD->win32 = tmpFD.win32; FileIO_Cleanup(&tmpFD); free(currPath); free(newPath); errno = savedErrno; return ret; #else currPath = (char *)FileIO_Filename(currFD); newPath = (char *)FileIO_Filename(newFD); if (File_Rename(newPath, currPath)) { Log("%s: rename of '%s' to '%s' failed %d.\n", __FUNCTION__, newPath, currPath, errno); savedErrno = errno; } else { ret = TRUE; fd = newFD->posix; newFD->posix = currFD->posix; currFD->posix = fd; FileIO_Close(newFD); } errno = savedErrno; return ret; #endif } open-vm-tools-10.0.7-3227872/lib/file/fileLockPosix.c0000644000000000000000000007234212660700525020267 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileLockPosix.c -- * * Interface to host-specific locking function for Posix hosts. */ #include #include #include #include /* Needed before sys/vfs.h with glibc 2.0 --hpreg */ #if !defined(__FreeBSD__) #if defined(__APPLE__) #include #include #include #include #else #include #endif #endif #include #include #include #include #include #include #include "vmware.h" #include "posix.h" #include "file.h" #include "fileIO.h" #include "fileLock.h" #include "fileInt.h" #include "util.h" #include "str.h" #include "err.h" #include "localconfig.h" #include "hostinfo.h" #include "su.h" #include "hostType.h" #include "unicodeOperations.h" #define LOGLEVEL_MODULE main #include "loglevel_user.h" #define DEVICE_LOCK_DIR "/var/lock" #define LOG_MAX_PROC_NAME 64 /* * XXX * Most of these warnings must be turned back into Msg_Appends, or the * equivalent. They were changed from Msg_Appends to Warnings to facilitate * integration in the disklib library, but many of the warnings are very * important, and should be presented directly to the user, not go silently * into the log file. */ #if !defined(__FreeBSD__) && !defined(sun) /* *---------------------------------------------------------------------- * * IsLinkingAvailable -- * * Check if linking is supported in the filesystem where we create * the lock file. * * Results: * TRUE is we're sure it's supported. FALSE otherwise. * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool IsLinkingAvailable(const char *fileName) // IN: { struct statfs buf; int status; ASSERT(fileName); /* * Don't use linking on ESX/VMFS... the overheads are expensive and this * path really isn't used. */ if (HostType_OSIsVMK()) { return FALSE; } status = statfs(fileName, &buf); if (status == -1) { Log(LGPFX" Bad statfs using %s (%s).\n", fileName, Err_Errno2String(errno)); return FALSE; } #if defined(__APPLE__) if ((Str_Strcasecmp(buf.f_fstypename, "hfs") == 0) || (Str_Strcasecmp(buf.f_fstypename, "nfs") == 0) || (Str_Strcasecmp(buf.f_fstypename, "ufs") == 0)) { return TRUE; } if ((Str_Strcasecmp(buf.f_fstypename, "smbfs") != 0) && (Str_Strcasecmp(buf.f_fstypename, "afpfs") != 0)) { Log(LGPFX" Unknown filesystem '%s'. Using non-linking file locking.\n", buf.f_fstypename); } #else /* consult "table" of known filesystem types */ switch (buf.f_type) { case AFFS_SUPER_MAGIC: case EXT_SUPER_MAGIC: case EXT2_OLD_SUPER_MAGIC: case EXT2_SUPER_MAGIC: // EXT3_SUPER_MAGIC is EXT2_SUPER_MAGIC case HFSPLUS_SUPER_MAGIC: case NFS_SUPER_MAGIC: case XENIX_SUPER_MAGIC: case SYSV4_SUPER_MAGIC: case SYSV2_SUPER_MAGIC: case COH_SUPER_MAGIC: case UFS_SUPER_MAGIC: case REISERFS_SUPER_MAGIC: case XFS_SUPER_MAGIC: case TMPFS_SUPER_MAGIC: case JFS_SUPER_MAGIC: return TRUE; // these are known to work case SMB_SUPER_MAGIC: case MSDOS_SUPER_MAGIC: return FALSE; } /* * Nothing is known about this filesystem. Play it safe and use * non-link based locking. */ Warning(LGPFX" Unknown filesystem 0x%x. Using non-linking locking.\n", (unsigned int) buf.f_type); #endif return FALSE; } /* *---------------------------------------------------------------------- * * RemoveStaleLockFile -- * * Remove a stale lock file. * * Results: * TRUE on success. * * Side effects: * Unlink file. * *---------------------------------------------------------------------- */ static Bool RemoveStaleLockFile(const char *lockFileName) // IN: { uid_t uid; int ret; int saveErrno; ASSERT(lockFileName); /* stale lock */ Log(LGPFX" Found a previous instance of lock file '%s'. " "It will be removed automatically.\n", lockFileName); uid = Id_BeginSuperUser(); ret = unlink(lockFileName); saveErrno = errno; Id_EndSuperUser(uid); if (ret < 0) { Warning(LGPFX" Failed to remove stale lock file %s (%s).\n", lockFileName, Err_Errno2String(saveErrno)); return FALSE; } return TRUE; } /* *---------------------------------------------------------------------- * * GetLockFileValues -- * * Get host name and PID of locking process. * * Results: * 1 on success, 0 if file doesn't exist, -1 for all other errors. * * Side effects: * None. * *---------------------------------------------------------------------- */ static int GetLockFileValues(const char *lockFileName, // IN: int *pid, // OUT: char *hostID) // OUT: { char *p; int saveErrno; FILE *lockFile; char line[1000]; Bool deleteLockFile; uid_t uid; int status; ASSERT(lockFileName); ASSERT(pid); ASSERT(hostID); uid = Id_BeginSuperUser(); lockFile = Posix_Fopen(lockFileName, "r"); saveErrno = errno; Id_EndSuperUser(uid); if (lockFile == NULL) { Warning(LGPFX" Failed to open existing lock file %s (%s).\n", lockFileName, Err_Errno2String(saveErrno)); return (saveErrno == ENOENT) ? 0 : -1; } p = fgets(line, sizeof line, lockFile); saveErrno = errno; fclose(lockFile); if (p == NULL) { Warning(LGPFX" Failed to read line from lock file %s (%s).\n", lockFileName, Err_Errno2String(saveErrno)); deleteLockFile = TRUE; } else { switch (sscanf(line, "%d %999s", pid, hostID)) { case 2: // Everything is OK deleteLockFile = FALSE; break; case 1: default: Warning(LGPFX" Badly formatted lock file %s.\n", lockFileName); deleteLockFile = TRUE; } } status = 1; if (deleteLockFile) { status = 0; // we're going to delete the file if (!RemoveStaleLockFile(lockFileName)) { status = -1; } } return status; } /* *---------------------------------------------------------------------- * * FileLockIsValidProcess -- * * Determine if the process, via its pid, is valid (alive). * * Results: * TRUE Yes * FALSE No * * Side effects: * None. * *---------------------------------------------------------------------- */ static Bool FileLockIsValidProcess(int pid) // IN: { HostinfoProcessQuery value = Hostinfo_QueryProcessExistence(pid); if (value == HOSTINFO_PROCESS_QUERY_UNKNOWN) { return TRUE; // Err on the side of caution } return (value == HOSTINFO_PROCESS_QUERY_ALIVE) ? TRUE : FALSE; } /* *---------------------------------------------------------------------- * * FileLockCreateLockFile -- * * Create a new lock file, either via a O_EXCL creat() call or * through the linking method. * * Results: * 1 if we created our lock file successfully. * 0 if we should retry the creation. * -1 if the process failed. * * Side effects: * Change the host file system. * *---------------------------------------------------------------------- */ static int FileLockCreateLockFile(const char *lockFileName, // IN: const char *lockFileLink, // IN: const char *uniqueID) // IN: { int err; int lockFD; int status = 1; int saveErrno; Bool useLinking = IsLinkingAvailable(lockFileName); uid_t uid; if (useLinking) { uid = Id_BeginSuperUser(); lockFD = creat(lockFileLink, 0444); saveErrno = errno; Id_EndSuperUser(uid); if (lockFD == -1) { Log(LGPFX" Failed to create new lock file %s (%s).\n", lockFileLink, Err_Errno2String(saveErrno)); return (saveErrno == EEXIST) ? 0 : -1; } } else { /* * XXX * Note that this option is racy, at least for SMB and FAT32 file * systems. It appears, however, that by using a temporary lock * file before getting the real, persistent lock file, the race * can be eliminated. -- johnh */ uid = Id_BeginSuperUser(); lockFD = Posix_Open(lockFileName, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); saveErrno = errno; Id_EndSuperUser(uid); if (lockFD == -1) { Log(LGPFX" Failed to create new lock file %s (%s).\n", lockFileName, Err_Errno2String(saveErrno)); return (saveErrno == EEXIST) ? 0 : -1; } } err = write(lockFD, uniqueID, strlen(uniqueID)); saveErrno = errno; close(lockFD); if (err != strlen(uniqueID)) { Warning(LGPFX" Failed to write to new lock file %s (%s).\n", lockFileName, Err_Errno2String(saveErrno)); status = -1; goto exit; } uid = Id_BeginSuperUser(); if (useLinking && (link(lockFileLink, lockFileName) < 0)) { status = (errno == EEXIST) ? 0 : -1; } Id_EndSuperUser(uid); exit: if (useLinking) { uid = Id_BeginSuperUser(); err = unlink(lockFileLink); Id_EndSuperUser(uid); if (err < 0) { Warning(LGPFX" Failed to remove temporary lock file %s (%s).\n", lockFileLink, Err_Errno2String(errno)); } } return status; } /* *---------------------------------------------------------------------- * * FileLock_LockDevice -- * * Lock with a file. Detect and remove stale locks * when possible. * * Results: * 1 if got the lock, 0 if not, -1 for errors. * * Side effects: * Change the host file system. * * Note: * This locking method remains due to "minicom" and similar * programs that use this locking method for access serialization * of serial ports. * *---------------------------------------------------------------------- */ int FileLock_LockDevice(const char *deviceName) // IN: { const char *hostID; char uniqueID[1000]; char *lockFileName; char *lockFileLink; int status = -1; ASSERT(deviceName); lockFileName = Str_SafeAsprintf(NULL, "%s/LCK..%s", DEVICE_LOCK_DIR, deviceName); lockFileLink = Str_SafeAsprintf(NULL, "%s/LTMP..%s.t%05d", DEVICE_LOCK_DIR, deviceName, getpid()); LOG(1, ("Requesting lock %s (temp = %s).\n", lockFileName, lockFileLink)); hostID = FileLockGetMachineID(); Str_Sprintf(uniqueID, sizeof uniqueID, "%d %s\n", getpid(), hostID); while ((status = FileLockCreateLockFile(lockFileName, lockFileLink, uniqueID)) == 0) { int pid; char fileID[1000]; /* * The lock file already exists. See if it is a stale lock. * * We retry the link if the file is gone now (0 return). */ switch (GetLockFileValues(lockFileName, &pid, fileID)) { case 1: break; case 0: continue; case -1: status = -1; goto exit; default: NOT_REACHED(); } if (strcmp(hostID, fileID) != 0) { /* Lock was acquired by a different host. */ status = 0; goto exit; } if (FileLockIsValidProcess(pid)) { status = 0; goto exit; } /* stale lock */ if (!RemoveStaleLockFile(lockFileName)) { status = -1; goto exit; } /* TRY AGAIN */ } exit: free(lockFileName); free(lockFileLink); return status; } /* *---------------------------------------------------------------------- * * FileLock_UnlockDevice -- * * Unlock a lock obtained by FileLock_LockDevice. * * Results: * True if successful, FALSE otherwise. * * Side effects: * Change the host file system. * *---------------------------------------------------------------------- */ Bool FileLock_UnlockDevice(const char *deviceName) // IN: { uid_t uid; int ret; int saveErrno; char *path; ASSERT(deviceName); path = Str_SafeAsprintf(NULL, "%s/LCK..%s", DEVICE_LOCK_DIR, deviceName); LOG(1, ("Releasing lock %s.\n", path)); uid = Id_BeginSuperUser(); ret = unlink(path); saveErrno = errno; Id_EndSuperUser(uid); if (ret < 0) { Log(LGPFX" Cannot remove lock file %s (%s).\n", path, Err_Errno2String(saveErrno)); free(path); return FALSE; } free(path); return TRUE; } /* *---------------------------------------------------------------------- * * FileLockAppendMessage -- * * Append a detailed error message to the MsgList. * * Results: * As above * * Side effects: * Memory is allocated * *---------------------------------------------------------------------- */ void FileLockAppendMessage(MsgList **msgs, // IN/OUT/OPT: int err) // IN: errno { MsgList_Append(msgs, MSGID(fileLock.posix) "A file locking error (%d) has occurred: %s.", err, Err_Errno2String(err)); } #if defined(linux) /* *---------------------------------------------------------------------- * * FileReadSlashProc -- * * Read the data in a /proc file * * Results: * 0 Data is available * !0 Error (errno) * * Side effects: * None. * *---------------------------------------------------------------------- */ static int FileReadSlashProc(const char *procPath, // IN: char *buffer, // OUT: size_t bufferSize) // IN: { int fd; int err; char *p; size_t len; ASSERT(procPath); ASSERT(buffer); ASSERT(bufferSize > 0); fd = Posix_Open(procPath, O_RDONLY, 0); if (fd == -1) { return errno; } len = read(fd, buffer, bufferSize - 1); err = errno; close(fd); if (len == -1) { return err; } buffer[len] = '\0'; p = strchr(buffer, '\n'); if (p != NULL) { *p = '\0'; } return 0; } /* *--------------------------------------------------------------------------- * * FileLockProcessDescriptor -- * * Returns the process descriptor of the specified process. * * The format of a process descriptor is as follows: * * processID-processCreationTime(processName) * * where the processName and processCreationTime information * may be independently optional. * * Results: * NULL The process does not exist. * !NULL The process descriptor is returned. It is the callers * responsibility to free the dynamically allocated memory. * * Side Effects: * None * *--------------------------------------------------------------------------- */ static char * FileLockProcessDescriptor(pid_t pid) // IN: { char path[64]; char buffer[1024]; char *descriptor = NULL; if (!FileLockIsValidProcess(pid)) { return NULL; } Str_Sprintf(path, sizeof path, "/proc/%d/stat", pid); if (FileReadSlashProc(path, buffer, sizeof buffer) == 0) { char *p; char *q; char *rest; uint32 argc; char *argv[22]; char *savePtr = NULL; /* * You are in a maze of twisty little fields, (virtually) all alike... * * The process creation time, in 64-bit jiffies is "out there". * * A "man 5 proc" will provide illumination concerning all of the * fields found on this line of text. We code for the worst case * and ensure that file names containing spaces or parens are * properly handled. */ p = strchr(buffer, '('); if ((p == NULL) || (p == buffer) || (*(p - 1) != ' ')) { goto bail; } *(p - 1) = '\0'; q = strrchr(p + 1, ')'); if (q == NULL) { goto bail; } rest = q + 1; if (*rest != ' ') { goto bail; } *rest++ = '\0'; argv[0] = strtok_r(buffer, " ", &savePtr); // ensure no trailing spaces argv[1] = p; /* Map spaces in the process name to something benign */ q = p; while ((q = strchr(q, ' ')) != NULL) { *q = '_'; } if (strlen(p) > LOG_MAX_PROC_NAME) { p[LOG_MAX_PROC_NAME - 1] = ')'; p[LOG_MAX_PROC_NAME] = '\0'; } for (argc = 2; argc < 22; argc++) { argv[argc] = strtok_r((argc == 2) ? rest : NULL, " ", &savePtr); if (argv[argc] == NULL) { break; } } if (argc == 22) { descriptor = Str_SafeAsprintf(NULL, "%s-%s%s", argv[0], argv[21], argv[1]); } } bail: if (descriptor == NULL) { /* * Accessing /proc failed in some way. Emit a valid string that also * provides a clue that there is/was a problem. */ descriptor = Str_SafeAsprintf(NULL, "%d-0", pid); } return descriptor; } #elif defined(__APPLE__) /* *--------------------------------------------------------------------------- * * FileLockProcessCreationTime -- * * Returns the process creation time of the specified process. * * Results: * TRUE Done! * FALSE Process doesn't exist * * Side effects: * None * *--------------------------------------------------------------------------- */ static Bool FileLockProcessCreationTime(pid_t pid, // IN: uint64 *procCreationTime) // OUT: { int err; size_t size; struct kinfo_proc info; int mib[4]; ASSERT(procCreationTime); /* Request information about the specified process */ mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; mib[3] = pid; memset(&info, 0, sizeof info); size = sizeof info; err = sysctl(mib, ARRAYSIZE(mib), &info, &size, NULL, 0); if (err == -1) { return FALSE; } *procCreationTime = (info.kp_proc.p_starttime.tv_sec * CONST64U(1000000)) + info.kp_proc.p_starttime.tv_usec; return TRUE; } /* *--------------------------------------------------------------------------- * * FileLockProcessDescriptor -- * * Returns the process descriptor of the specified process. * * The format of a process descriptor is as follows: * * processID-processCreationTime(processName) * * where the processName and processCreationTime information * may be independently optional. * * Results: * NULL The process does not exist. * !NULL The process descriptor is returned. It is the callers * responsibility to free the dynamically allocated memory. * * Side effects: * None * *--------------------------------------------------------------------------- */ static char * FileLockProcessDescriptor(pid_t pid) // IN: { uint64 procCreationTime; if (!FileLockIsValidProcess(pid)) { return NULL; } if (!FileLockProcessCreationTime(pid, &procCreationTime)) { return NULL; } return Str_SafeAsprintf(NULL, "%d-%"FMT64"u", pid, procCreationTime); } #else /* *--------------------------------------------------------------------------- * * FileLockProcessDescriptor -- * * Returns the process descriptor of the specified process. * * The format of a process descriptor is as follows: * * processID-processCreationTime(processName) * * where the processName and processCreationTime information * may be independently optional. * * Results: * NULL The process does not exist. * !NULL The process descriptor is returned. It is the callers * responsibility to free the dynamically allocated memory. * * Side effects: * None * *--------------------------------------------------------------------------- */ static char * FileLockProcessDescriptor(pid_t pid) // IN: { return FileLockIsValidProcess(pid) ? Str_SafeAsprintf(NULL, "%d-0", pid) : NULL; } #endif /* *--------------------------------------------------------------------------- * * FileLockGetExecutionID -- * * Returns the executionID of the caller. * * Results: * The executionID of the caller. This is a dynamically allocated string; * the caller is responsible for its disposal. * * Side effects: * The executionID of the caller is not thread safe. Locking is currently * done at the process level - all threads of a process are treated * identically. * *--------------------------------------------------------------------------- */ char * FileLockGetExecutionID(void) { char *descriptor = FileLockProcessDescriptor(getpid()); ASSERT(descriptor); // Must be able to describe ourselves! return descriptor; } /* *--------------------------------------------------------------------------- * * FileLockParseProcessDescriptor -- * * Attempt to parse the specified process descriptor. Return the * pieces requested. * * Results: * TRUE Process descriptor is valid. * FALSE Process descriptor is invalid. * * Side effects: * None * *--------------------------------------------------------------------------- */ static Bool FileLockParseProcessDescriptor(const char *procDescriptor, // IN: pid_t *pid, // OUT: uint64 *procCreationTime) // OUT: { ASSERT(procDescriptor); ASSERT(pid); ASSERT(procCreationTime); if (sscanf(procDescriptor, "%d-%"FMT64"u", pid, procCreationTime) != 2) { if (sscanf(procDescriptor, "%d", pid) == 1) { *procCreationTime = 0ULL; } else { return FALSE; } } return *pid >= 0; } /* *---------------------------------------------------------------------- * * FileLockValidExecutionID -- * * Validate the execution ID. * * Results: * TRUE Yes * FALSE No * * Side effects: * None. * *---------------------------------------------------------------------- */ Bool FileLockValidExecutionID(const char *executionID) // IN: { pid_t filePID; pid_t procPID; Bool gotFileData; Bool gotProcData; char *procDescriptor; uint64 fileCreationTime; uint64 procCreationTime; gotFileData = FileLockParseProcessDescriptor(executionID, &filePID, &fileCreationTime); if (!gotFileData) { Warning(LGPFX" %s parse error on '%s'. Assuming valid.\n", __FUNCTION__, executionID); return TRUE; // Assume TRUE - preserve a lock - on parse error } procDescriptor = FileLockProcessDescriptor(filePID); if (procDescriptor == NULL) { return FALSE; // process doesn't exist } gotProcData = FileLockParseProcessDescriptor(procDescriptor, &procPID, &procCreationTime); ASSERT(gotProcData); // We built it; it had better be good ASSERT(procPID == filePID); // This better match what we started with... free(procDescriptor); if ((fileCreationTime != 0) && (procCreationTime != 0) && (fileCreationTime != procCreationTime)) { return FALSE; // The process no longer exists } else { return TRUE; // Looks valid... } } /* *--------------------------------------------------------------------------- * * FileLockNormalizePath * * Normalize the path of the file being locked. Locking a symbolic * link should place the lock next to the link, not where the link * points to. * * Results: * The normalized path or NULL on error * * Side effects: * None * *--------------------------------------------------------------------------- */ static char * FileLockNormalizePath(const char *filePath) // IN: { char *result; char *fullPath; char *dirName = NULL; char *fileName = NULL; /* * If the file to be locked is a symbolic link the lock file belongs next * to the symbolic link, not "off" where the symbolic link points to. * Translation: Don't "full path" the entire path of the file to be locked; * "full path" the dirName of the path, leaving the fileName alone. */ File_GetPathName(filePath, &dirName, &fileName); fullPath = File_FullPath(dirName); result = (fullPath == NULL) ? NULL : Unicode_Join(fullPath, DIRSEPS, fileName, NULL); free(fullPath); free(dirName); free(fileName); return result; } /* *---------------------------------------------------------------------- * * FileLock_Lock -- * * Obtain a lock on a file; shared or exclusive access. Also specify * how long to wait on lock acquisition - msecMaxWaitTime * * msecMaxWaitTime specifies the maximum amount of time, in * milliseconds, to wait for the lock before returning the "not * acquired" status. A value of FILELOCK_TRYLOCK_WAIT is the * equivalent of a "try lock" - the lock will be acquired only if * there is no contention. A value of FILELOCK_INFINITE_WAIT * specifies "waiting forever" to acquire the lock. * * Results: * NULL Lock not acquired * errno to *err, msg to **msgs - when appropriate * !NULL Lock Acquired. This is the "lockToken" for an unlock. * * Side effects: * Changes the host file system. * *---------------------------------------------------------------------- */ FileLockToken * FileLock_Lock(const char *filePath, // IN: const Bool readOnly, // IN: const uint32 msecMaxWaitTime, // IN: int *err, // OUT/OPT: returns errno MsgList **msgs) // IN/OUT/OPT: add error message { int res = 0; char *normalizedPath; FileLockToken *tokenPtr; ASSERT(filePath); ASSERT(err); normalizedPath = FileLockNormalizePath(filePath); if (normalizedPath == NULL) { res = EINVAL; tokenPtr = NULL; } else { tokenPtr = FileLockIntrinsic(normalizedPath, !readOnly, msecMaxWaitTime, &res); free(normalizedPath); } if (err != NULL) { *err = res; } if (tokenPtr == NULL) { int errnoValue; if (res == 0) { errnoValue = EAGAIN; // Thank you for playing; try again /* Failed to acquire the lock; another has possession of it */ } else { errnoValue = res; } FileLockAppendMessage(msgs, errnoValue); } return tokenPtr; } /* *---------------------------------------------------------------------- * * FileLock_IsLocked -- * * Is a file currently locked (at the time of the call)? * * Results: * TRUE YES * FALSE Failure (errno to *err, msg to **msgs - when appropriate) * *---------------------------------------------------------------------- */ Bool FileLock_IsLocked(const char *filePath, // IN: int *err, // OUT/OPT: returns errno MsgList **msgs) // IN/OUT/OPT: add error message { int res = 0; Bool isLocked; char *normalizedPath; ASSERT(filePath); normalizedPath = FileLockNormalizePath(filePath); if (normalizedPath == NULL) { res = EINVAL; isLocked = FALSE; } else { isLocked = FileLockIsLocked(normalizedPath, &res); free(normalizedPath); } if (err != NULL) { *err = res; } if (res != 0) { FileLockAppendMessage(msgs, res); } return isLocked; } /* *---------------------------------------------------------------------- * * FileLock_Unlock -- * * Release the lock held on the specified file. * * Results: * TRUE Success * FALSE Failure (errno to *err, msg to **msgs - when appropriate) * * Side effects: * Changes the host file system. * *---------------------------------------------------------------------- */ Bool FileLock_Unlock(const FileLockToken *lockToken, // IN: int *err, // OUT/OPT: returns errno MsgList **msgs) // IN/OUT/OPT: error messages { int res; ASSERT(lockToken); res = FileUnlockIntrinsic((FileLockToken *) lockToken); if (err != NULL) { *err = res; } if (res != 0) { FileLockAppendMessage(msgs, res); } return (res == 0); } #else char * FileLockGetExecutionID(void) { NOT_IMPLEMENTED(); } Bool FileLockValidExecutionID(const char *executionID) // IN: { NOT_IMPLEMENTED(); } #endif /* !__FreeBSD__ && !sun */ open-vm-tools-10.0.7-3227872/lib/file/fileLockPrimitive.c0000644000000000000000000015511512660700525021135 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileLockPrimitive.c -- * * Portable file locking via Lamport's Bakery algorithm. * * This implementation does rely upon a remove directory operation to fail * if the directory contains any files. */ #define _GNU_SOURCE /* For O_NOFOLLOW */ #include #include #include #include #include #include #include #if defined(_WIN32) #include #include #include #else #include #include #endif #include "vmware.h" #include "hostinfo.h" #include "util.h" #include "err.h" #include "log.h" #include "str.h" #include "fileIO.h" #include "fileLock.h" #include "fileInt.h" #include "random.h" #include "vm_atomic.h" #include "util.h" #include "hostType.h" #include "unicodeOperations.h" #define LOGLEVEL_MODULE main #include "loglevel_user.h" #define LOCK_SHARED "S" #define LOCK_EXCLUSIVE "X" #define FILELOCK_PROGRESS_DEARTH 8000 // Dearth of progress time in msec #define FILELOCK_PROGRESS_SAMPLE 200 // Progress sampling time in msec static char implicitReadToken; #define PARSE_TABLE_UINT 0 #define PARSE_TABLE_STRING 1 typedef struct parse_table { int type; char *name; void *valuePtr; } ParseTable; /* * The lock token. This is returned by the lock operation and must be sent * to the unlock operation. */ #define FILELOCK_TOKEN_SIGNATURE 0x4B434C46 // 'FLCK' in memory struct FileLockToken { uint32 signature; Bool portable; char *pathName; union { struct { FileIODescriptor lockFd; } mandatory; struct { char *lockFilePath; // &implicitReadToken for implicit read locks } portable; } u; }; /* *----------------------------------------------------------------------------- * * FileLockSleeper -- * * Have the calling thread sleep "for a while". The duration of the * sleep is determined by the count that is passed in. Checks are * also done for exceeding the maximum wait time. * * Results: * 0 slept * EAGAIN maximum sleep time exceeded * * Side effects: * None. * *----------------------------------------------------------------------------- */ static int FileLockSleeper(LockValues *myValues, // IN/OUT: uint32 *loopCount) // IN/OUT: { uint32 msecSleepTime; if ((myValues->msecMaxWaitTime == FILELOCK_TRYLOCK_WAIT) || ((myValues->msecMaxWaitTime != FILELOCK_INFINITE_WAIT) && (myValues->waitTime > myValues->msecMaxWaitTime))) { return EAGAIN; } if (*loopCount <= 20) { /* most locks are "short" */ msecSleepTime = 100; *loopCount += 1; } else if (*loopCount < 40) { /* lock has been around a while, linear back-off */ msecSleepTime = 100 * (*loopCount - 19); *loopCount += 1; } else { /* WOW! long time... Set a maximum */ msecSleepTime = 2000; } myValues->waitTime += msecSleepTime; /* Clamp individual sleeps to avoid Windows issues */ while (msecSleepTime) { uint32 sleepTime = (msecSleepTime > 900) ? 900 : msecSleepTime; msecSleepTime -= FileSleeper(sleepTime, sleepTime); } return 0; } /* *----------------------------------------------------------------------------- * * FileLockRemoveLockingFile -- * * Remove the specified file. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * None. * *----------------------------------------------------------------------------- */ static int FileLockRemoveLockingFile(const char *lockDir, // IN: const char *fileName) // IN: { int err; char *path; ASSERT(lockDir); ASSERT(fileName); path = Unicode_Join(lockDir, DIRSEPS, fileName, NULL); err = FileDeletionRobust(path, FALSE); if (err != 0) { if (err == ENOENT) { /* Not there anymore; locker unlocked or timed out */ err = 0; } else { Warning(LGPFX" %s of '%s' failed: %s\n", __FUNCTION__, path, strerror(err)); } } free(path); return err; } /* *----------------------------------------------------------------------------- * * FileLockParseArgs -- * * Parse the property list arguments of a lock file. The ParseTable * contains names of properies that are interesting to the caller; * only those values associated with the interesting names will be * extracted, the others will be ignored. * * Results: * TRUE An error was detected * FALSE All is well * * Side effects: * None * *----------------------------------------------------------------------------- */ static Bool FileLockParseArgs(char *argv[], // IN: uint32 argCount, // IN: ParseTable *table, // IN: uint32 tableSize) // IN: { uint32 argPos = 5; // The property list always starts with this argument while (argCount) { uint32 i; char *p = strchr(argv[argPos], '='); /* Validate the "name=value" form */ if ((p == NULL) || (p == argv[argPos]) || (p[1] == '\0')) { return TRUE; } *p = '\0'; /* Unknown names are ignored without error */ for (i = 0; i < tableSize; i++) { if (strcmp(argv[argPos], table[i].name) == 0) { switch (table[i].type) { case PARSE_TABLE_UINT: if (sscanf(&p[1], "%u", (uint32 *) table[i].valuePtr) != 1) { return TRUE; } break; case PARSE_TABLE_STRING: *((char **) table[i].valuePtr) = &p[1]; break; } } } *p = '='; argPos++; argCount--; } return FALSE; } /* *----------------------------------------------------------------------------- * * FileLockMemberValues -- * * Returns the values associated with lock directory file. * * Results: * 0 Valid lock file; values have been returned * > 0 Lock file problem (errno); values have not been returned * * Side effects: * The lock file may be deleted if it is invalid * *----------------------------------------------------------------------------- */ #define FL_MAX_ARGS 16 int FileLockMemberValues(const char *lockDir, // IN: const char *fileName, // IN: char *buffer, // OUT: size_t requiredSize, // IN: LockValues *memberValues) // OUT: { size_t len; int access; char *path; FileData fileData; FileIOResult result; FileIODescriptor desc; char *argv[FL_MAX_ARGS]; int err = 0; uint32 argc = 0; char *saveptr = NULL; ParseTable table[] = { { PARSE_TABLE_STRING, "lc", (void *) &memberValues->locationChecksum } }; ASSERT(lockDir); ASSERT(fileName); path = Unicode_Join(lockDir, DIRSEPS, fileName, NULL); FileIO_Invalidate(&desc); access = FILEIO_OPEN_ACCESS_READ; #if defined(_WIN32) access |= FILEIO_OPEN_SHARE_DELETE; #endif result = FileIOCreateRetry(&desc, path, access, FILEIO_OPEN, 0444, FILE_MAX_WAIT_TIME_MS); if (!FileIO_IsSuccess(result)) { err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); /* * A member file may "disappear" if is deleted (unlinked on POSIXen) * due to an unlock immediately after a directory scan but before the * scan is processed. Since this is a "normal" thing, ENOENT will be * suppressed. */ if (err != ENOENT) { Warning(LGPFX" %s open failure on '%s': %s\n", __FUNCTION__, path, strerror(err)); } goto bail; } /* Attempt to obtain the lock file attributes now that it is opened */ err = FileAttributesRobust(path, &fileData); if (err != 0) { /* * A member file may "disappear" if is deleted (unlinked on POSIXen) * due to an unlock immediately after a directory scan but before the * scan is processed. Since this is a "normal" thing, ENOENT will be * suppressed. */ if (err != ENOENT) { Warning(LGPFX" %s file size failure on '%s': %s\n", __FUNCTION__, path, strerror(err)); } FileIO_Close(&desc); goto bail; } /* Complain if the lock file is not the proper size */ if (fileData.fileSize != requiredSize) { Warning(LGPFX" %s file '%s': size %"FMT64"u, required size %"FMTSZ"d\n", __FUNCTION__, path, fileData.fileSize, requiredSize); FileIO_Close(&desc); goto corrupt; } /* Attempt to read the lock file data and validate how much was read. */ result = FileIO_Read(&desc, buffer, requiredSize, &len); FileIO_Close(&desc); if (!FileIO_IsSuccess(result)) { err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); Warning(LGPFX" %s read failure on '%s': %s\n", __FUNCTION__, path, strerror(err)); goto bail; } if (len != requiredSize) { Warning(LGPFX" %s read length issue on '%s': %"FMTSZ"d and %"FMTSZ"d\n", __FUNCTION__, path, len, requiredSize); err = EIO; goto bail; } fixedUp: /* Extract and validate the lock file data. */ for (argc = 0; argc < FL_MAX_ARGS; argc++) { argv[argc] = strtok_r((argc == 0) ? buffer : NULL, " ", &saveptr); if (argv[argc] == NULL) { break; } } /* * Lock file arguments are space separated. There is a minimum of 5 * arguments - machineID, executionID, Lamport number, lock type * and process creation time. The maximum number of arguments is * FL_MAX_ARGS. * * Additional arguments, if present, form a property list - one or more * "name=value" pairs. * * Here is picture of valid forms: * * 0 1 2 3 4 5 6 Comment *------------------------- * A B C D E No property list * A B C D E x One property * A B C D E x y Two properties */ memberValues->locationChecksum = NULL; if ((argc < 5) || ((argc == FL_MAX_ARGS) && (strtok_r(NULL, " ", &saveptr) != NULL))) { goto corrupt; } if ((argc > 5) && FileLockParseArgs(argv, argc - 5, table, ARRAYSIZE(table))) { goto corrupt; } /* * Check for an old style lock file; if found, upgrade it (internally). * * The new style lock always has an executionID that is minimally * processID-processCreationTime (the '-' is the critical difference). */ if ((strchr(argv[1], '-') == NULL) && (strchr(argv[1], '(') == NULL) && (strchr(argv[1], ')') == NULL) && (argc == 6) && !FileLockParseArgs(argv, argc - 5, table, ARRAYSIZE(table))) { char *newBuffer; newBuffer = Str_SafeAsprintf(NULL, "%s %s-%s %s %s %s %s", argv[0], argv[1], argv[4], argv[2], argv[3], argv[4], argv[5]); Str_Strcpy(buffer, newBuffer, requiredSize); free(newBuffer); goto fixedUp; } if (sscanf(argv[2], "%u", &memberValues->lamportNumber) != 1) { goto corrupt; } if ((strcmp(argv[3], LOCK_SHARED) != 0) && (strcmp(argv[3], LOCK_EXCLUSIVE) != 0)) { goto corrupt; } memberValues->machineID = argv[0]; memberValues->executionID = argv[1]; memberValues->lockType = argv[3]; memberValues->memberName = Unicode_Duplicate(fileName); free(path); return 0; corrupt: Warning(LGPFX" %s removing problematic lock file '%s'\n", __FUNCTION__, path); if (argc) { uint32 i; Log(LGPFX" %s '%s' contents are:\n", __FUNCTION__, fileName); for (i = 0; i < argc; i++) { Log(LGPFX" %s %s argv[%u]: '%s'\n", __FUNCTION__, fileName, i, argv[i]); } } /* Remove the lock file and behave like it has disappeared */ err = FileDeletionRobust(path, FALSE); if (err == 0) { err = ENOENT; } bail: free(path); return err; } /* *----------------------------------------------------------------------------- * * FileLockValidName -- * * Validate the format of the file name. * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool FileLockValidName(const char *fileName) // IN: { uint32 i; ASSERT(fileName); /* The fileName must start with the ASCII character, 'M', 'D' or 'E' */ if (Unicode_FindSubstrInRange("MDE", 0, -1, fileName, 0, 1) == UNICODE_INDEX_NOT_FOUND) { return FALSE; } /* The fileName must contain 5 ASCII digits after the initial character */ for (i = 0; i < 5; i++) { if (Unicode_FindSubstrInRange("0123456789", 0, -1, fileName, i + 1, 1) == UNICODE_INDEX_NOT_FOUND) { return FALSE; } } /* The fileName must terminate with the appropriate suffix string */ return Unicode_EndsWith(fileName, FILELOCK_SUFFIX); } /* *----------------------------------------------------------------------------- * * FileLockActivateList * * Insure a lock list entry exists for the lock directory. * * Results: * 0 success * > 0 error (errno) * * Side effects: * None. * *----------------------------------------------------------------------------- */ static int FileLockActivateList(const char *dirName, // IN: LockValues *myValues) // IN: { ActiveLock *ptr; ASSERT(dirName); ASSERT(*dirName == 'D'); /* Search the list for a matching entry */ for (ptr = myValues->lockList; ptr != NULL; ptr = ptr->next) { if (Unicode_Compare(ptr->dirName, dirName) == 0) { break; } } /* No entry? Attempt to add one. */ if (ptr == NULL) { ptr = Util_SafeMalloc(sizeof *ptr); ptr->next = myValues->lockList; myValues->lockList = ptr; ptr->age = 0; ptr->dirName = Unicode_Duplicate(dirName); } /* Mark the entry (exists) */ ptr->marked = TRUE; return 0; } /* *----------------------------------------------------------------------------- * * FileLockLocationChecksum -- * * Compute the location checksum of the argument path. * * Results: * The location checksum as dynamically allocated string. * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * FileLockLocationChecksum(const char *path) // IN: { int c; uint32 hash = 5381; #if defined(_WIN32) char *p; char *value = Unicode_Duplicate(path); /* Don't get fooled by mixed case; "normalize" */ Str_ToLower(value); p = value; #else char *p = (char *) path; #endif /* DBJ2 hash... good enough? */ while ((c = *p++)) { hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ } #if defined(_WIN32) free(value); #endif return Str_SafeAsprintf(NULL, "%u", hash); } /* *----------------------------------------------------------------------------- * * FileLockScanDirectory -- * * Call the specified function for each member file found in the * specified directory. * * Results: * 0 success * > 0 failure * * Side effects: * Anything that this not a valid locking file is deleted. * *----------------------------------------------------------------------------- */ static int FileLockScanDirectory(const char *lockDir, // IN: int (*func)( // IN: const char *lockDir, const char *fileName, LockValues *memberValues, LockValues *myValues ), LockValues *myValues, // IN: Bool cleanUp) // IN: { uint32 i; int err; int numEntries; char **fileList = NULL; char *myExecutionID = NULL; char *locationChecksum = NULL; ASSERT(lockDir); numEntries = FileListDirectoryRobust(lockDir, &fileList); if (numEntries == -1) { Log(LGPFX" %s: Could not read the directory '%s': %d\n", __FUNCTION__, lockDir, Err_Errno()); return EDOM; // out of my domain } /* Pass 1: Validate entries and handle any 'D' entries */ for (i = 0, err = 0; i < numEntries; i++) { /* Remove any non-locking files */ if (!FileLockValidName(fileList[i])) { Log(LGPFX" %s discarding %s from %s'; invalid file name.\n", __FUNCTION__, fileList[i], lockDir); err = FileLockRemoveLockingFile(lockDir, fileList[i]); if (err != 0) { goto bail; } free(fileList[i]); fileList[i] = NULL; continue; } /* * Any lockers appear to be entering? * * This should be rather rare. If a locker dies while entering * this will cleaned-up. */ if (*fileList[i] == 'D') { if (cleanUp) { err = FileLockActivateList(fileList[i], myValues); if (err != 0) { goto bail; } } free(fileList[i]); fileList[i] = NULL; } } if (myValues->lockList != NULL) { goto bail; } myExecutionID = FileLockGetExecutionID(); locationChecksum = FileLockLocationChecksum(lockDir); /* Pass 2: Handle the 'M' entries */ for (i = 0, err = 0; i < numEntries; i++) { LockValues *ptr; Bool myLockFile; LockValues memberValues; char buffer[FILELOCK_DATA_SIZE]; if ((fileList[i] == NULL) || (*fileList[i] == 'E')) { continue; } myLockFile = (Unicode_Compare(fileList[i], myValues->memberName) == 0) ? TRUE : FALSE; if (myLockFile) { /* It's me! No need to read or validate anything. */ ptr = myValues; } else { /* It's not me! Attempt to extract the member values. */ err = FileLockMemberValues(lockDir, fileList[i], buffer, FILELOCK_DATA_SIZE, &memberValues); if (err != 0) { if (err == ENOENT) { err = 0; /* Not there anymore; locker unlocked or timed out */ continue; } break; } /* Remove any stale locking files */ if (FileLockMachineIDMatch(myValues->machineID, memberValues.machineID)) { char *dispose = NULL; if (FileLockValidExecutionID(memberValues.executionID)) { /* If it's mine it better still be where I put it! */ if ((strcmp(myExecutionID, memberValues.executionID) == 0) && ((memberValues.locationChecksum != NULL) && (strcmp(memberValues.locationChecksum, locationChecksum) != 0))) { dispose = Unicode_Duplicate("lock file has been moved."); } } else { dispose = Str_SafeAsprintf(NULL, "invalid executionID %s.", memberValues.executionID); } if (dispose) { Log(LGPFX" %s discarding %s from %s': %s\n", __FUNCTION__, fileList[i], lockDir, dispose); free(dispose); free(memberValues.memberName); err = FileLockRemoveLockingFile(lockDir, fileList[i]); if (err != 0) { break; } continue; } } ptr = &memberValues; } /* Locking file looks good; see what happens */ err = (*func)(lockDir, fileList[i], ptr, myValues); if (ptr == &memberValues) { free(memberValues.memberName); } if (err != 0) { break; } } bail: Util_FreeStringList(fileList, numEntries); free(locationChecksum); free(myExecutionID); return err; } /* *----------------------------------------------------------------------------- * * FileLockScanner -- * * Call the specified function for each member file found in the * specified directory. If a rescan is necessary check the list * of outstanding locks and handle removing stale locks. * * Results: * 0 success * > 0 failure * * Side effects: * None * *----------------------------------------------------------------------------- */ static int FileLockScanner(const char *lockDir, // IN: int (*func)( // IN: const char *lockDir, const char *fileName, LockValues *memberValues, LockValues *myValues ), LockValues *myValues, // IN: Bool cleanUp) // IN: { int err; ActiveLock *ptr; ASSERT(lockDir); myValues->lockList = NULL; while (TRUE) { ActiveLock *prev; err = FileLockScanDirectory(lockDir, func, myValues, cleanUp); if ((err > 0) || ((err == 0) && (myValues->lockList == NULL))) { break; } prev = NULL; ptr = myValues->lockList; /* * Some 'D' entries have persisted. Age them and remove those that * have not progressed. Remove those that have disappeared. */ while (ptr != NULL) { Bool remove; if (ptr->marked) { if (ptr->age > FILELOCK_PROGRESS_DEARTH) { char *temp; char *path; UnicodeIndex index; ASSERT(*ptr->dirName == 'D'); Log(LGPFX" %s discarding %s data from '%s'.\n", __FUNCTION__, ptr->dirName, lockDir); path = Unicode_Join(lockDir, DIRSEPS, ptr->dirName, NULL); index = Unicode_FindLast(path, "D"); ASSERT(index != UNICODE_INDEX_NOT_FOUND); temp = Unicode_Replace(path, index, 1, "M"); FileDeletionRobust(temp, FALSE); free(temp); temp = Unicode_Replace(path, index, 1, "E"); FileDeletionRobust(temp, FALSE); free(temp); FileRemoveDirectoryRobust(path); free(path); remove = TRUE; } else { ptr->marked = FALSE; ptr->age += FILELOCK_PROGRESS_SAMPLE; remove = FALSE; } } else { remove = TRUE; } if (remove) { if (prev == NULL) { myValues->lockList = ptr->next; } else { prev->next = ptr->next; } } prev = ptr; ptr = ptr->next; } FileSleeper(FILELOCK_PROGRESS_SAMPLE, FILELOCK_PROGRESS_SAMPLE); // relax } /* Clean up anything still on the list; they are no longer important */ while (myValues->lockList != NULL) { ptr = myValues->lockList; myValues->lockList = ptr->next; free(ptr->dirName); free(ptr); } return err; } /* *----------------------------------------------------------------------------- * * FileUnlockIntrinsic -- * * Release a lock on a file. * * Results: * 0 unlocked * > 0 errno * * Side effects: * None. * *----------------------------------------------------------------------------- */ int FileUnlockIntrinsic(FileLockToken *tokenPtr) // IN: { int err = 0; ASSERT(tokenPtr && (tokenPtr->signature == FILELOCK_TOKEN_SIGNATURE)); LOG(1, ("Requesting unlock on %s\n", tokenPtr->pathName)); if (tokenPtr->portable) { /* * If the lockFilePath (a pointer) is the fixed-address token representing * an implicit read lock, there is no lock file and the token can simply * be discarded. */ if (tokenPtr->u.portable.lockFilePath != &implicitReadToken) { char *lockDir; /* The lock directory path */ lockDir = Unicode_Append(tokenPtr->pathName, FILELOCK_SUFFIX); /* * TODO: under vmx86_debug validate the contents of the lock file as * matching the machineID and executionID. */ err = FileDeletionRobust(tokenPtr->u.portable.lockFilePath, FALSE); FileRemoveDirectoryRobust(lockDir); // just in case we can clean up if (err && vmx86_debug) { Log(LGPFX" %s failed for '%s': %s\n", __FUNCTION__, tokenPtr->u.portable.lockFilePath, strerror(err)); } free(lockDir); free(tokenPtr->u.portable.lockFilePath); } tokenPtr->u.portable.lockFilePath = NULL; // Just in case... } else { ASSERT(FileIO_IsValid(&tokenPtr->u.mandatory.lockFd)); if (!FileIO_IsSuccess(FileIO_CloseAndUnlink(&tokenPtr->u.mandatory.lockFd))) { /* * Should succeed, but there is an unavoidable race: * close() must precede unlink(), but another thread could touch * the file between close() and unlink(). We only worry about other * FileLock-like manipulations; the advisory lock file should not * experience any name collisions. Treat races as success. * Specific errors: * EBUSY: other locked file * ENOENT: other locked + unlocked (w/ implicit unlink) file */ if (Err_Errno() == EBUSY || Err_Errno() == ENOENT) { LOG(0, ("Tolerating %s on unlink of advisory lock at %s\n", Err_Errno() == EBUSY ? "EBUSY" : "ENOENT", tokenPtr->pathName)); } else { err = Err_Errno(); if (vmx86_debug) { Log(LGPFX" %s failed for advisory lock '%s': %s\n", __FUNCTION__, tokenPtr->pathName, strerror(err)); } } } } free(tokenPtr->pathName); tokenPtr->signature = 0; // Just in case... tokenPtr->pathName = NULL; // Just in case... free(tokenPtr); return err; } /* *----------------------------------------------------------------------------- * * FileLockWaitForPossession -- * * Wait until the caller has a higher priority towards taking * possession of a lock than the specified file. * * Results: * 0 success * > 0 error (errno) * * Side effects: * None. * *----------------------------------------------------------------------------- */ static int FileLockWaitForPossession(const char *lockDir, // IN: const char *fileName, // IN: LockValues *memberValues, // IN: LockValues *myValues) // IN: { int err = 0; ASSERT(lockDir); ASSERT(fileName); /* "Win" or wait? */ if (((memberValues->lamportNumber < myValues->lamportNumber) || ((memberValues->lamportNumber == myValues->lamportNumber) && (Unicode_Compare(memberValues->memberName, myValues->memberName) < 0))) && ((strcmp(memberValues->lockType, LOCK_EXCLUSIVE) == 0) || (strcmp(myValues->lockType, LOCK_EXCLUSIVE) == 0))) { char *path; uint32 loopCount; Bool thisMachine; thisMachine = FileLockMachineIDMatch(myValues->machineID, memberValues->machineID); loopCount = 0; path = Unicode_Join(lockDir, DIRSEPS, fileName, NULL); while ((err = FileLockSleeper(myValues, &loopCount)) == 0) { /* still there? */ err = FileAttributesRobust(path, NULL); if (err != 0) { if (err == ENOENT) { /* Not there anymore; locker unlocked or timed out */ err = 0; } break; } /* still valid? */ if (thisMachine && !FileLockValidExecutionID(memberValues->executionID)) { /* Invalid Execution ID; remove the member file */ Warning(LGPFX" %s discarding file '%s'; invalid executionID.\n", __FUNCTION__, path); err = FileLockRemoveLockingFile(lockDir, fileName); break; } } /* * Log the disposition of each timeout for all non "try lock" locking * attempts. This can assist in debugging locking problems. */ if ((myValues->msecMaxWaitTime != FILELOCK_TRYLOCK_WAIT) && (err == EAGAIN)) { if (thisMachine) { Log(LGPFX" %s timeout on '%s' due to a local process '%s'\n", __FUNCTION__, path, memberValues->executionID); } else { Log(LGPFX" %s timeout on '%s' due to another machine '%s'\n", __FUNCTION__, path, memberValues->machineID); } } free(path); } return err; } /* *----------------------------------------------------------------------------- * * FileLockNumberScan -- * * Determine the maxmimum number value within the current locking set. * * Results: * 0 success * > 0 failure (errno) * * Side effects: * None. * *----------------------------------------------------------------------------- */ static int FileLockNumberScan(const char *lockDir, // IN: const char *fileName, // IN: LockValues *memberValues, // IN: LockValues *myValues) // IN/OUT: { ASSERT(lockDir); ASSERT(fileName); if (memberValues->lamportNumber > myValues->lamportNumber) { myValues->lamportNumber = memberValues->lamportNumber; } return 0; } /* *----------------------------------------------------------------------------- * * FileLockMakeDirectory -- * * Create a directory. * * Results: * 0 success * > 0 failure (errno) * * Side Effects: * File system may be modified. * *----------------------------------------------------------------------------- */ static int FileLockMakeDirectory(const char *pathName) // IN: { int err; #if !defined(_WIN32) mode_t save; save = umask(0); #endif ASSERT(pathName); err = FileCreateDirectoryRobust(pathName, 0777); #if !defined(_WIN32) umask(save); #endif return err; } /* *----------------------------------------------------------------------------- * * FileLockCreateEntryDirectory -- * * Create an entry directory in the specified locking directory. * * Due to FileLock_Unlock() attempting to remove the locking * directory on an unlock operation (to "clean up" and remove the * locking directory when it is no longer needed), this routine * must carefully handle a number of race conditions to insure the * the locking directory exists and the entry directory is created * within. * * Results: * 0 success * > 0 failure (errno) * * Side Effects: * On success returns the number identifying the entry directory and * the entry directory path name. * *----------------------------------------------------------------------------- */ static int FileLockCreateEntryDirectory(const char *lockDir, // IN: char **entryDirectory, // OUT: char **entryFilePath, // OUT: char **memberFilePath, // OUT: char **memberName) // OUT: { int err = 0; uint32 randomNumber = 0; ASSERT(lockDir); *entryDirectory = NULL; *entryFilePath = NULL; *memberFilePath = NULL; *memberName = NULL; /* Fun at the races */ while (TRUE) { char *temp; FileData fileData; err = FileAttributesRobust(lockDir, &fileData); if (err == 0) { /* The name exists. Deal with it... */ if (fileData.fileType == FILE_TYPE_REGULAR) { /* * It's a file. Assume this is an (active?) old style lock and * err on the safe side - don't remove it (and automatically * upgrade to a new style lock). */ Log(LGPFX" %s: '%s' exists; an old style lock file?\n", __FUNCTION__, lockDir); err = EBUSY; break; } if (fileData.fileType != FILE_TYPE_DIRECTORY) { /* Not a directory; attempt to remove the debris */ if (FileDeletionRobust(lockDir, FALSE) != 0) { Warning(LGPFX" %s: '%s' exists and is not a directory.\n", __FUNCTION__, lockDir); err = ENOTDIR; break; } continue; } } else { if (err == ENOENT) { /* Not there anymore; locker unlocked or timed out */ err = FileLockMakeDirectory(lockDir); if ((err != 0) && (err != EEXIST)) { Warning(LGPFX" %s creation failure on '%s': %s\n", __FUNCTION__, lockDir, strerror(err)); break; } } else { Warning(LGPFX" %s stat failure on '%s': %s\n", __FUNCTION__, lockDir, strerror(err)); break; } } /* There is a small chance of collision/failure; grab stings now */ randomNumber = (FileSimpleRandom() >> 8) & 0xFFFF; *memberName = Unicode_Format("M%05u%s", randomNumber, FILELOCK_SUFFIX); temp = Unicode_Format("D%05u%s", randomNumber, FILELOCK_SUFFIX); *entryDirectory = Unicode_Join(lockDir, DIRSEPS, temp, NULL); free(temp); temp = Unicode_Format("E%05u%s", randomNumber, FILELOCK_SUFFIX); *entryFilePath = Unicode_Join(lockDir, DIRSEPS, temp, NULL); free(temp); *memberFilePath = Unicode_Join(lockDir, DIRSEPS, *memberName, NULL); err = FileLockMakeDirectory(*entryDirectory); if (err == 0) { /* * The entry directory was safely created. See if a member file * is in use (the entry directory is removed once the member file * is created). If a member file is in use, choose another number, * otherwise the use of the this number is OK. * * Err on the side of caution... don't want to trash perfectly * good member files. */ err = FileAttributesRobust(*memberFilePath, NULL); if (err != 0) { if (err == ENOENT) { err = 0; break; } if (vmx86_debug) { Log(LGPFX" %s stat failure on '%s': %s\n", __FUNCTION__, *memberFilePath, strerror(err)); } } FileRemoveDirectoryRobust(*entryDirectory); } else { if ((err != EEXIST) && // Another process/thread created it... (err != ENOENT)) { // lockDir is gone... Warning(LGPFX" %s creation failure on '%s': %s\n", __FUNCTION__, *entryDirectory, strerror(err)); break; } } free(*entryDirectory); free(*entryFilePath); free(*memberFilePath); free(*memberName); *entryDirectory = NULL; *entryFilePath = NULL; *memberFilePath = NULL; *memberName = NULL; } if (err != 0) { free(*entryDirectory); free(*entryFilePath); free(*memberFilePath); free(*memberName); *entryDirectory = NULL; *entryFilePath = NULL; *memberFilePath = NULL; *memberName = NULL; } return err; } /* *----------------------------------------------------------------------------- * * FileLockCreateMemberFile -- * * Create the member file. * * Results: * 0 success * > 0 failure (errno) * * Side Effects: * None * *----------------------------------------------------------------------------- */ static int FileLockCreateMemberFile(FileIODescriptor *desc, // IN: const LockValues *myValues, // IN: const char *entryFilePath, // IN: const char *memberFilePath) // IN: { int cnt; int pid; size_t len; FileIOResult result; uint64 processCreationTime; int err = 0; char buffer[FILELOCK_DATA_SIZE] = { 0 }; ASSERT(entryFilePath); ASSERT(memberFilePath); /* * Populate the buffer with appropriate data * * Lock file arguments are space separated. There is a minimum of 5 * arguments - machineID, executionID, Lamport number, lock type * and process creation time. The maximum number of arguments is * FL_MAX_ARGS. * * Additional arguments, if present, form a property list - one or more * "name=value" pairs. * * Yes, the process creation time is redundently encoded. This is necessary * to maintain backwards compatibility. Should an older code pick up a * newer lock file and there is lock contention, the older code will log * the name of the process causing the contention - it's also encoded * into the executionID. */ cnt = sscanf(myValues->executionID, "%d-%"FMT64"u", &pid, &processCreationTime); ASSERT(cnt == 2); // ensure new format executionID Str_Sprintf(buffer, sizeof buffer, "%s %s %u %s %"FMT64"u lc=%s", myValues->machineID, myValues->executionID, myValues->lamportNumber, myValues->lockType, processCreationTime, myValues->locationChecksum); /* Attempt to write the data */ result = FileIO_Write(desc, buffer, sizeof buffer, &len); if (!FileIO_IsSuccess(result)) { err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); Warning(LGPFX" %s write of '%s' failed: %s\n", __FUNCTION__, entryFilePath, strerror(err)); FileIO_Close(desc); return err; } if (!FileIO_IsSuccess(FileIO_Close(desc))) { err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); Warning(LGPFX" %s close of '%s' failed: %s\n", __FUNCTION__, entryFilePath, strerror(err)); return err; } if (len != sizeof buffer) { Warning(LGPFX" %s write length issue on '%s': %"FMTSZ"d and %"FMTSZ"d\n", __FUNCTION__, entryFilePath, len, sizeof buffer); return EIO; } err = File_Rename(entryFilePath, memberFilePath); if (err != 0) { Warning(LGPFX" %s FileRename of '%s' to '%s' failed: %s\n", __FUNCTION__, entryFilePath, memberFilePath, strerror(err)); if (vmx86_debug) { Log(LGPFX" %s FileLockFileType() of '%s': %s\n", __FUNCTION__, entryFilePath, strerror(FileAttributesRobust(entryFilePath, NULL))); Log(LGPFX" %s FileLockFileType() of '%s': %s\n", __FUNCTION__, memberFilePath, strerror(FileAttributesRobust(memberFilePath, NULL))); } return err; } return 0; } /* *----------------------------------------------------------------------------- * * FileLockIntrinsicMandatory -- * * Obtain a lock on a file; shared or exclusive access. * * This implementation uses the FILEIO_OPEN_LOCK_MANDATORY flag, * which requires kernel support for mandatory locking. Such locks * are automatically broken if the host holding the lock fails. * * msecMaxWaitTime specifies the maximum amount of time, in * milliseconds, to wait for the lock before returning the "not * acquired" status. A value of FILELOCK_TRYLOCK_WAIT is the * equivalent of a "try lock" - the lock will be acquired only if * there is no contention. A value of FILELOCK_INFINITE_WAIT * specifies "waiting forever" to acquire the lock. * * Results: * NULL Lock not acquired. Check err. * err 0 Lock Timed Out * err > 0 errno * !NULL Lock Acquired. This is the "lockToken" for an unlock. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static FileLockToken * FileLockIntrinsicMandatory(const char *pathName, // IN: const char *lockFile, // IN: LockValues *myValues, // IN/OUT: int *err) // OUT: { int access; int loopCount = 0; FileIOResult result; FileLockToken *tokenPtr = Util_SafeMalloc(sizeof *tokenPtr); tokenPtr->signature = FILELOCK_TOKEN_SIGNATURE; tokenPtr->portable = FALSE; tokenPtr->pathName = Unicode_Duplicate(pathName); FileIO_Invalidate(&tokenPtr->u.mandatory.lockFd); access = myValues->exclusivity ? FILEIO_OPEN_ACCESS_WRITE : FILEIO_OPEN_ACCESS_READ; access |= FILEIO_OPEN_EXCLUSIVE_LOCK; do { result = FileIOCreateRetry(&tokenPtr->u.mandatory.lockFd, lockFile, access, FILEIO_OPEN_CREATE, 0600, 0); if (result != FILEIO_LOCK_FAILED) { break; } } while (FileLockSleeper(myValues, &loopCount) == 0); if (FileIO_IsSuccess(result)) { ASSERT(FileIO_IsValid(&tokenPtr->u.mandatory.lockFd)); *err = 0; return tokenPtr; } else { *err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); free(tokenPtr->pathName); ASSERT(!FileIO_IsValid(&tokenPtr->u.mandatory.lockFd)); free(tokenPtr); return NULL; } } /* *----------------------------------------------------------------------------- * * FileLockIntrinsicPortable -- * * Obtain a lock on a file; shared or exclusive access. * * This implementation uses a HIGHLY portable directory-namespace + * Lamport bakery scheme that works on all filesystems that provide * atomicity of the directory namespace (That is, all known filesystems). * The various files involved are hidden within a "pathName.lck/" * subdirectory. * * The lock can be broken by removing the subdirectory. The lock * is self-cleaning on the same host (e.g. will detect a dead process * and will break the lock), but NOT self-cleaning across hosts. The * lock does not require any sort of time-based leases or heartbeats. * * Results: * NULL Lock not acquired. Check err. * err 0 Lock Timed Out * err > 0 errno * !NULL Lock Acquired. This is the "lockToken" for an unlock. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static FileLockToken * FileLockIntrinsicPortable(const char *pathName, // IN: const char *lockDir, // IN: LockValues *myValues, // IN/OUT: int *err) // OUT: { int access; FileIOResult result; FileIODescriptor desc; FileLockToken *tokenPtr; char *entryFilePath = NULL; char *memberFilePath = NULL; char *entryDirectory = NULL; ASSERT(pathName); ASSERT(err); /* * Attempt to create the locking and entry directories; obtain the * entry and member path names. */ *err = FileLockCreateEntryDirectory(lockDir, &entryDirectory, &entryFilePath, &memberFilePath, &myValues->memberName); switch (*err) { case 0: break; case EROFS: /* FALL THROUGH */ case EACCES: if (!myValues->exclusivity) { /* * Lock is for read/shared access however the lock directory could * not be created. Grant an implicit read lock whenever possible. * The address of a private variable will be used for the lock token. */ Warning(LGPFX" %s implicit %s lock succeeded on '%s'.\n", __FUNCTION__, LOCK_SHARED, pathName); *err = 0; memberFilePath = &implicitReadToken; } /* FALL THROUGH */ default: goto bail; } ASSERT(Unicode_LengthInCodeUnits(memberFilePath) - Unicode_LengthInCodeUnits(pathName) <= FILELOCK_OVERHEAD); /* Attempt to create the entry file */ access = FILEIO_OPEN_ACCESS_WRITE; #if defined(_WIN32) access |= FILEIO_OPEN_SHARE_DELETE; #else access |= FILEIO_OPEN_ACCESS_NOFOLLOW; #endif FileIO_Invalidate(&desc); result = FileIOCreateRetry(&desc, entryFilePath, access, FILEIO_OPEN_CREATE_SAFE, 0644, FILE_MAX_WAIT_TIME_MS); if (!FileIO_IsSuccess(result)) { *err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); /* clean up */ FileRemoveDirectoryRobust(entryDirectory); FileRemoveDirectoryRobust(lockDir); goto bail; } /* what is max(Number[1]... Number[all lockers])? */ *err = FileLockScanner(lockDir, FileLockNumberScan, myValues, FALSE); if (*err != 0) { /* clean up */ FileIO_Close(&desc); FileDeletionRobust(entryFilePath, FALSE); FileRemoveDirectoryRobust(entryDirectory); FileRemoveDirectoryRobust(lockDir); goto bail; } /* Number[i] = 1 + max([Number[1]... Number[all lockers]) */ myValues->lamportNumber++; /* Attempt to create the member file */ *err = FileLockCreateMemberFile(&desc, myValues, entryFilePath, memberFilePath); /* Remove entry directory; it has done its job */ FileRemoveDirectoryRobust(entryDirectory); if (*err != 0) { /* clean up */ FileDeletionRobust(entryFilePath, FALSE); FileDeletionRobust(memberFilePath, FALSE); FileRemoveDirectoryRobust(lockDir); goto bail; } /* Attempt to acquire the lock */ *err = FileLockScanner(lockDir, FileLockWaitForPossession, myValues, TRUE); switch (*err) { case 0: break; case EAGAIN: /* clean up */ FileDeletionRobust(memberFilePath, FALSE); FileRemoveDirectoryRobust(lockDir); /* FALL THROUGH */ default: break; } bail: free(entryDirectory); free(entryFilePath); if (*err == 0) { tokenPtr = Util_SafeMalloc(sizeof *tokenPtr); tokenPtr->signature = FILELOCK_TOKEN_SIGNATURE; tokenPtr->portable = TRUE; tokenPtr->pathName = Unicode_Duplicate(pathName); tokenPtr->u.portable.lockFilePath = memberFilePath; } else { free(memberFilePath); tokenPtr = NULL; if (*err == EAGAIN) { *err = 0; // lock not acquired } } return tokenPtr; } /* *----------------------------------------------------------------------------- * * FileLockIntrinsic -- * * Obtain a lock on a file; shared or exclusive access. * * All FileLock_-based locks are advisory locks (i.e. the * lock is maintained separately from the file so only FileLock_ * callers experience locking). Advisory locks have an inherent problem * that they are difficult to break in the event one of the cooperating * entities fails, particularly across distributed filesystems. * * This wrapper function will adaptively switch between a scheme * implemented via mandatory locks and a more portable scheme depending * on host OS support. * * msecMaxWaitTime specifies the maximum amount of time, in * milliseconds, to wait for the lock before returning the "not * acquired" status. A value of FILELOCK_TRYLOCK_WAIT is the * equivalent of a "try lock" - the lock will be acquired only if * there is no contention. A value of FILELOCK_INFINITE_WAIT * specifies "waiting forever" to acquire the lock. * * Results: * NULL Lock not acquired. Check err. * err 0 Lock Timed Out * err > 0 errno * !NULL Lock Acquired. This is the "lockToken" for an unlock. * * Side effects: * None. * *----------------------------------------------------------------------------- */ FileLockToken * FileLockIntrinsic(const char *pathName, // IN: Bool exclusivity, // IN: uint32 msecMaxWaitTime, // IN: int *err) // OUT: { char *lockBase; LockValues myValues = { 0 }; FileLockToken *tokenPtr; /* Construct the locking directory path */ lockBase = Unicode_Append(pathName, FILELOCK_SUFFIX); myValues.lockType = exclusivity ? LOCK_EXCLUSIVE : LOCK_SHARED; myValues.exclusivity = exclusivity; myValues.waitTime = 0; myValues.msecMaxWaitTime = msecMaxWaitTime; if (File_SupportsMandatoryLock(pathName)) { LOG(1, ("Requesting %s lock on %s (mandatory, %u).\n", myValues.lockType, pathName, myValues.msecMaxWaitTime)); tokenPtr = FileLockIntrinsicMandatory(pathName, lockBase, &myValues, err); } else { myValues.machineID = (char *) FileLockGetMachineID(); // don't free this! myValues.executionID = FileLockGetExecutionID(); // free this! myValues.lamportNumber = 0; myValues.locationChecksum = FileLockLocationChecksum(lockBase); // free this! myValues.memberName = NULL; LOG(1, ("Requesting %s lock on %s (%s, %s, %u).\n", myValues.lockType, pathName, myValues.machineID, myValues.executionID, myValues.msecMaxWaitTime)); tokenPtr = FileLockIntrinsicPortable(pathName, lockBase, &myValues, err); free(myValues.memberName); free(myValues.locationChecksum); free(myValues.executionID); } free(lockBase); return tokenPtr; } /* *----------------------------------------------------------------------------- * * FileLockIsLockedMandatory -- * * Is a file currently locked (at the time of the call)? * * The only way to check for a mandatory lock is to try opening * the file (and quickly closing it again). If the lock is held, * attempting to open the file will return FILEIO_LOCK_FAILED. * * Results: * TRUE YES * FALSE NO; if err is not NULL may check *err for an error * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool FileLockIsLockedMandatory(const char *lockFile, // IN: int *err) // OUT/OPT: { int access; FileIOResult result; FileIODescriptor desc; FileIO_Invalidate(&desc); /* * Check for lock by actually locking file, and dropping * lock quickly if open was successful. */ access = FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE | FILEIO_OPEN_EXCLUSIVE_LOCK; result = FileIOCreateRetry(&desc, lockFile, access, FILEIO_OPEN, 0644, 0); if (FileIO_IsSuccess(result)) { Bool ret; ret = !FileIO_IsSuccess(FileIO_Close(&desc)); ASSERT(!ret); return FALSE; } else if (result == FILEIO_LOCK_FAILED) { return TRUE; // locked } else if (result == FILEIO_FILE_NOT_FOUND) { return FALSE; // no lock file means unlocked } else { if (err != NULL) { *err = FileMapErrorToErrno(__FUNCTION__, Err_Errno()); } return FALSE; } } /* *----------------------------------------------------------------------------- * * FileLockIsLockedPortable -- * * Is a file currently locked (at the time of the call)? * * The "portable" lock is held if the lock directory exists and * there are any "M" entries (representing held locks). * * FileLocks implemented via mandatory locking are reported * as held locks (errno == ENOTDIR). * * Results: * TRUE YES * FALSE NO; if err is not NULL may check *err for an error * * Side effects: * None. * *----------------------------------------------------------------------------- */ static Bool FileLockIsLockedPortable(const char *lockDir, // IN: int *err) // OUT/OPT: { uint32 i; int numEntries; Bool isLocked = FALSE; char **fileList = NULL; numEntries = FileListDirectoryRobust(lockDir, &fileList); if (numEntries == -1) { /* * If the lock directory doesn't exist, we should not count this * as an error. This is expected if the file isn't locked. */ if (err != NULL) { *err = (errno == ENOENT) ? 0 : errno; } return FALSE; } for (i = 0; i < numEntries; i++) { if (*fileList[i] == 'M') { isLocked = TRUE; break; } } Util_FreeStringList(fileList, numEntries); return isLocked; } /* *----------------------------------------------------------------------------- * * FileLockIsLocked -- * * Is a file currently locked (at the time of the call)? * * Results: * TRUE YES * FALSE NO; if err is not NULL may check *err for an error * * Side effects: * None. * *----------------------------------------------------------------------------- */ Bool FileLockIsLocked(const char *pathName, // IN: int *err) // OUT/OPT: { Bool isLocked; char *lockBase; ASSERT(pathName); lockBase = Unicode_Append(pathName, FILELOCK_SUFFIX); if (File_SupportsMandatoryLock(pathName)) { isLocked = FileLockIsLockedMandatory(lockBase, err); } else { isLocked = FileLockIsLockedPortable(lockBase, err); } free(lockBase); return isLocked; } /* *---------------------------------------------------------------------- * * FileLock_TokenPathName -- * * Return the path name associated with a lock (token). The path name * is returned as a dynamically allocated string the caller is * responsible for. * * Results: * As above * * Side effects: * None. * *---------------------------------------------------------------------- */ char * FileLock_TokenPathName(const FileLockToken *lockToken) // IN: { ASSERT(lockToken && (lockToken->signature == FILELOCK_TOKEN_SIGNATURE)); return Unicode_Duplicate(lockToken->pathName); } open-vm-tools-10.0.7-3227872/lib/file/fileTempPosix.c0000644000000000000000000003362112660700525020301 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if !defined(__FreeBSD__) && !defined(sun) # include #endif #include "vmware.h" #include "file.h" #include "fileInt.h" #include "util.h" #include "su.h" #include "vm_atomic.h" #include "str.h" #include "vm_product.h" #include "random.h" #include "userlock.h" #include "unicodeOperations.h" #include "err.h" #include "posix.h" #include "mutexRankLib.h" #include "hostType.h" #include "localconfig.h" #define LOGLEVEL_MODULE util #include "loglevel_user.h" /* *---------------------------------------------------------------------- * * FileTryDir -- * * Check to see if the given directory is actually a directory * and is writable by us. * * Results: * The expanded directory name on success, NULL on failure. * * Side effects: * The result is allocated. * *---------------------------------------------------------------------- */ static char * FileTryDir(const char *dirName) // IN: Is this a writable directory? { char *edirName; if (dirName != NULL) { edirName = Util_ExpandString(dirName); if ((edirName != NULL) && FileIsWritableDir(edirName)) { return edirName; } free(edirName); } return NULL; } /* *---------------------------------------------------------------------- * * FileGetTmpDir -- * * Determine the best temporary directory. Unsafe since the * returned directory is generally going to be 0777, thus all sorts * of denial of service or symlink attacks are possible. * * Results: * NULL if error (reported to the user). * * Side effects: * The result is allocated. * *---------------------------------------------------------------------- */ static char * FileGetTmpDir(Bool useConf) // IN: Use the config file? { char *dirName; char *edirName; /* Make several attempts to find a good temporary directory candidate */ if (useConf) { dirName = (char *)LocalConfig_GetString(NULL, "tmpDirectory"); edirName = FileTryDir(dirName); free(dirName); if (edirName != NULL) { return edirName; } } /* Posix_Getenv string must _not_ be freed */ edirName = FileTryDir(Posix_Getenv("TMPDIR")); if (edirName != NULL) { return edirName; } /* P_tmpdir is usually defined in */ edirName = FileTryDir(P_tmpdir); if (edirName != NULL) { return edirName; } edirName = FileTryDir("/tmp"); if (edirName != NULL) { return edirName; } edirName = FileTryDir("~"); if (edirName != NULL) { return edirName; } dirName = File_Cwd(NULL); if (dirName != NULL) { edirName = FileTryDir(dirName); free(dirName); if (edirName != NULL) { return edirName; } } edirName = FileTryDir("/"); if (edirName != NULL) { return edirName; } Warning("%s: Couldn't get a temporary directory\n", __FUNCTION__); return NULL; } #undef HOSTINFO_TRYDIR #if !defined(__FreeBSD__) && !defined(sun) /* *----------------------------------------------------------------------------- * * FileGetUserName -- * * Retrieve the name associated with a user ID. Thread-safe * version. --hpreg * * Results: * The allocated name on success * NULL on failure * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * FileGetUserName(uid_t uid) // IN: { char *memPool; char *userName; struct passwd pw; struct passwd *pw_p; long memPoolSize; #if defined(__APPLE__) memPoolSize = _PASSWORD_LEN; #else memPoolSize = sysconf(_SC_GETPW_R_SIZE_MAX); if (memPoolSize <= 0) { Warning("%s: sysconf(_SC_GETPW_R_SIZE_MAX) failed.\n", __FUNCTION__); return NULL; } #endif memPool = malloc(memPoolSize); if (memPool == NULL) { Warning("%s: Not enough memory.\n", __FUNCTION__); return NULL; } if ((Posix_Getpwuid_r(uid, &pw, memPool, memPoolSize, &pw_p) != 0) || pw_p == NULL) { free(memPool); Warning("%s: Unable to retrieve the username associated with " "user ID %u.\n", __FUNCTION__, uid); return NULL; } userName = strdup(pw_p->pw_name); free(memPool); if (userName == NULL) { Warning("%s: Not enough memory.\n", __FUNCTION__); return NULL; } return userName; } /* *----------------------------------------------------------------------------- * * FileAcceptableSafeTmpDir -- * * Determines if the specified path is acceptable as the safe * temp directory. The directory must either be creatable * with the appropriate permissions and userId or it must * already exist with those settings. * * Results: * TRUE if path is acceptible, FALSE otherwise * * Side effects: * Directory may be created * *----------------------------------------------------------------------------- */ static Bool FileAcceptableSafeTmpDir(const char *dirname, // IN: int userId) // IN: { Bool result; static const mode_t mode = 0700; result = (Posix_Mkdir(dirname, mode) == 0); if (!result) { int error = errno; if (EEXIST == error) { struct stat st; /* * The name already exists. Check that it is what we want: a * directory owned by the current effective user with permissions * 'mode'. It is crucial to use lstat() instead of stat() here, * because we do not want the name to be a symlink (created by * another user) pointing to a directory owned by the current * effective user with permissions 'mode'. */ if (0 == Posix_Lstat(dirname, &st)) { /* * Our directory inherited S_ISGID if its parent had it. So it * is important to ignore that bit, and it is safe to do so * because that bit does not affect the owner's permissions. */ if (S_ISDIR(st.st_mode) && (st.st_uid == userId) && ((st.st_mode & 05777) == mode)) { result = TRUE; } } } } return result; } /* *----------------------------------------------------------------------------- * * FileFindExistingSafeTmpDir -- * * Searches the directory baseTmpDir to see if any subdirectories * are suitable to use as the safe temp directory. The safe temp * directory must have the correct permissions and userId. * * Results: * Path to discovered safe temp directory (must be freed). * NULL returned if no suitable directory is found. * * Side effects: * None * *----------------------------------------------------------------------------- */ static char * FileFindExistingSafeTmpDir(uid_t userId, // IN: const char *userName, // IN: const char *baseTmpDir) // IN: { int i; int numFiles; char *pattern; char *tmpDir = NULL; char **fileList = NULL; /* * We always use the pattern PRODUCT-USER-xxxx when creating * alternative safe temp directories, so check for ones with * those names and the appropriate permissions. */ pattern = Unicode_Format("%s-%s-", PRODUCT_GENERIC_NAME_LOWER, userName); if (pattern == NULL) { return NULL; } numFiles = File_ListDirectory(baseTmpDir, &fileList); if (numFiles == -1) { free(pattern); return NULL; } for (i = 0; i < numFiles; i++) { if (Unicode_StartsWith(fileList[i], pattern)) { char *path = Unicode_Join(baseTmpDir, DIRSEPS, fileList[i], NULL); if (File_IsDirectory(path) && FileAcceptableSafeTmpDir(path, userId)) { tmpDir = path; break; } free(path); } } Util_FreeStringList(fileList, numFiles); free(pattern); return tmpDir; } /* *----------------------------------------------------------------------------- * * FileCreateSafeTmpDir -- * * Creates a new directory within baseTmpDir with the correct permissions * and userId to ensure it is safe from symlink attacks. * * Results: * Path to created safe temp directory (must be freed). * NULL returned if no suitable directory could be created. * * Side effects: * Directory may be created. * *----------------------------------------------------------------------------- */ static char * FileCreateSafeTmpDir(uid_t userId, // IN: const char *userName, // IN: const char *baseTmpDir) // IN: { static const int MAX_DIR_ITERS = 250; int curDirIter = 0; char *tmpDir = NULL; while (TRUE) { /* * We use a random number that makes it more likely that we will create * an unused name than if we had simply tried suffixes in numeric order. */ tmpDir = Str_Asprintf(NULL, "%s%s%s-%s-%u", baseTmpDir, DIRSEPS, PRODUCT_GENERIC_NAME_LOWER, userName, FileSimpleRandom()); if (!tmpDir) { Warning("%s: Out of memory error.\n", __FUNCTION__); break; } if (FileAcceptableSafeTmpDir(tmpDir, userId)) { break; } if (++curDirIter > MAX_DIR_ITERS) { Warning("%s: Failed to create a safe temporary directory, path " "\"%s\". The maximum number of attempts was exceeded.\n", __FUNCTION__, tmpDir); free(tmpDir); tmpDir = NULL; break; } free(tmpDir); tmpDir = NULL; } return tmpDir; } #endif // __linux__ /* *----------------------------------------------------------------------------- * * File_GetSafeTmpDir -- * * Return a safe temporary directory (i.e. a temporary directory which * is not prone to symlink attacks, because it is only writable by the * current effective user). * * Guaranteed to return the same directory every time it is * called during the lifetime of the current process, for the * current effective user ID. (Barring the user manually deleting * or renaming the directory.) * * Results: * The allocated directory path on success. * NULL on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ char * File_GetSafeTmpDir(Bool useConf) // IN: { char *tmpDir; #if defined(__FreeBSD__) || defined(sun) tmpDir = FileGetTmpDir(useConf); #else static Atomic_Ptr lckStorage; static char *safeDir; char *baseTmpDir = NULL; char *userName = NULL; uid_t userId; MXUserExclLock *lck; userId = geteuid(); /* Get and take lock for our safe dir. */ lck = MXUser_CreateSingletonExclLock(&lckStorage, "getSafeTmpDirLock", RANK_getSafeTmpDirLock); VERIFY(lck != NULL); MXUser_AcquireExclLock(lck); /* * Check if we've created a temporary dir already and if it is still usable. */ tmpDir = NULL; if (safeDir && FileAcceptableSafeTmpDir(safeDir, userId)) { tmpDir = Util_SafeStrdup(safeDir); goto exit; } /* We don't have a useable temporary dir, create one. */ baseTmpDir = FileGetTmpDir(useConf); if (!baseTmpDir) { Warning("%s: FileGetTmpDir failed.\n", __FUNCTION__); goto exit; } userName = FileGetUserName(userId); if (!userName) { Warning("%s: FileGetUserName failed, using numeric ID " "as username instead.\n", __FUNCTION__); /* Fallback on just using the userId as the username. */ userName = Str_Asprintf(NULL, "uid-%d", userId); if (!userName) { Warning("%s: Str_Asprintf error.\n", __FUNCTION__); goto exit; } } tmpDir = Str_Asprintf(NULL, "%s%s%s-%s", baseTmpDir, DIRSEPS, PRODUCT_GENERIC_NAME_LOWER, userName); if (!tmpDir) { Warning("%s: Out of memory error.\n", __FUNCTION__); goto exit; } if (!FileAcceptableSafeTmpDir(tmpDir, userId)) { /* * We didn't get our first choice for the safe temp directory. * Search through the unsafe tmp directory to see if there is * an acceptable one to use. */ free(tmpDir); tmpDir = FileFindExistingSafeTmpDir(userId, userName, baseTmpDir); if (!tmpDir) { /* * We didn't find any usable directories, so try to create one now. */ tmpDir = FileCreateSafeTmpDir(userId, userName, baseTmpDir); } } if (tmpDir) { /* * We have successfully created a temporary directory, remember it for * future calls. */ free(safeDir); safeDir = Util_SafeStrdup(tmpDir); } exit: MXUser_ReleaseExclLock(lck); free(baseTmpDir); free(userName); #endif return tmpDir; } open-vm-tools-10.0.7-3227872/lib/file/Makefile.in0000644000000000000000000004174212660700525017415 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/file DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libFile_la_LIBADD = am_libFile_la_OBJECTS = file.lo fileStandAlone.lo filePosix.lo \ fileIO.lo fileIOPosix.lo fileLockPrimitive.lo fileLockPosix.lo \ fileTempPosix.lo fileTemp.lo libFile_la_OBJECTS = $(am_libFile_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libFile_la_SOURCES) DIST_SOURCES = $(libFile_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libFile.la libFile_la_SOURCES = file.c fileStandAlone.c filePosix.c fileIO.c \ fileIOPosix.c fileLockPrimitive.c fileLockPosix.c \ fileTempPosix.c fileTemp.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/file/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/file/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libFile.la: $(libFile_la_OBJECTS) $(libFile_la_DEPENDENCIES) $(LINK) $(libFile_la_OBJECTS) $(libFile_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileIO.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileIOPosix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileLockPosix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileLockPrimitive.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filePosix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileStandAlone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileTemp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileTempPosix.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/user/0000755000000000000000000000000012660700526015400 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/user/Makefile.am0000644000000000000000000000203012660700526017427 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libUser.la libUser_la_SOURCES = libUser_la_SOURCES += util.c libUser_la_SOURCES += utilBacktrace.c AM_CFLAGS = @LIB_USER_CPPFLAGS@ open-vm-tools-10.0.7-3227872/lib/user/utilBacktrace.c0000644000000000000000000003400712660700526020325 0ustar rootroot/********************************************************* * Copyright (C) 2013-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * utilBacktrace.c -- * * misc util functions */ #undef WIN32_LEAN_AND_MEAN #if defined(__linux__) && !defined(VMX86_TOOLS) #define _GNU_SOURCE #endif #include "vm_ctype.h" #include "safetime.h" #if defined(_WIN32) # include // also includes windows.h # include # include # include "coreDump.h" #endif #if !defined(_WIN32) # include # include # include #endif #if defined(__linux__) && !defined(VMX86_TOOLS) && !defined(__ANDROID__) # include #endif #include "vmware.h" #include "util.h" #include "str.h" #ifdef VM_X86_64 # if defined(__GNUC__) && (!defined(USING_AUTOCONF) || defined(HAVE_UNWIND_H)) # define UTIL_BACKTRACE_USE_UNWIND # endif #endif #ifdef UTIL_BACKTRACE_USE_UNWIND #include #define MAX_SKIPPED_FRAMES 10 struct UtilBacktraceFromPointerData { uintptr_t basePtr; Util_OutputFunc outFunc; void *outFuncData; unsigned int frameNr; unsigned int skippedFrames; }; struct UtilBacktraceToBufferData { uintptr_t basePtr; uintptr_t *buffer; size_t len; }; #endif /* UTIL_BACKTRACE_USE_UNWIND */ /* *----------------------------------------------------------------------------- * * UtilLogWrapper -- * * Adapts the Log function to meet the interface required by backtracing * functions by adding an ignored void* argument. * * NOTE: This function needs to be static on linux (and any other * platform appLoader might be ported to). See bug 403780. * * Results: * Same effect as Log(fmt, ...) * * Side effects: * None. * *----------------------------------------------------------------------------- */ static void UtilLogWrapper(void *ignored, // IN: const char *fmt, // IN: ...) // IN: { uint32 len; va_list ap; char thisLine[UTIL_BACKTRACE_LINE_LEN]; va_start(ap, fmt); len = Str_Vsnprintf(thisLine, UTIL_BACKTRACE_LINE_LEN - 2, fmt, ap); va_end(ap); if (len >= UTIL_BACKTRACE_LINE_LEN - 2) { len = UTIL_BACKTRACE_LINE_LEN - 3; } if (thisLine[len - 1] != '\n') { thisLine[len] = '\n'; thisLine[len + 1] = '\0'; } Log("%s", thisLine); } #ifdef UTIL_BACKTRACE_USE_UNWIND /* *----------------------------------------------------------------------------- * * UtilBacktraceToBufferCallback -- * * Callback from _Unwind_Backtrace to add one entry to the backtrace * buffer. * * Results: * _URC_NO_REASON : Please continue with backtrace. * _URC_END_OF_STACK : Abort backtrace, we run out of space (*). * * (*) Caller does not care. Anything else than NO_REASON is fatal * and forces _Unwind_Backtrace to report PHASE1 error. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static _Unwind_Reason_Code UtilBacktraceToBufferCallback(struct _Unwind_Context *ctx, // IN: Unwind context void *cbData) // IN/OUT: Our data { struct UtilBacktraceToBufferData *data = cbData; uintptr_t cfa = _Unwind_GetCFA(ctx); /* * Stack grows down. So if we are below basePtr, do nothing... */ if (cfa >= data->basePtr) { if (data->len) { *data->buffer++ = _Unwind_GetIP(ctx); data->len--; } else { return _URC_END_OF_STACK; } } return _URC_NO_REASON; } /* *----------------------------------------------------------------------------- * * UtilBacktraceFromPointerCallback -- * * Callback from _Unwind_Backtrace to print one backtrace entry * to the backtrace output. * * Results: * _URC_NO_REASON : Please continue with backtrace. * _URC_END_OF_STACK : Abort backtrace. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static _Unwind_Reason_Code UtilBacktraceFromPointerCallback(struct _Unwind_Context *ctx, // IN: Unwind context void *cbData) // IN/OUT: Our status { struct UtilBacktraceFromPointerData *data = cbData; uintptr_t cfa = _Unwind_GetCFA(ctx); /* * Stack grows down. So if we are below basePtr, do nothing... */ if (cfa >= data->basePtr && data->frameNr < 500) { #ifndef VM_X86_64 # error You should not build this on 32bit - there is no eh_frame there. #endif /* bump basePtr for glibc unwind bug, see [302237] */ data->basePtr = cfa + 8; /* Do output without leading '0x' to save some horizontal space... */ data->outFunc(data->outFuncData, "Backtrace[%u] %016lx rip=%016lx rbx=%016lx rbp=%016lx " "r12=%016lx r13=%016lx r14=%016lx r15=%016lx\n", data->frameNr, cfa, _Unwind_GetIP(ctx), _Unwind_GetGR(ctx, 3), _Unwind_GetGR(ctx, 6), _Unwind_GetGR(ctx, 12), _Unwind_GetGR(ctx, 13), _Unwind_GetGR(ctx, 14), _Unwind_GetGR(ctx, 15)); data->frameNr++; return _URC_NO_REASON; } else if (data->skippedFrames < MAX_SKIPPED_FRAMES && !data->frameNr) { /* * Skip over the frames before the specified starting point of the * backtrace. */ data->skippedFrames++; return _URC_NO_REASON; } return _URC_END_OF_STACK; } #if !defined(_WIN32) && !defined(VMX86_TOOLS) && !defined(__ANDROID__) /* *----------------------------------------------------------------------------- * * UtilSymbolBacktraceFromPointerCallback -- * * Callback from _Unwind_Backtrace to print one backtrace entry * to the backtrace output. This version includes symbol information, * if available. * * Results: * _URC_NO_REASON : Please continue with backtrace. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static _Unwind_Reason_Code UtilSymbolBacktraceFromPointerCallback(struct _Unwind_Context *ctx, // IN: Unwind context void *cbData) // IN/OUT: Our status { struct UtilBacktraceFromPointerData *data = cbData; uintptr_t cfa = _Unwind_GetCFA(ctx); /* * Stack grows down. So if we are below basePtr, do nothing... */ if (cfa >= data->basePtr && data->frameNr < 500) { #ifndef VM_X86_64 # error You should not build this on 32bit - there is no eh_frame there. #endif void *enclFuncAddr; Dl_info dli; /* bump basePtr for glibc unwind bug, see [302237] */ data->basePtr = cfa + 8; #ifdef __linux__ enclFuncAddr = _Unwind_FindEnclosingFunction((void *)_Unwind_GetIP(ctx)); #else enclFuncAddr = NULL; #endif if (dladdr(enclFuncAddr, &dli) || dladdr((void *)_Unwind_GetIP(ctx), &dli)) { data->outFunc(data->outFuncData, "SymBacktrace[%u] %016lx rip=%016lx in function %s " "in object %s loaded at %016lx\n", data->frameNr, cfa, _Unwind_GetIP(ctx), dli.dli_sname, dli.dli_fname, dli.dli_fbase); } else { data->outFunc(data->outFuncData, "SymBacktrace[%u] %016lx rip=%016lx \n", data->frameNr, cfa, _Unwind_GetIP(ctx)); } data->frameNr++; return _URC_NO_REASON; } else if (data->skippedFrames < MAX_SKIPPED_FRAMES && !data->frameNr) { /* * Skip over the frames before the specified starting point of the * backtrace. */ data->skippedFrames++; return _URC_NO_REASON; } return _URC_END_OF_STACK; } #endif #endif /* *---------------------------------------------------------------------- * * Util_BacktraceFromPointer -- * * log the stack backtrace given a frame pointer * * Results: * * void * * Side effects: * None. * *---------------------------------------------------------------------- */ void Util_BacktraceFromPointer(uintptr_t *basePtr) // IN: { Util_BacktraceFromPointerWithFunc(basePtr, UtilLogWrapper, NULL); } /* *----------------------------------------------------------------------------- * * Util_BacktraceFromPointerWithFunc -- * * Output a backtrace from the given frame porinter, using * "outputFunc" as the logging function. For each line of the backtrace, * this will call "outputFunc(outputFuncData, fmt, ...)" * * Results: * None. * * Side effects: * Calls outFunc repeatedly. * *----------------------------------------------------------------------------- */ void Util_BacktraceFromPointerWithFunc(uintptr_t *basePtr, // IN: Util_OutputFunc outFunc, // IN: void *outFuncData) // IN: { #if defined(UTIL_BACKTRACE_USE_UNWIND) struct UtilBacktraceFromPointerData data; data.basePtr = (uintptr_t)basePtr; data.outFunc = outFunc; data.outFuncData = outFuncData; data.frameNr = 0; data.skippedFrames = 0; _Unwind_Backtrace(UtilBacktraceFromPointerCallback, &data); #if !defined(_WIN32) && !defined(VMX86_TOOLS) /* * We do a separate pass here that includes symbols in order to * make sure the base backtrace that does not call dladdr() etc. * is safely produced. */ data.basePtr = (uintptr_t)basePtr; data.outFunc = outFunc; data.outFuncData = outFuncData; data.frameNr = 0; data.skippedFrames = 0; _Unwind_Backtrace(UtilSymbolBacktraceFromPointerCallback, &data); #endif #elif !defined(VM_X86_64) uintptr_t *x = basePtr; int i; #if !defined(_WIN32) && !defined(VMX86_TOOLS) && !defined(__ANDROID__) Dl_info dli; #endif for (i = 0; i < 256; i++) { if (x < basePtr || (uintptr_t) x - (uintptr_t) basePtr > 0x8000) { break; } outFunc(outFuncData, "Backtrace[%d] %#08x eip %#08x \n", i, x[0], x[1]); x = (uintptr_t *) x[0]; } #if !defined(_WIN32) && !defined(VMX86_TOOLS) && !defined(__ANDROID__) /* * We do a separate pass here that includes symbols in order to * make sure the base backtrace that does not call dladdr() etc. * is safely produced. */ x = basePtr; for (i = 0; i < 256; i++) { if (x < basePtr || (uintptr_t) x - (uintptr_t) basePtr > 0x8000) { break; } if (dladdr((uintptr_t *)x[1], &dli)) { outFunc(outFuncData, "SymBacktrace[%d] %#08x eip %#08x in function %s " "in object %s loaded at %#08x\n", i, x[0], x[1], dli.dli_sname, dli.dli_fname, dli.dli_fbase); } else { outFunc(outFuncData, "SymBacktrace[%d] %#08x eip %#08x \n", i, x[0], x[1]); } x = (uintptr_t *) x[0]; } #endif #endif } /* *----------------------------------------------------------------------------- * * Util_BacktraceToBuffer -- * * Output a backtrace from the given frame pointer to supplied buffer. * * Results: * None. * * Side effects: * See above. * *----------------------------------------------------------------------------- */ void Util_BacktraceToBuffer(uintptr_t *basePtr, // IN: uintptr_t *buffer, // IN: int len) // IN: { #if defined(UTIL_BACKTRACE_USE_UNWIND) struct UtilBacktraceToBufferData data; data.basePtr = (uintptr_t)basePtr; data.buffer = buffer; data.len = len; _Unwind_Backtrace(UtilBacktraceToBufferCallback, &data); #elif !defined(VM_X86_64) uintptr_t *x = basePtr; int i; for (i = 0; i < 256 && i < len; i++) { if (x < basePtr || (uintptr_t) x - (uintptr_t) basePtr > 0x8000) { break; } buffer[i] = x[1]; x = (uintptr_t *) x[0]; } #endif } /* *---------------------------------------------------------------------- * * Util_Backtrace -- * * log the stack backtrace for a particular bug number * * Results: * * void * * Side effects: * None. * *---------------------------------------------------------------------- */ void Util_Backtrace(int bugNr) // IN { Util_BacktraceWithFunc(bugNr, UtilLogWrapper, NULL); } /* *----------------------------------------------------------------------------- * * Util_BacktraceWithFunc -- * * Outputs the stack backtrace for the bug "bugNr," using the * log function "outFunc" as described in the comment for * Util_BacktraceFromPointerWithFunc. * * Results: * None. * * Side effects: * Calls outFunc several times. * *----------------------------------------------------------------------------- */ void Util_BacktraceWithFunc(int bugNr, // IN: Util_OutputFunc outFunc, // IN: void *outFuncData) // IN: { #if defined(_WIN32) CoreDumpFullBacktraceOptions options = {0}; options.bugNumber = bugNr; CoreDump_LogFullBacktraceToFunc(&options, outFunc, outFuncData); #else uintptr_t *x = (uintptr_t *) &bugNr; if (bugNr == 0) { outFunc(outFuncData, "Backtrace:\n"); } else { outFunc(outFuncData, "Backtrace for bugNr=%d\n",bugNr); } Util_BacktraceFromPointerWithFunc(&x[-2], outFunc, outFuncData); #endif } open-vm-tools-10.0.7-3227872/lib/user/util.c0000644000000000000000000004653012660700526016531 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * util.c -- * * misc util functions */ #undef WIN32_LEAN_AND_MEAN #if defined(__linux__) && !defined(VMX86_TOOLS) #define _GNU_SOURCE #endif #include "vm_ctype.h" #include "safetime.h" #if defined(_WIN32) # include // also includes windows.h # include # include # include "getoptWin32.h" #endif #include #include #include #include #include #include #include #if !defined(_WIN32) # include # include # include # include #endif #if defined(__linux__) && !defined(VMX86_TOOLS) && !defined(__ANDROID__) # include #endif #include "vmware.h" #include "msg.h" #include "util.h" #include "str.h" /* For HARD_EXPIRE --hpreg */ #include "vm_version.h" #include "su.h" #include "posix.h" #include "file.h" #include "util_shared.h" #include "escape.h" #include "base64.h" #include "unicode.h" #include "posix.h" #ifndef O_BINARY #define O_BINARY 0 #endif /* * Win32 doesn't have an iovec type, so do this here to avoid messy games in * the header files. --Jeremy. */ struct UtilVector { void *base; int len; }; /* *---------------------------------------------------------------------- * * Util_Init -- * * Opportunity to sanity check things * * Results: * Bool - TRUE (this should never fail) * * Side effects: * None * *---------------------------------------------------------------------- */ Bool Util_Init(void) { #ifdef VMX86_DEVEL /* * Sanity check Str_Snprintf so that we're never thrown off guard * by a change in the underlying libraries that Str_Snprintf doesn't * catch and wrap properly. */ { char buf[2] = { 'x', 'x' }; int rv; rv = Str_Snprintf(buf, sizeof buf, "a"); ASSERT(rv == 1); ASSERT(!strcmp(buf, "a")); rv = Str_Snprintf(buf, sizeof buf, "ab"); ASSERT(rv == -1); ASSERT(!strcmp(buf, "a")); } #endif return TRUE; } /* *---------------------------------------------------------------------- * * Util_Checksum32 -- * * Checksums a uint32 aligned block by progressive XOR. Basically parity * checking of each bit position. * *---------------------------------------------------------------------- */ uint32 Util_Checksum32(const uint32 *buf, int len) { uint32 checksum = 0; int i; ASSERT((len % 4) == 0); for (i = 0; i < len; i+=4) checksum ^= *(buf++); return checksum; } /* *---------------------------------------------------------------------- * * Util_Checksum -- * * Checksums a block by progressive XOR. Basically parity * checking of each bit position. * *---------------------------------------------------------------------- */ uint32 Util_Checksum(const uint8 *buf, int len) { uint32 checksum; int remainder, shift; remainder = len % 4; len -= remainder; checksum = Util_Checksum32((uint32 *)buf, len); buf += len; shift = 0; while (remainder--) { /* * Note: this is little endian. */ checksum ^= (*buf++ << shift); shift += 8; } return checksum; } /* *---------------------------------------------------------------------- * * Util_Checksumv -- * * Checksums an iovector by progressive XOR. Basically parity checking of * each bit position. * *---------------------------------------------------------------------- */ uint32 Util_Checksumv(void *iov, // IN int numEntries) // IN { uint32 checksum = 0; struct UtilVector *vector = (struct UtilVector *) iov; uint32 partialChecksum; int bytesSoFar = 0; int rotate; while (numEntries-- > 0) { partialChecksum = Util_Checksum(vector->base, vector->len); rotate = (bytesSoFar & 3) * 8; checksum ^= ((partialChecksum << rotate) | (partialChecksum >> (32 - rotate))); bytesSoFar += vector->len; vector++; } return checksum; } /* *---------------------------------------------------------------------- * * Util_HashString -- * * Get a hash of the given NUL terminated string using the djb2 * hash algorithm. * * Results: * The hashed value. * * Side effects: * None. * *---------------------------------------------------------------------- */ uint32 Util_HashString(const char *str) // IN: { uint32 hash = 5381; int c; while ((c = *str++) != 0) { hash = ((hash << 5) + hash) + c; } return hash; } /* *---------------------------------------------------------------------- * * Util_Data2Buffer -- * * Format binary data for printing * * Results: * TRUE if all data fits into buffer, FALSE otherwise. * * Side effects: * None * *---------------------------------------------------------------------- */ Bool Util_Data2Buffer(char *buf, // OUT size_t bufSize, // IN const void *data0, // IN size_t dataSize) // IN { size_t n; /* At least 1 byte (for NUL) must be available. */ if (!bufSize) { return FALSE; } bufSize = bufSize / 3; n = MIN(dataSize, bufSize); if (n != 0) { const uint8 *data = data0; while (n > 0) { static const char digits[] = "0123456789ABCDEF"; *buf++ = digits[*data >> 4]; *buf++ = digits[*data & 0xF]; *buf++ = ' '; data++; n--; } buf--; } *buf = 0; return dataSize <= bufSize; } /* *---------------------------------------------------------------------- * * Util_ExitProcessAbruptly * * On Win32, terminate the process and all of its threads, without * calling any of the DLL termination handlers. * * On Linux, call _exit(). * * Results: * None * * Side effects: * None * *---------------------------------------------------------------------- */ void Util_ExitProcessAbruptly(int code) // IN { #if defined(_WIN32) TerminateProcess(GetCurrentProcess(), code); #else _exit(code); #endif } /* *---------------------------------------------------------------------- * * Util_ExitThread -- * * Terminate the running thread. * * Results: * None * * Side effects: * None * *---------------------------------------------------------------------- */ void Util_ExitThread(int code) // IN { #if defined(_WIN32) ExitThread(code); #else exit(code); #endif } /* *---------------------------------------------------------------------- * * Util_CompareDotted -- * * Compares two version numbers encoded as dotted strings. * * Results: * 0 if equal, -1 if s1 is less than s2, else 1. * * Side effects: * None * *---------------------------------------------------------------------- */ int Util_CompareDotted(const char *s1, const char *s2) { int i, x[5], y[5]; for (i = 0; i < 5; i++) { x[i] = 0; y[i] = 0; } if (sscanf(s1, "%d.%d.%d.%d.%d", &x[0], &x[1], &x[2], &x[3], &x[4]) < 1) { x[0] = 1; } if (sscanf(s2, "%d.%d.%d.%d.%d", &y[0], &y[1], &y[2], &y[3], &y[4]) < 1) { y[0] = 1; } for (i = 0; i < 5; i++) { if (x[i] < y[i]) { return -1; } if (x[i] > y[i]) { return 1; } } return 0; } /* *----------------------------------------------------------------------------- * * Util_GetOpt -- * * A wrapper around getopt_long that avoids needing separate long and * short option lists. * * To use this, the array of option structs must: * * Store the short option name in the 'val' member. * * Set the 'name' member to NULL if the option has a short name but no * long name. * * For options that have only a long name, 'val' should be set to a * unique value greater than UCHAR_MAX. * * Terminate the array with a sentinel value that zero-initializes both * 'name' and 'val'. * * Results: * See getopt_long. * * Side effects: * None * *----------------------------------------------------------------------------- */ int Util_GetOpt(int argc, // IN char * const *argv, // IN const struct option *opts, // IN Util_NonOptMode mode, // IN Bool manualErrorHandling) // IN: True if the caller wants to handle error reporting. { int ret = -1; struct option *longOpts = NULL; char *shortOptString = NULL; /* * In the worst case, each character needs "::" to indicate that it takes * an optional argument. */ const size_t maxCharsPerShortOption = 3; const size_t modePrefixSize = 2; // "[+-][:]" size_t n = 0; size_t shortOptStringSize; while (!(opts[n].name == NULL && opts[n].val == 0)) { if (UNLIKELY(n == SIZE_MAX)) { /* * Avoid integer overflow. If you have this many options, you're * doing something wrong. */ ASSERT(FALSE); goto exit; } n++; } if (UNLIKELY(n > SIZE_MAX / sizeof *longOpts - 1)) { /* Avoid integer overflow. */ ASSERT(FALSE); goto exit; } longOpts = malloc((n + 1) * sizeof *longOpts); if (longOpts == NULL) { goto exit; } if (UNLIKELY(n > (SIZE_MAX - modePrefixSize - 1 /* NUL */) / maxCharsPerShortOption)) { /* Avoid integer overflow. */ ASSERT(FALSE); goto exit; } shortOptStringSize = n * maxCharsPerShortOption + modePrefixSize + 1 /* NUL */; shortOptString = malloc(shortOptStringSize); if (shortOptString == NULL) { goto exit; } else { struct option empty = { 0 }; size_t i; struct option *longOptOut = longOpts; char *shortOptOut = shortOptString; // How to handle non-option arguments. switch (mode) { case UTIL_NONOPT_STOP: *shortOptOut++ = '+'; break; case UTIL_NONOPT_ALL: *shortOptOut++ = '-'; break; default: break; } if (manualErrorHandling) { /* * Make getopt return ':' instead of '?' if required arguments to * options are missing. */ *shortOptOut++ = ':'; } for (i = 0; i < n; i++) { int val = opts[i].val; if (opts[i].name != NULL) { *longOptOut++ = opts[i]; } if (val > 0 && val <= UCHAR_MAX) { int argSpec = opts[i].has_arg; *shortOptOut++ = (char) val; if (argSpec != no_argument) { *shortOptOut++ = ':'; if (argSpec == optional_argument) { *shortOptOut++ = ':'; } } } } ASSERT(longOptOut - longOpts <= n); *longOptOut = empty; ASSERT(shortOptOut - shortOptString < shortOptStringSize); *shortOptOut = '\0'; } ret = getopt_long(argc, argv, shortOptString, longOpts, NULL); exit: free(longOpts); free(shortOptString); return ret; } /* *----------------------------------------------------------------------------- * * Util_HasAdminPriv -- * * Determine if the calling code has administrator privileges --hpreg * * Results: * 1 if yes * 0 if no * <0 on error * * Side effects: * None * *----------------------------------------------------------------------------- */ int Util_HasAdminPriv(void) { #if defined(_WIN32) HANDLE token = INVALID_HANDLE_VALUE; int ret = -1; /* * Retrieve the access token of the calling thread --hpreg * * On some machines OpenThreadToken with openAsSelf set to FALSE fails. * Empirically, it seems that, in the security context of another user * (even when the impersonation token is at SecurityImpersonation level) * it is not able to obtain the thread token with TOKEN_DUPLICATE access. * Calling OpenThreadToken to open as self is more reliable and does not * seem to hurt. -- vui */ if (OpenThreadToken(GetCurrentThread(), TOKEN_DUPLICATE, TRUE, &token) == 0) { if (GetLastError() != ERROR_NO_TOKEN) { ret = -1; goto end; } if (OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE, &token) == 0) { ret = -2; goto end; } } ret = Util_TokenHasAdminPriv(token); end: if (token != INVALID_HANDLE_VALUE) { if (CloseHandle(token) == 0 && ret >= 0) { ret = -13; } } return ret; #else return Id_IsSuperUser() ? 1 : 0; #endif } /* *----------------------------------------------------------------------------- * * Util_DeriveFileName -- * * This function is admittedly weird. The basic idea is that we * have a path to a dictionary file, and we need to make a path to * a another file that's named in a similar way to that dictionary * file (e.g., only difference is extension, or filename and * extension). * * This function returns a pointer to the result * * Results: * Pointer to string (on success, caller should free string), * otherwise NULL. * * Side effects: * Allocates memory to be freed by caller. * *----------------------------------------------------------------------------- */ char * Util_DeriveFileName(const char *source, // IN: path to dict file (incl filename) const char *name, // IN: what to replace filename with (optional) const char *ext) // IN: what to replace extension with (optional) { char *returnResult = NULL; char *path = NULL; char *base = NULL; if (source == NULL || (name == NULL && ext == NULL)) { Warning("invalid use of function\n"); return NULL; } File_GetPathName(source, &path, &base); /* If replacing name and extension */ if (name != NULL) { free(base); /* * If the "name" we have to append is a relative path (i.e., not an * absolute path), then we need to concatenate the "name" to the * path of "source". If the path of "source" doesn't exist or is * just ".", then we don't need to bother with concatenating results * together. */ if (!Util_IsAbsolutePath(name) && strlen(path) > 0 && strcmp(path, ".") != 0) { if (ext == NULL) { returnResult = Str_SafeAsprintf(NULL, "%s%s%s", path, DIRSEPS, name); } else { returnResult = Str_SafeAsprintf(NULL, "%s%s%s.%s", path, DIRSEPS, name, ext); } } else { /* * Path is non-existent or is just the current directory (or the * result from the dictionary is an absolute path), so we * just need to use the filename (using the DIRSEPS method above * for a non-existent path might result in something undesireable * like "\foobar.vmdk") */ if (ext == NULL) { returnResult = Util_SafeStrdup(name); } else { returnResult = Str_SafeAsprintf(NULL, "%s.%s", name, ext); } } free(path); return returnResult; } /* replacing only the file extension */ /* strip off the existing file extension, if present */ { char *p = Str_Strrchr(base, '.'); if (p != NULL) { *p = '\0'; } } /* Combine disk path with parent path */ if (strlen(path) > 0 && strcmp(path, ".") != 0) { returnResult = Str_SafeAsprintf(NULL, "%s%s%s.%s", path, DIRSEPS, base, ext); } else { /* * Path is non-existent or is just the current directory, so we * just need to use the filename (using the DIRSEPS method might * result in something undesireable like "\foobar.vmdk") */ returnResult = Str_SafeAsprintf(NULL, "%s.%s", base, ext); } free(path); free(base); return returnResult; } /* *----------------------------------------------------------------------------- * * Util_CombineStrings -- * * Takes a vector of strings, and combines them into one string, * where each string is separated by a 0 (zero) byte. * * The 0 bytes are then escaped out, and the result is returned. * * Results: * * A NULL terminated string * * Side effects: * * The result string is allocated * *----------------------------------------------------------------------------- */ char * Util_CombineStrings(char **sources, // IN int count) // IN { size_t size = 0; int index = 0; char *combinedString = NULL; char *cursor = NULL; char *escapedString = NULL; int bytesToEsc[256]; ASSERT(sources != NULL); memset(bytesToEsc, 0, sizeof bytesToEsc); bytesToEsc[0] = 1; bytesToEsc['#'] = 1; for (index = 0; index < count; index++) { /* * Count the size of each string + the delimeter */ size += strlen(sources[index]) + 1; } combinedString = Util_SafeMalloc(size); cursor = combinedString; for (index = 0; index < count; index++) { memcpy(cursor, sources[index], strlen(sources[index])); cursor += strlen(sources[index]); cursor[0] = '\0'; cursor++; } escapedString = Escape_Do('#', bytesToEsc, combinedString, size, NULL); free(combinedString); return escapedString; } /* *----------------------------------------------------------------------------- * * Util_SeparateStrings -- * * Takes as input the result of a call to Util_CombineStrings, and * separates the strings back onto a vector of strings. * * Results: * * A vector of strings, the count will also reflect the number of * entries in the vector * * Side effects: * * The vector is allocated, and each string in the vector must be * freed by the caller * *----------------------------------------------------------------------------- */ char ** Util_SeparateStrings(char *source, // IN int *count) // OUT { char *data = NULL; size_t dataSize = 0; int index = 0; char *cursor = NULL; char *endCursor = NULL; char **stringVector = NULL; ASSERT(count != NULL); *count = 0; data = Escape_Undo('#', source, strlen(source), &dataSize); ASSERT(data != NULL); endCursor = data + dataSize; ASSERT(endCursor[0] == '\0'); cursor = data; while (cursor < endCursor) { (*count)++; cursor += strlen(cursor) + 1; } stringVector = Util_SafeMalloc(sizeof(char *) * (*count)); cursor = data; for (index = 0; index < (*count); index++) { stringVector[index] = Util_SafeStrdup(cursor); cursor += strlen(cursor) + 1; } free(data); return stringVector; } open-vm-tools-10.0.7-3227872/lib/user/Makefile.in0000644000000000000000000004042412660700526017451 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/user DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libUser_la_LIBADD = am_libUser_la_OBJECTS = util.lo utilBacktrace.lo libUser_la_OBJECTS = $(am_libUser_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libUser_la_SOURCES) DIST_SOURCES = $(libUser_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libUser.la libUser_la_SOURCES = util.c utilBacktrace.c AM_CFLAGS = @LIB_USER_CPPFLAGS@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/user/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/user/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libUser.la: $(libUser_la_OBJECTS) $(libUser_la_DEPENDENCIES) $(LINK) $(libUser_la_OBJECTS) $(libUser_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utilBacktrace.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/hashMap/0000755000000000000000000000000012660700525016002 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/hashMap/Makefile.am0000644000000000000000000000173512660700525020044 0ustar rootroot################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libHashMap.la libHashMap_la_SOURCES = libHashMap_la_SOURCES += hashMap.c open-vm-tools-10.0.7-3227872/lib/hashMap/Makefile.in0000644000000000000000000004027612660700525020060 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2013-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/hashMap DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libHashMap_la_LIBADD = am_libHashMap_la_OBJECTS = hashMap.lo libHashMap_la_OBJECTS = $(am_libHashMap_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libHashMap_la_SOURCES) DIST_SOURCES = $(libHashMap_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libHashMap.la libHashMap_la_SOURCES = hashMap.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/hashMap/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/hashMap/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libHashMap.la: $(libHashMap_la_OBJECTS) $(libHashMap_la_DEPENDENCIES) $(LINK) $(libHashMap_la_OBJECTS) $(libHashMap_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashMap.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/hashMap/hashMap.c0000644000000000000000000007464712660700525017551 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #include "vm_basic_types.h" #include "vm_assert.h" #include #include #include "hashMap.h" #include "clamped.h" #ifdef VMX86_SERVER #include "aioMgr.h" #include "iovector.h" #endif /* * hashMap.c -- * * This is a map data structure that can store a sparsely indexed data set. * It is not intended to be thread safe nor should it be used in a way that * this may cause problems. * * Entries are stored based on a simple hash of their key. Memory * allocations are kept to a minimum to ensure that this is appropriate for * use in a kernel mode driver. Linear probing is used to resolve hash * collisions. * * This implementation only supports static length keys. It might be * possible to store the keys outside the table and thus support keys of * variable length but this isn't currently planned. This would allow for * string keys for example. * * Callers should not store pointers to objects stored in the map as they may * become invalid as a result of a resize. If you need to share objects * stored as values in the map, then store pointers to the objects instead. * * All objects are copied into the map and must be freed as appropriate by * the caller. * * This particular HashMap has some important differences from the hash table * implementation in bora/lib/misc * - HashMap supports key removal * - HashMap only supports fixed size keys and values while hashTable * supports string and insensitive string keys and only supports pointer * data. This means its possible to store entire data structures in * HashMap. * - HashMap uses linear probing to resolve collisions while hashTable uses * chaining. HashMap will dynamically resize itself as necessary. * - Pointers to HashMap values will be invalidated if the internal structure * is resized. If this is a problem, you should store the pointer in the * HashMap rather than the object itself. * - HashMap will ensure that a maximum load factor is not exceeded. * * hashMap is now restrictd to userworld applications on ESX builds ONLY. * See PR 817760 which has an attached patchfile to remove this limitation * if in future that is felt to be desireable. */ #define HASHMAP_DEFAULT_ALPHA 2 struct HashMap { uint8 *entries; uint32 numEntries; uint32 count; uint32 alpha; size_t keySize; size_t dataSize; size_t entrySize; size_t keyOffset; size_t dataOffset; }; #ifdef VMX86_SERVER typedef #include "vmware_pack_begin.h" struct HashMapOnDisk { uint32 numEntries; uint32 count; uint32 alpha; uint64 keySize; uint64 dataSize; uint64 entrySize; uint64 keyOffset; uint64 dataOffset; } #include "vmware_pack_end.h" HashMapOnDisk; #endif typedef enum { HashMapState_EMPTY = 0, HashMapState_FILLED, HashMapState_DELETED, } HashMapEntryState; typedef struct { uint32 state; uint32 hash; } HashMapEntryHeader; #define NO_FREE_INDEX ((uint32) -1) static Bool InitMap(struct HashMap *map, uint32 numEntries, uint32 alpha, size_t keySize, size_t dataSize); static void CalculateEntrySize(struct HashMap *map); static void GetEntry(struct HashMap *map, uint32 index, HashMapEntryHeader **header, void **key, void **data); static uint32 ComputeHash(struct HashMap *map, const void *key); static Bool LookupKey(struct HashMap* map, const void *key, HashMapEntryHeader **header, void **data, uint32 *freeIndex); static Bool CompareKeys(struct HashMap *map, const void *key, const void *compare); static Bool NeedsResize(struct HashMap *map); static void Resize(struct HashMap *map); INLINE void EnsureSanity(HashMap *map); /* * ---------------------------------------------------------------------------- * * CheckSanity -- * * Same code as EnsureSanity except return Bool instead of ASSERTing * * Results: * TRUE is sane. * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ static INLINE Bool CheckSanity(HashMap *map) { #ifdef VMX86_DEBUG uint32 i, cnt = 0; ASSERT(map); for (i = 0; i < map->numEntries; i++) { HashMapEntryHeader *header = NULL; void *key, *data; GetEntry(map, i, &header, &key, &data); ASSERT(header); ASSERT(header->state == HashMapState_FILLED || header->state == HashMapState_EMPTY || header->state == HashMapState_DELETED); if (header->state == HashMapState_FILLED) { cnt++; if (header->hash != ComputeHash(map, key)) { return FALSE; } } } if (cnt != map->count) { return FALSE; } if (!map->numEntries) { return FALSE; } #endif return TRUE; } /* * ---------------------------------------------------------------------------- * * HashMap_AllocMap -- * * Allocate a map and the space for the entries. * * Results: * Returns a pointer to a HashMap or NULL on failure. * * Side Effects: * Allocates memory. * * ---------------------------------------------------------------------------- */ struct HashMap* HashMap_AllocMap(uint32 numEntries, // IN size_t keySize, // IN size_t dataSize) // IN { return HashMap_AllocMapAlpha(numEntries, HASHMAP_DEFAULT_ALPHA, keySize, dataSize); } /* * ---------------------------------------------------------------------------- * * HashMap_AllocMapAlpha -- * * Allocate a map and the space for the entries. The value of alpha is * treated as a denominator for the maximum allowable load factor. I.e. an * alpha value of 2 would correspond to a maximum load factor of 0.5. The * map will be enlarged when elements are added in order to maintain this * load factor. * * Results: * Returns a pointer to a HashMap or NULL on failure. * * Side Effects: * Allocates memory. * * ---------------------------------------------------------------------------- */ struct HashMap* HashMap_AllocMapAlpha(uint32 numEntries, // IN uint32 alpha, // IN size_t keySize, // IN size_t dataSize) // IN { struct HashMap *map; map = calloc(1, sizeof *map); ASSERT(alpha); if (map) { if (!InitMap(map, numEntries, alpha, keySize, dataSize)) { HashMap_DestroyMap(map); return NULL; } } return map; } /* * ---------------------------------------------------------------------------- * * HashMap_DestroyMap -- * * Destroy a HashMap, clear out all the entries and free the memory. * * Results: * None. * * Side Effects: * Frees memory. * * ---------------------------------------------------------------------------- */ void HashMap_DestroyMap(struct HashMap *map) // IN { if (map) { free(map->entries); } free(map); } /* * ---------------------------------------------------------------------------- * * InitMap -- * * Initializes a map's internal structure. The value of alpha is treated * as a denominator for the maximum allowable load factor. I.e. an alpha * value of 2 would correspond to a maximum load factor of 0.5. The map * will be enlarged when elements are added in order to maintain this load * factor. * * Results: * Returns TRUE on success or FALSE if the memory allocation failed. * * Side Effects: * Allocates memory. * * ---------------------------------------------------------------------------- */ static Bool InitMap(struct HashMap *map, // IN uint32 numEntries, // IN uint32 alpha, // IN size_t keySize, // IN size_t dataSize) // IN { ASSERT(map); ASSERT(alpha); ASSERT(numEntries); /* * Ensure that the entries map is at least large enough to hold all of the * entries that were requested taking into account the alpha factor. */ numEntries *= alpha; map->numEntries = numEntries; map->alpha = alpha; map->keySize = keySize; map->dataSize = dataSize; CalculateEntrySize(map); map->entries = calloc(numEntries, map->entrySize); if (map->entries) { EnsureSanity(map); } return map->entries != NULL; } /* * ---------------------------------------------------------------------------- * * HashMap_Put -- * * Put the value at data against the key. This will replace any existing * data that is in the table without warning. * * Results: * TRUE if the put operation is successful * FALSE otherwise * * Side Effects: * The value in data is copied to the table and can be referenced in the * future by the value in key. * * ---------------------------------------------------------------------------- */ Bool HashMap_Put(struct HashMap *map, // IN const void *key, // IN const void *data) // IN { uint32 freeIndex; HashMapEntryHeader *header; void *tableData; if (!LookupKey(map, key, &header, &tableData, &freeIndex)) { uint32 hash = ComputeHash(map, key); void *tableKey; if (NeedsResize(map)) { Resize(map); if (LookupKey(map, key, &header, &tableData, &freeIndex)) { /* * Somehow our key appeared after resizing the table. */ ASSERT(FALSE); } if (freeIndex == NO_FREE_INDEX) { /* * The resize must have failed. */ return FALSE; } } map->count++; GetEntry(map, freeIndex, &header, &tableKey, &tableData); ASSERT(header); header->state = HashMapState_FILLED; header->hash = hash; memcpy(tableKey, key, map->keySize); } ASSERT(data || map->dataSize == 0); memcpy(tableData, data, map->dataSize); EnsureSanity(map); return TRUE; } /* * ---------------------------------------------------------------------------- * * HashMap_Get -- * * Get the value corresponding to the given key. * * Results: * Returns a pointer to the data that was previously stored by HashMap_Put or * NULL if the key wasn't found. * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ void * HashMap_Get(struct HashMap *map, // IN const void *key) // IN { void *data; uint32 freeIndex; HashMapEntryHeader *header; if (LookupKey(map, key, &header, &data, &freeIndex)) { return data; } return NULL; } /* * ---------------------------------------------------------------------------- * * HashMap_Clear -- * * Remove all entries from the HashMap. * * Results: * None. * * Side Effects: * All entries in the map are removed. * * ---------------------------------------------------------------------------- */ void HashMap_Clear(struct HashMap *map) // IN { int i = 0; HashMapEntryHeader *header; void *key, *data; ASSERT(map); for (i = 0; i < map->numEntries; i++) { GetEntry(map, i, &header, &key, &data); ASSERT(header); header->state = HashMapState_EMPTY; } map->count = 0; EnsureSanity(map); } /* * ---------------------------------------------------------------------------- * * HashMap_Remove -- * * Remove an entry from the map. * * Results: * Returns TRUE if the entry was in the map, FALSE if the entry was not in * the map. * * Side Effects: * The entry is removed from the map. * * ---------------------------------------------------------------------------- */ Bool HashMap_Remove(struct HashMap *map, // IN const void *key) // IN { uint32 freeIndex; HashMapEntryHeader *header; void *tableData; if (!LookupKey(map, key, &header, &tableData, &freeIndex)) { return FALSE; } /* * XXX: This could be made slightly smarter. We could check the next entry * to see if it's EMPTY and then mark this one as empty as well. */ map->count--; header->state = HashMapState_DELETED; EnsureSanity(map); return TRUE; } /* * ---------------------------------------------------------------------------- * * HashMap_Count -- * * Returns the current count of entries in the map. * * Results: * The current count of entries in the map. * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ uint32 HashMap_Count(struct HashMap *map) // IN { return map->count; } #ifdef VMX86_SERVER /* * ---------------------------------------------------------------------------- * * HashMap_Store -- * * Write the contents of the HashMap to the given AIOhandle * * Results: * The number of bytes written on success -1 on error * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ uint64 HashMap_Store(struct HashMap *map, // IN void *h, // IN uint64 startByteOffset) // IN { AIOHandle *handle = (AIOHandle *)h; AIOMgrError aioErr; struct iovec vec; uint64 numBytes; struct HashMapOnDisk hashMapOnDisk; hashMapOnDisk.numEntries = map->numEntries; hashMapOnDisk.count = map->count; hashMapOnDisk.alpha = map->alpha; hashMapOnDisk.keySize = map->keySize; hashMapOnDisk.dataSize = map->dataSize; hashMapOnDisk.entrySize = map->entrySize; hashMapOnDisk.keyOffset = map->keyOffset; hashMapOnDisk.dataOffset = map->dataOffset; /* * write map */ vec.iov_base = (void *)&hashMapOnDisk; vec.iov_len = sizeof hashMapOnDisk; numBytes = vec.iov_len; aioErr = AIOMgr_Queue(*handle, &vec, 1, OP_WRITE, startByteOffset, numBytes, AIOMGR_INVALID_IO_REQUEST_ID, NULL, NULL); ASSERT(!AIOMgr_IsAsync(aioErr)); if (!AIOMgr_IsSuccess(aioErr)) { return -1; } /* * write map entries */ vec.iov_base = (void *)map->entries; vec.iov_len = map->numEntries * map->entrySize; aioErr = AIOMgr_Queue(*handle, &vec, 1, OP_WRITE, startByteOffset + numBytes, vec.iov_len, AIOMGR_INVALID_IO_REQUEST_ID, NULL, NULL); ASSERT(!AIOMgr_IsAsync(aioErr)); if (!AIOMgr_IsSuccess(aioErr)) { return -1; } return numBytes + (map->numEntries * map->entrySize); } /* * ---------------------------------------------------------------------------- * * HashMap_Retrieve -- * * Read the contents of the HashMap from the given AIOhandle * * Results: * The allocated map * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ struct HashMap * HashMap_Retrieve(void *h, // IN uint32 numEntries, // IN uint64 startByteOffset, // IN uint64 *retNumBytes) // OUT { AIOMgrError aioErr = AIOMgr_MakeError(AIOERR_RDONLY, 0); struct iovec vec; uint64 numBytes; struct HashMap *map; struct HashMapOnDisk hashMapOnDisk; AIOHandle *handle = (AIOHandle *)h; map = calloc(1, sizeof *map); /* * read map */ vec.iov_base = (void *)&hashMapOnDisk; vec.iov_len = sizeof hashMapOnDisk; numBytes = vec.iov_len; if (handle) { aioErr = AIOMgr_Queue(*handle, &vec, 1, OP_READ, startByteOffset, numBytes, AIOMGR_INVALID_IO_REQUEST_ID, NULL, NULL); ASSERT(!AIOMgr_IsAsync(aioErr)); } if (!AIOMgr_IsSuccess(aioErr)) { free(map); map = HashMap_AllocMapAlpha(numEntries, 1, sizeof(int32), sizeof(int32)); *retNumBytes = sizeof(hashMapOnDisk) + (map->numEntries * map->entrySize); return map; } if (!hashMapOnDisk.numEntries) { free(map); map = HashMap_AllocMapAlpha(numEntries, 1, sizeof(int32), sizeof(int32)); *retNumBytes = sizeof(hashMapOnDisk) + (map->numEntries * map->entrySize); return map; } map->numEntries = hashMapOnDisk.numEntries; map->count = hashMapOnDisk.count; map->alpha = hashMapOnDisk.alpha; map->keySize = hashMapOnDisk.keySize; map->dataSize = hashMapOnDisk.dataSize; map->entrySize = hashMapOnDisk.entrySize; map->keyOffset = hashMapOnDisk.keyOffset; map->dataOffset = hashMapOnDisk.dataOffset; /* * read map entries */ map->entries = calloc(map->numEntries, map->entrySize); vec.iov_base = (void *)map->entries; vec.iov_len = map->numEntries * map->entrySize; ASSERT(handle); aioErr = AIOMgr_Queue(*handle, &vec, 1, OP_READ, startByteOffset + numBytes, vec.iov_len, AIOMGR_INVALID_IO_REQUEST_ID, NULL, NULL); ASSERT(!AIOMgr_IsAsync(aioErr)); if (!AIOMgr_IsSuccess(aioErr)) { free(map->entries); free(map); return NULL; } *retNumBytes = numBytes + (map->numEntries * map->entrySize); if (!CheckSanity(map)) { free(map->entries); free(map); return NULL; } return map; } #else /* * ---------------------------------------------------------------------------- * * HashMap_Store -- * * Stub for non server targets * * Results: * None * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ uint64 HashMap_Store(struct HashMap *map, // IN void *h, // IN uint64 startByteOffset) // IN { ASSERT(0); return -1; } /* * ---------------------------------------------------------------------------- * * HashMap_Retrieve -- * * Stub for non-server targets * * Results: * None * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ struct HashMap * HashMap_Retrieve(void *h, // IN uint32 numEntries, // IN uint64 startByteOffset, // IN uint64 *retNumBytes) // OUT { ASSERT(0); return NULL; } #endif /* * ---------------------------------------------------------------------------- * * CalculateEntrySize -- * * Calculate the size of the entry and the offsets to the key and data. * * Results: * None. * * Side Effects: * The map structure is adjusted to contain the correct sizes. * * ---------------------------------------------------------------------------- */ void CalculateEntrySize(struct HashMap *map) // IN { size_t alignKeySize, alignDataSize; size_t alignKeyOffset, alignDataOffset; ASSERT(map); alignKeySize = ROUNDUP(map->keySize, 4); alignDataSize = ROUNDUP(map->dataSize, 4); alignKeyOffset = sizeof (HashMapEntryHeader); alignDataOffset = ROUNDUP(alignKeyOffset + alignKeySize, 4); map->entrySize = sizeof (HashMapEntryHeader) + alignKeySize + alignDataSize; map->keyOffset = alignKeyOffset; map->dataOffset = alignDataOffset; } /* * ---------------------------------------------------------------------------- * * LookupKey -- * * Use linear probing to find a free space in the table or the data that * we're interested in. * * Returns: * - TRUE if the key was found in the table, FALSE otherwise. * - Returns the entry header on header, data pointer on data and the first * non-filled index that was encountered on freeIndex * * Side Effects: * - Header and Data are changed. They should only be considered valid if * the key was found. * - FreeIndex will be updated to point to the first non-filled index. * * ---------------------------------------------------------------------------- */ Bool LookupKey(struct HashMap* map, // IN const void *key, // IN HashMapEntryHeader **header, // OUT void **data, // OUT uint32 *freeIndex) // OUT { uint32 hash = ComputeHash(map, key); uint32 index = hash % map->numEntries; uint32 probe = 0; Bool done = FALSE, found = FALSE; void *tableKey; ASSERT(map); ASSERT(key); ASSERT(data); ASSERT(freeIndex); *freeIndex = NO_FREE_INDEX; while (!done && probe < map->numEntries + 1) { uint32 currentIndex = (index + probe) % map->numEntries; GetEntry(map, currentIndex, header, &tableKey, data); ASSERT(header); switch ((*header)->state) { case HashMapState_EMPTY: done = TRUE; /* FALL THROUGH */ case HashMapState_DELETED: /* * We're not done if we've found a deleted space. This may just mean * that the entry was deleted but that the target entry may appear * later. */ if (*freeIndex == NO_FREE_INDEX) { *freeIndex = currentIndex; } break; case HashMapState_FILLED: if ((*header)->hash == hash) { found = CompareKeys(map, key, tableKey); if (found) { done = TRUE; } } break; default: NOT_REACHED(); } probe++; } ASSERT(found || *freeIndex != NO_FREE_INDEX || map->count == map->numEntries); return found; } /* * ---------------------------------------------------------------------------- * * GetEntry -- * * Get a specific entry from the entries list. This does not perform any * hash compare, it's a simple index based lookup. * * Results: * The header is stored in header, key in key and the data in data. These * are all direct pointers into the table. * * Side Effects: * The header, key and data pointers are modified. * * ---------------------------------------------------------------------------- */ void GetEntry(struct HashMap *map, // IN uint32 index, // IN HashMapEntryHeader **header, // OUT void **key, // OUT void **data) // OUT { uint8 *entry; ASSERT(map); ASSERT(header); ASSERT(key); ASSERT(data); ASSERT(index < map->numEntries); entry = ((uint8 *)map->entries) + (map->entrySize * index); ASSERT(entry); *header = (HashMapEntryHeader *) (entry); *key = (void*) (entry + map->keyOffset); *data = (void*) (entry + map->dataOffset); } /* * ---------------------------------------------------------------------------- * * ComputeHash -- * * Compute the hash of the given key. * * Results: * An opaque hash value based on the given key. Given the same key in the * same map, this function will always return the same value. * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ uint32 ComputeHash(struct HashMap *map, // IN const void *key) // IN { /* * djb2, with n == 33. See http://www.cse.yorku.ca/~oz/hash.html. * * This hash function is largely borrowed from the emmet library in bora/lib * This hash table implementation does a hash compare before comparing the * keys so it's inappropriate for the hash function to take the modulo before * returning. */ uint32 h = 5381; const uint8 *keyByte; size_t i = 0; for (keyByte = key, i = 0; i < map->keySize; keyByte++, i++) { h *= 33; h += *keyByte; } return h; } /* * ---------------------------------------------------------------------------- * * CompareKeys -- * * Compare two keys to one another. * * Results: * Returns TRUE if the two keys are binary equal over the length specified * in the map. FALSE if the two keys are different. * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ Bool CompareKeys(struct HashMap *map, // IN const void *key, // IN const void *compare) // IN { return memcmp(key, compare, map->keySize) == 0; } /* * ---------------------------------------------------------------------------- * * NeedsResize -- * * Determine if adding another element to the map will require that the map * be resized. This takes into account the maximum load factor that is * allowed for this map. * * Results: * Returns TRUE if the map should be resized. * * Side Effects: * None. * * ---------------------------------------------------------------------------- */ Bool NeedsResize(struct HashMap *map) { uint32 required; Clamped_UMul32(&required, map->count, map->alpha); return required >= map->numEntries; } /* * ---------------------------------------------------------------------------- * * Resize -- * * Doubles the size of the entries array until it is at least large enough * to ensure the maximum load factor is not exceeded. * * Results: * None. * * Side Effects: * The entries list is doubled in size and the entries are copied into the * appropriate location. Callers should not assume that the locations that * were valid before this was called are still valid as all entries may * appear at different locations after this function completes. * * ---------------------------------------------------------------------------- */ void Resize(struct HashMap *map) // IN { struct HashMap oldHashMap = *map; int i; if (map->numEntries == MAX_UINT32) { if (map->count < MAX_UINT32) { /* * We're already at the maximum size of the array and there's still * room for the new entry, don't bother resizing. */ return; } else { /* * This situation is fatal, though we're unlikely to ever hit this with * realistic usage. */ Panic("Ran out of room in the hashtable\n"); } } /* * We might, at some point, want to look at making this grow geometrically * until we hit some threshold and then grow arithmetically after that. To * keep it simple for now, however, we'll just grow geometrically all the * time. */ map->entries = calloc(oldHashMap.numEntries * 2, oldHashMap.entrySize); if (!map->entries) { map->entries = oldHashMap.entries; return; } do { if (!Clamped_UMul32(&map->numEntries, map->numEntries, 2)) { /* Prevent overflow and */ break; } } while (NeedsResize(map)); map->count = 0; for (i = 0; i < oldHashMap.numEntries; i++) { HashMapEntryHeader *oldHeader; HashMapEntryHeader *newHeader; void *oldKey; void *oldData; void *newKey; void *newData; uint32 freeIndex; GetEntry(&oldHashMap, i, &oldHeader, &oldKey, &oldData); switch (oldHeader->state) { case HashMapState_EMPTY: case HashMapState_DELETED: continue; case HashMapState_FILLED: if (!LookupKey(map, oldKey, &newHeader, &newData, &freeIndex)) { GetEntry(map, freeIndex, &newHeader, &newKey, &newData); newHeader->hash = oldHeader->hash; newHeader->state = HashMapState_FILLED; memcpy(newKey, oldKey, map->keySize); memcpy(newData, oldData, map->dataSize); map->count++; } else { /* * There is only one way that this could happen; the key is in the * old map twice. That's clearly an error. */ ASSERT(FALSE); continue; } } } ASSERT(oldHashMap.count == map->count); free(oldHashMap.entries); EnsureSanity(map); } /* * ---------------------------------------------------------------------------- * * HashMap_Iterate -- * * Iterate over the contents of the map, optionally clearing each entry as * it's passed. * * Results: * None. * * Side Effects: * itFn is called for each entry in the hashMap until. If clear is TRUE, * each entry will be removed from the map after it has been seen by the * iterator function. * * ---------------------------------------------------------------------------- */ void HashMap_Iterate(HashMap *map, // IN HashMapIteratorFn itFn, // IN Bool clear, // IN void *userData) // IN/OUT { int i = 0; HashMapEntryHeader *header; void *key, *data; ASSERT(map); ASSERT(itFn); for (i = 0; i < map->numEntries; i++) { GetEntry(map, i, &header, &key, &data); if (header->state == HashMapState_FILLED) { itFn(key, data, userData); if (clear) { map->count--; } } if (clear) { header->state = HashMapState_EMPTY; } } ASSERT(map->count == 0 || !clear); } /* * ---------------------------------------------------------------------------- * * EnsureSanity -- * * Ensure that the HashMap contents are still sane. That is, each entry has * a correctly computed hash, the count is correct and the header states are * valid for all entries. This should be called at the end of every * function which modifies the map. * * Results: * None. * * Side Effects: * Fails an assert if the contents are incorrect. * * ---------------------------------------------------------------------------- */ void EnsureSanity(HashMap *map) { ASSERT(CheckSanity(map) == TRUE); } open-vm-tools-10.0.7-3227872/lib/dict/0000755000000000000000000000000012660700525015344 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/dict/Makefile.am0000644000000000000000000000172312660700525017403 0ustar rootroot################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libDict.la libDict_la_SOURCES = libDict_la_SOURCES += dictll.c open-vm-tools-10.0.7-3227872/lib/dict/dictll.c0000644000000000000000000003654512660700525017000 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * dictll.c -- * * Low-level dictionary format --hpreg */ #include #include #include #include #include "vmware.h" #include "vmstdio.h" #include "escape.h" #include "dictll.h" #include "util.h" #define UTF8_BOM "\xEF\xBB\xBF" /* Duplicate a buffer --hpreg. The result is NUL-terminated */ static void * BufDup(void const * const bufIn, // IN: buffer to duplicate unsigned int const sizeIn) // IN: buffer size in bytes { char *bufOut; ASSERT(bufIn); bufOut = Util_SafeMalloc(sizeIn + 1); memcpy(bufOut, bufIn, sizeIn); bufOut[sizeIn] = '\0'; return bufOut; } /* *----------------------------------------------------------------------------- * * Walk -- * * While 'bufIn' points to a byte in 'sentinel', increment it --hpreg * * Note: * If your 'bufIn' is a NUL-terminated C string, you should rather make sure * that the NUL byte is not in your 'sentinel' * * Results: * The new 'buf' * * Side effects: * None * *----------------------------------------------------------------------------- */ static void const * Walk(void const * const bufIn, // IN int const * const sentinel) // IN { char const *buf; buf = (char const *)bufIn; ASSERT(buf); /* Unsigned does matter --hpreg */ while (sentinel[(unsigned char)*buf]) { buf++; } return buf; } /* XXX document the escaping/unescaping process: rationale for which chars we escape, and how we escape --hpreg */ /* * The dictionary line format: * * = * or * = " " * * where * does not contain any whitespace or = or # * does not contain any double-quote or # * does not contain any double-quote * begins with # and ends at the end of the line * is a sequence spaces and/or tabs * and are optional */ /* *----------------------------------------------------------------------------- * * DictLL_UnmarshalLine -- * * Reads a line from the bufSize-byte buffer buf, which holds one or more * new-line delimited lines. The buffer is not necessarily * null-terminated. * * Results: * The beginning of the next line if a line was successfully parsed. In * that case, '*line' is the allocated line. If the line is well-formed, * then '*name' and '*value' are allocated strings. Otherwise they are * both NULL. * * A null pointer at the end of the buffer, in which case *line, *name, * and *value are set to null pointers. * * Side effects: * Advances *buf to the beginning of the next line. * *----------------------------------------------------------------------------- */ const char * DictLL_UnmarshalLine(const char *buf, // IN: buffer to parse size_t bufSize, // IN: buffer size in bytes char **line, // OUT: malloc()'d entire line char **name, // OUT: malloc()'d name or NULL char **value) // OUT: malloc()'d value or NULL { /* Space and tab --hpreg */ static int const ws_in[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* Everything but NUL, space, tab and pound --hpreg */ static int const wsp_out[] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 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, 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, 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, }; /* Everything but NUL, space, tab, pound and equal --hpreg */ static int const wspe_out[] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 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, 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, 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, 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, }; /* Everything but NUL and double quote --hpreg */ static int const q_out[] = { 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, 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, 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, 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, }; char const *nBegin; char const *nEnd; char const *vBegin; char const *vEnd; char const *tmp; char *myLine; char *myName; char *myValue; const char *lineEnd; const char *nextLine; ASSERT(buf); ASSERT(line); ASSERT(name); ASSERT(value); /* Check for end of buffer. */ if (bufSize == 0) { *line = NULL; *name = NULL; *value = NULL; return NULL; } /* Find end of this line, beginning of next. */ lineEnd = memchr(buf, '\n', bufSize); if (lineEnd != NULL) { nextLine = lineEnd + 1; } else { nextLine = lineEnd = buf + bufSize; } /* Make local copy of line. */ myLine = BufDup(buf, lineEnd - buf); /* Check if the line is well-formed --hpreg */ nBegin = Walk(myLine, ws_in); nEnd = Walk(nBegin, wspe_out); tmp = Walk(nEnd, ws_in); if (nBegin == nEnd || *tmp != '=') { goto weird; } tmp++; tmp = Walk(tmp, ws_in); if (*tmp == '"') { tmp++; vBegin = tmp; vEnd = Walk(vBegin, q_out); tmp = vEnd; if (*tmp != '"') { goto weird; } tmp++; } else { vBegin = tmp; vEnd = Walk(vBegin, wsp_out); tmp = vEnd; } tmp = Walk(tmp, ws_in); if (*tmp != '\0' && *tmp != '#') { goto weird; } /* The line is well-formed. Extract the name and value --hpreg */ myName = BufDup(nBegin, nEnd - nBegin); myValue = Escape_Undo('|', vBegin, vEnd - vBegin, NULL); VERIFY(myValue); *line = myLine; *name = myName; *value = myValue; return nextLine; weird: /* The line is not well-formed. Let the upper layers handle it --hpreg */ *line = myLine; *name = NULL; *value = NULL; return nextLine; } /* *----------------------------------------------------------------------------- * * DictLL_ReadLine -- * * Read the next line from a dictionary file --hpreg * * Results: * 2 on success: '*line' is the allocated line * If the line is well-formed, then '*name' and '*value' are * allocated strings. Otherwise they are both NULL. * 1 if there is no next line (end of stream) * 0 on failure: errno is set accordingly * * Side effects: * None * *----------------------------------------------------------------------------- */ int DictLL_ReadLine(FILE *stream, // IN: stream to read char **line, // OUT: malloc()'d line or null pointer char **name, // OUT: malloc()'d name or null pointer char **value) // OUT: malloc()'d value or null pointer { char *myLine; size_t myLineLen; ASSERT(stream); ASSERT(line); ASSERT(name); ASSERT(value); *line = NULL; *name = NULL; *value = NULL; switch (StdIO_ReadNextLine(stream, &myLine, 0, &myLineLen)) { case StdIO_Error: return 0; case StdIO_EOF: return 1; case StdIO_Success: if (DictLL_UnmarshalLine(myLine, myLineLen, line, name, value) == NULL) { *line = BufDup("", 0); } free(myLine); return 2; default: NOT_IMPLEMENTED(); } NOT_REACHED(); } /* *----------------------------------------------------------------------------- * * DictLL_MarshalLine -- * * Marshals a line, appending the data to a DynBuf. If 'name' is NULL, * '*value' contains the whole line to write verbatim. Otherwise a proper * name/value pair is written. * * Results: * TRUE on success, FALSE on failure (caused by memory allocation failure). * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool DictLL_MarshalLine(DynBuf *output, // IN/OUT: output buffer char const *name, // IN/OPT: name to marshal char const *value) // IN: value to marshal { size_t size; if (name) { /* * Double quote, pipe, 0x7F, and all control characters but * tab --hpreg * 0x80 to 0xff are unescaped so characters in encodings * like UTF-8 will be displayed normally. */ static int const toEscape[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; char *evalue; /* Write a well-formed line --hpreg */ evalue = Escape_Do('|', toEscape, value, (uint32)strlen(value), &size); if ( !DynBuf_Append(output, name, (uint32)strlen(name)) || !DynBuf_Append(output, " = \"", 4) || (size && !DynBuf_Append(output, evalue, size)) || !DynBuf_Append(output, "\"", 1)) { free(evalue); return FALSE; } free(evalue); } else { /* Write the line as passed from the upper layers --hpreg */ size = (uint32)strlen(value); if (size && !DynBuf_Append(output, value, size)) { return FALSE; } } /* * Win32 takes care of adding the \r (XXX this assumes that the stream * is opened in ascii mode) --hpreg */ if (!DynBuf_Append(output, "\n", 1)) { return FALSE; } return TRUE; } /* *----------------------------------------------------------------------------- * * DictLL_WriteLine -- * * Marshals a line, writing the data to a file. If 'name' is NULL, '*value' * contains the whole line to write verbatim. Otherwise a proper name/value * pair is written. * * Results: * TRUE on success * FALSE on failure: errno is set accordingly * * Side effects: * None * *----------------------------------------------------------------------------- */ Bool DictLL_WriteLine(FILE *stream, // IN: stream to write char const *name, // IN: name to write char const *value) // IN: value to write { DynBuf buf; DynBuf_Init(&buf); if (!DictLL_MarshalLine(&buf, name, value)) { DynBuf_Destroy(&buf); errno = ENOMEM; return FALSE; } if (fwrite(DynBuf_Get(&buf), DynBuf_GetSize(&buf), 1, stream) != 1) { DynBuf_Destroy(&buf); return FALSE; } DynBuf_Destroy(&buf); return TRUE; } /* *----------------------------------------------------------------------------- * * DictLL_ReadUTF8BOM -- * * Reads a UTF-8 BOM from a file. * * Results: * If successful, returns TRUE and updates the file position. * Returns FALSE if a UTF-8 BOM was not found. * * Side effects: * Might clears the error indicator of the file stream. * *----------------------------------------------------------------------------- */ Bool DictLL_ReadUTF8BOM(FILE *file) // IN/OUT { Bool found; // sizeof on a string literal counts NUL. Exclude it. char buf[sizeof UTF8_BOM - 1] = { 0 }; if (file == stdin) { return FALSE; } found = fread(buf, sizeof buf, 1, file) == 1 && memcmp(UTF8_BOM, buf, sizeof buf) == 0; if (!found) { rewind(file); } return found; } open-vm-tools-10.0.7-3227872/lib/dict/Makefile.in0000644000000000000000000004021312660700525017411 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2007-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/dict DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libDict_la_LIBADD = am_libDict_la_OBJECTS = dictll.lo libDict_la_OBJECTS = $(am_libDict_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libDict_la_SOURCES) DIST_SOURCES = $(libDict_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libDict.la libDict_la_SOURCES = dictll.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/dict/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/dict/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libDict.la: $(libDict_la_OBJECTS) $(libDict_la_DEPENDENCIES) $(LINK) $(libDict_la_OBJECTS) $(libDict_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dictll.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/glibUtils/0000755000000000000000000000000012660700525016357 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/glibUtils/fileLogger.c0000644000000000000000000003076012660700525020610 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file fileLogger.c * * Logger that uses file streams and provides optional log rotation. */ #include "glibUtils.h" #include #include #include #if defined(G_PLATFORM_WIN32) # include # include #else # include # include #endif typedef struct FileLogger { GlibLogger handler; GIOChannel *file; gchar *path; gint logSize; guint64 maxSize; guint maxFiles; gboolean append; gboolean error; GStaticMutex lock; } FileLogger; #if !defined(_WIN32) /* ******************************************************************************* * FileLoggerIsValid -- */ /** * * Checks that the file descriptor backing this logger is still valid. * * This is a racy workaround for an issue with glib code; or, rather, two * issues. The first issue is that we can't intercept G_LOG_FLAG_RECURSION, * and glib just aborts when that happens (see gnome bug 618956). The second * is that if a GIOChannel channel write fails, that calls * g_io_channel_error_from_errno, which helpfully logs stuff, causing recursion. * Don't get me started on why that's, well, at least questionable. * * This is racy because between the check and the actual GIOChannel operation, * the state of the FD may have changed. In reality, since the bug this is * fixing happens in very special situations where code outside this file is * doing weird things like closing random fds, it should be OK. * * We may still get other write errors from the GIOChannel than EBADF, but * those would be harder to work around. Hopefully this handles the most usual * cases. * * See bug 783999 for some details about what triggers the bug. * * @param[in] logger The logger instance. * * @return TRUE if the I/O channel is still valid. * ******************************************************************************* */ static gboolean FileLoggerIsValid(FileLogger *logger) { if (logger->file != NULL) { int fd = g_io_channel_unix_get_fd(logger->file); return fcntl(fd, F_GETFD) >= 0; } return FALSE; } #else #define FileLoggerIsValid(logger) TRUE #endif /* * This function is a temporary workaround for a broken glib version * 2.42.2 that is missing g_get_user_name_utf8 export. After glib * is fixed this needs to be removed and call to GlibGetUserName * replaced by g_get_user_name. See bug 1434059 for details. */ const char* GlibGetUserName() { #if !defined(_WIN32) return g_get_user_name(); #else wchar_t buffer[256] = { 0 }; DWORD len = ARRAYSIZE(buffer); static char* user_name_utf8 = NULL; if (!user_name_utf8) { if (GetUserNameW(buffer, &len)) { user_name_utf8 = g_utf16_to_utf8(buffer, -1, NULL, NULL, NULL); } } return user_name_utf8; #endif } /* ******************************************************************************* * FileLoggerGetPath -- */ /** * * Parses the given template file name and expands embedded variables, and * places the log index information at the right position. * * The following variables are expanded: * * - ${USER}: user's login name. * - ${PID}: current process's pid. * - ${IDX}: index of the log file (for rotation). * * @param[in] data Log handler data. * @param[in] index Index of the log file. * * @return The expanded log file path. * ****************************************************************************** */ static gchar * FileLoggerGetPath(FileLogger *data, gint index) { gboolean hasIndex = FALSE; gchar indexStr[11]; gchar *logpath; gchar *vars[] = { "${USER}", NULL, "${PID}", NULL, "${IDX}", indexStr, }; gchar *tmp; size_t i; logpath = g_strdup(data->path); vars[1] = (char *) GlibGetUserName(); vars[3] = g_strdup_printf("%u", (unsigned int) getpid()); g_snprintf(indexStr, sizeof indexStr, "%d", index); for (i = 0; i < G_N_ELEMENTS(vars); i += 2) { char *last = logpath; char *start; while ((start = strstr(last, vars[i])) != NULL) { gchar *tmp; char *end = start + strlen(vars[i]); size_t offset = (start - last) + strlen(vars[i+1]); *start = '\0'; tmp = g_strdup_printf("%s%s%s", logpath, vars[i+1], end); g_free(logpath); logpath = tmp; last = logpath + offset; /* XXX: ugly, but well... */ if (i == 4) { hasIndex = TRUE; } } } g_free(vars[3]); /* * Always make sure we add the index if it's not 0, since that's used for * backing up old log files. */ if (index != 0 && !hasIndex) { char *sep = strrchr(logpath, '.'); char *pathsep = strrchr(logpath, '/'); if (pathsep == NULL) { pathsep = strrchr(logpath, '\\'); } if (sep != NULL && sep > pathsep) { *sep = '\0'; sep++; tmp = g_strdup_printf("%s.%d.%s", logpath, index, sep); } else { tmp = g_strdup_printf("%s.%d", logpath, index); } g_free(logpath); logpath = tmp; } return logpath; } /* ******************************************************************************* * FileLoggerOpen -- */ /** * * Opens a log file for writing, backing up the existing log file if one is * present. Only one old log file is preserved. * * @note Make sure this function is called with the write lock held. * * @param[in] data Log handler data. * * @return Log file pointer (NULL on error). * ******************************************************************************* */ static GIOChannel * FileLoggerOpen(FileLogger *data) { GIOChannel *logfile = NULL; gchar *path; g_return_val_if_fail(data != NULL, NULL); path = FileLoggerGetPath(data, 0); if (g_file_test(path, G_FILE_TEST_EXISTS)) { struct stat fstats; if (g_stat(path, &fstats) > -1) { data->logSize = (gint) fstats.st_size; } if (!data->append || data->logSize >= data->maxSize) { /* * Find the last log file and iterate back, changing the indices as we go, * so that the oldest log file has the highest index (the new log file * will always be index "0"). When not rotating, "maxFiles" is 1, so we * always keep one backup. */ gchar *log; guint id; GPtrArray *logfiles = g_ptr_array_new(); /* * Find the id of the last log file. The pointer array will hold * the names of all existing log files + the name of the last log * file, which may or may not exist. */ for (id = 0; id < data->maxFiles; id++) { log = FileLoggerGetPath(data, id); g_ptr_array_add(logfiles, log); if (!g_file_test(log, G_FILE_TEST_IS_REGULAR)) { break; } } /* Rename the existing log files, increasing their index by 1. */ for (id = logfiles->len - 1; id > 0; id--) { gchar *dest = g_ptr_array_index(logfiles, id); gchar *src = g_ptr_array_index(logfiles, id - 1); if (!g_file_test(dest, G_FILE_TEST_IS_DIR) && (!g_file_test(dest, G_FILE_TEST_EXISTS) || g_unlink(dest) == 0)) { g_rename(src, dest); } else { g_unlink(src); } } /* Cleanup. */ for (id = 0; id < logfiles->len; id++) { g_free(g_ptr_array_index(logfiles, id)); } g_ptr_array_free(logfiles, TRUE); data->logSize = 0; data->append = FALSE; } } logfile = g_io_channel_new_file(path, data->append ? "a" : "w", NULL); g_free(path); if (logfile != NULL) { g_io_channel_set_encoding(logfile, NULL, NULL); } return logfile; } /* ******************************************************************************* * FileLoggerLog -- */ /** * * Logs a message to the configured destination file. Also opens the file for * writing if it hasn't been done yet. * * @param[in] domain Log domain. * @param[in] level Log level. * @param[in] message Message to log. * @param[in] data File logger. * ******************************************************************************* */ static void FileLoggerLog(const gchar *domain, GLogLevelFlags level, const gchar *message, gpointer data) { FileLogger *logger = data; gsize written; g_static_mutex_lock(&logger->lock); if (logger->error) { goto exit; } if (logger->file == NULL) { if (logger->file == NULL) { logger->file = FileLoggerOpen(data); } if (logger->file == NULL) { logger->error = TRUE; goto exit; } } if (!FileLoggerIsValid(logger)) { logger->error = TRUE; goto exit; } /* Write the log file and do log rotation accounting. */ if (g_io_channel_write_chars(logger->file, message, -1, &written, NULL) == G_IO_STATUS_NORMAL) { if (logger->maxSize > 0) { logger->logSize += (gint) written; if (logger->logSize >= logger->maxSize) { g_io_channel_unref(logger->file); logger->append = FALSE; logger->file = FileLoggerOpen(logger); } else { g_io_channel_flush(logger->file, NULL); } } else { g_io_channel_flush(logger->file, NULL); } } exit: g_static_mutex_unlock(&logger->lock); } /* ****************************************************************************** * FileLoggerDestroy -- */ /** * * Cleans up the internal state of a file logger. * * @param[in] _data File logger data. * ****************************************************************************** */ static void FileLoggerDestroy(gpointer data) { FileLogger *logger = data; if (logger->file != NULL) { g_io_channel_unref(logger->file); } g_static_mutex_free(&logger->lock); g_free(logger->path); g_free(logger); } /* ******************************************************************************* * GlibUtils_CreateFileLogger -- */ /** * * @brief Creates a new file logger based on the given configuration. * * @param[in] path Path to log file. * @param[in] append Whether to append to existing log file. * @param[in] maxSize Maximum log file size (in MB, 0 = no limit). * @param[in] maxFiles Maximum number of old files to be kept. * * @return A new logger, or NULL on error. * ******************************************************************************* */ GlibLogger * GlibUtils_CreateFileLogger(const char *path, gboolean append, guint maxSize, guint maxFiles) { FileLogger *data = NULL; g_return_val_if_fail(path != NULL, NULL); data = g_new0(FileLogger, 1); data->handler.addsTimestamp = FALSE; data->handler.shared = FALSE; data->handler.logfn = FileLoggerLog; data->handler.dtor = FileLoggerDestroy; data->path = g_filename_from_utf8(path, -1, NULL, NULL, NULL); if (data->path == NULL) { g_free(data); return NULL; } data->append = append; data->maxSize = maxSize * 1024 * 1024; data->maxFiles = maxFiles + 1; /* To account for the active log file. */ g_static_mutex_init(&data->lock); return &data->handler; } open-vm-tools-10.0.7-3227872/lib/glibUtils/Makefile.am0000644000000000000000000000217512660700525020420 0ustar rootroot################################################################################ ### Copyright (C) 2011-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ noinst_LTLIBRARIES = libGlibUtils.la libGlibUtils_la_CPPFLAGS = libGlibUtils_la_CPPFLAGS += @GLIB2_CPPFLAGS@ libGlibUtils_la_SOURCES = libGlibUtils_la_SOURCES += fileLogger.c libGlibUtils_la_SOURCES += stdLogger.c libGlibUtils_la_SOURCES += sysLogger.c open-vm-tools-10.0.7-3227872/lib/glibUtils/stdLogger.c0000644000000000000000000001504312660700525020460 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file stdLogger.c * * A very simplified version of a file logger that uses the standard output * streams (stdout / stderr). */ #include "glibUtils.h" #include #if defined(_WIN32) static GStaticMutex gConsoleLock = G_STATIC_MUTEX_INIT; static gint gRefCount = 0; #endif typedef struct StdLogger { GlibLogger handler; #if defined(_WIN32) gboolean attached; #endif } StdLogger; /* ******************************************************************************* * StdLoggerLog -- */ /** * * Logs a message to stdout or stderr depending on its severity. * * @param[in] domain Unused. * @param[in] level Log level. * @param[in] message Message to log. * @param[in] data Logger data. * ******************************************************************************* */ static void StdLoggerLog(const gchar *domain, GLogLevelFlags level, const gchar *message, gpointer data) { gchar *local; FILE *dest = (level < G_LOG_LEVEL_MESSAGE) ? stderr : stdout; #if defined(_WIN32) StdLogger *sdata = data; if (!sdata->attached) { g_static_mutex_lock(&gConsoleLock); if (gRefCount != 0 || GlibUtils_AttachConsole()) { gRefCount++; sdata->attached = TRUE; } g_static_mutex_unlock(&gConsoleLock); } if (!sdata->attached) { return; } #endif local = g_locale_from_utf8(message, -1, NULL, NULL, NULL); if (local != NULL) { fputs(local, dest); g_free(local); } else { fputs(message, dest); } } /* ******************************************************************************* * StdLoggerDestroy -- */ /** * * Cleans up the internal state of the logger. * * @param[in] data Logger data. * ******************************************************************************* */ static void StdLoggerDestroy(gpointer data) { #if defined(_WIN32) StdLogger *sdata = data; g_static_mutex_lock(&gConsoleLock); if (sdata->attached && --gRefCount == 0) { FreeConsole(); } g_static_mutex_unlock(&gConsoleLock); #endif g_free(data); } #if defined(_WIN32) /* ******************************************************************************* * GlibUtilsIsRedirected -- */ /** * * Checks whether given standard device (standard input, standard output, * or standard error) has been redirected to an on-disk file/pipe. * Win32-only. * * @param[in] nStdHandle The standard device number. * * @return TRUE if device redirected to a file/pipe. * ******************************************************************************* */ static gboolean GlibUtilsIsRedirected(DWORD nStdHandle) { HANDLE handle = GetStdHandle(nStdHandle); DWORD type = handle ? GetFileType(handle) : FILE_TYPE_UNKNOWN; return type == FILE_TYPE_DISK || type == FILE_TYPE_PIPE; } /* ******************************************************************************* * GlibUtils_AttachConsole -- */ /** * * Attaches a console to the current process. If the parent process already has * a console open, reuse it. Otherwise, create a new console for the current * process. Win32-only. * * It's safe to call this function multiple times (it won't do anything if * the process already has a console). * * @note Attaching to the parent process's console is only available on XP and * later. * * @return Whether the process is attached to a console. * ******************************************************************************* */ gboolean GlibUtils_AttachConsole(void) { typedef BOOL (WINAPI *AttachConsoleFn)(DWORD); gboolean ret = TRUE; AttachConsoleFn _AttachConsole; BOOL reopenStdout; BOOL reopenStderr; if (GetConsoleWindow() != NULL) { goto exit; } reopenStdout = !GlibUtilsIsRedirected(STD_OUTPUT_HANDLE); reopenStderr = !GlibUtilsIsRedirected(STD_ERROR_HANDLE); if (!reopenStdout && !reopenStderr) { goto exit; } _AttachConsole = (AttachConsoleFn) GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "AttachConsole"); if ((_AttachConsole != NULL && _AttachConsole(ATTACH_PARENT_PROCESS)) || AllocConsole()) { FILE *fptr; if (reopenStdout) { fptr = _wfreopen(L"CONOUT$", L"a", stdout); if (fptr == NULL) { g_warning("_wfreopen failed for stdout/CONOUT$: %d (%s)", errno, strerror(errno)); ret = FALSE; } } if (reopenStderr) { fptr = _wfreopen(L"CONOUT$", L"a", stderr); if (fptr == NULL) { g_warning("_wfreopen failed for stderr/CONOUT$: %d (%s)", errno, strerror(errno)); ret = FALSE; } else { setvbuf(fptr, NULL, _IONBF, 0); } } } else { ret = FALSE; } exit: if (!ret) { g_warning("Console redirection unavailable."); } return ret; } #endif /* ******************************************************************************* * GlibUtils_CreateStdLogger -- */ /** * * @brief Configures a new std logger. * * @return A new logger instance. * ******************************************************************************* */ GlibLogger * GlibUtils_CreateStdLogger(void) { StdLogger *data = g_new0(StdLogger, 1); data->handler.logfn = StdLoggerLog; data->handler.addsTimestamp = FALSE; data->handler.shared = FALSE; data->handler.dtor = StdLoggerDestroy; return &data->handler; } open-vm-tools-10.0.7-3227872/lib/glibUtils/sysLogger.c0000644000000000000000000001373312660700525020510 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file sysLogger.c * * Logger that writes to syslog(3). Since there's only one "syslog connection" * for the whole application, this code does reference counting to allow * different domains to be configured with a "syslog" handler, and still be * able to call closelog(3) when appropriate. */ #include "glibUtils.h" #include #include #include typedef struct SysLogger { GlibLogger handler; gchar *domain; gint refcount; } SysLogger; static SysLogger *gSysLogger; static GStaticMutex gSysLoggerLock = G_STATIC_MUTEX_INIT; /* ******************************************************************************* * SysLoggerLog -- */ /** * * @brief Sends the given log message to syslog. * * @param[in] domain Unused. * @param[in] level Log level. * @param[in] message Message to log. * @param[in] data Unused. * ****************************************************************************** */ static void SysLoggerLog(const gchar *domain, GLogLevelFlags level, const gchar *message, gpointer data) { gchar *local; int priority; /* glib and syslog disagree about critical / error. */ if (level & G_LOG_LEVEL_ERROR) { priority = LOG_CRIT; } else if (level & G_LOG_LEVEL_CRITICAL) { priority = LOG_ERR; } else if (level & G_LOG_LEVEL_WARNING) { priority = LOG_WARNING; } else if (level & G_LOG_LEVEL_MESSAGE) { priority = LOG_NOTICE; } else if (level & G_LOG_LEVEL_INFO) { priority = LOG_INFO; } else { priority = LOG_DEBUG; } local = g_locale_from_utf8(message, -1, NULL, NULL, NULL); if (local != NULL) { syslog(priority, "%s", local); g_free(local); } else { syslog(priority, "%s", message); } } /* ******************************************************************************* * SysLoggerUnref -- */ /** * * @brief Decreases the ref count and closes syslog if it reaches 0. * * @param[in] data Unused. * ******************************************************************************* */ static void SysLoggerUnref(gpointer data) { g_return_if_fail(data == gSysLogger); g_return_if_fail(gSysLogger->refcount > 0); g_static_mutex_lock(&gSysLoggerLock); gSysLogger->refcount -= 1; if (gSysLogger->refcount == 0) { closelog(); g_free(gSysLogger->domain); g_free(gSysLogger); gSysLogger = NULL; } g_static_mutex_unlock(&gSysLoggerLock); } /* ******************************************************************************* * GlibUtils_CreateSysLogger -- */ /** * * @brief Initializes syslog if it hasn't been done yet. * * Since syslog is shared, it's not recommended to change the default domain * during the lifetime of the application, since that may not reflect on the * syslogs (and, when it does, it might be confusing). * * @param[in] domain Application name, used as the syslog identity. * @param[in] facility Facility to use. One of: "daemon", "local[0-7]", "user" (default). * * @return Syslog logger data. * ******************************************************************************* */ GlibLogger * GlibUtils_CreateSysLogger(const char *domain, const char *facility) { g_static_mutex_lock(&gSysLoggerLock); if (gSysLogger == NULL) { int facid = LOG_USER; if (facility != NULL) { int idx; if (strcmp(facility, "daemon") == 0) { facid = LOG_DAEMON; } else if (sscanf(facility, "local%d", &idx) == 1) { switch (idx) { case 0: facid = LOG_LOCAL0; break; case 1: facid = LOG_LOCAL1; break; case 2: facid = LOG_LOCAL2; break; case 3: facid = LOG_LOCAL3; break; case 4: facid = LOG_LOCAL4; break; case 5: facid = LOG_LOCAL5; break; case 6: facid = LOG_LOCAL6; break; case 7: facid = LOG_LOCAL7; break; default: g_message("Invalid local facility for %s: %s\n", domain, facility); break; } } else if (strcmp(facility, "user") != 0) { g_message("Invalid syslog facility for %s: %s\n", domain, facility); } } gSysLogger = g_new0(SysLogger, 1); gSysLogger->handler.addsTimestamp = TRUE; gSysLogger->handler.shared = FALSE; gSysLogger->handler.logfn = SysLoggerLog; gSysLogger->handler.dtor = SysLoggerUnref; gSysLogger->domain = g_strdup(domain); gSysLogger->refcount = 1; openlog(gSysLogger->domain, LOG_CONS | LOG_PID, facid); } else { gSysLogger->refcount += 1; } g_static_mutex_unlock(&gSysLoggerLock); return &gSysLogger->handler; } open-vm-tools-10.0.7-3227872/lib/glibUtils/Makefile.in0000644000000000000000000004714212660700525020434 0ustar rootroot# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 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@ ################################################################################ ### Copyright (C) 2011-2015 VMware, Inc. All rights reserved. ### ### This program is free software; you can redistribute it and/or modify ### it under the terms of version 2 of the GNU General Public License as ### published by the Free Software Foundation. ### ### 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 St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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@ subdir = lib/glibUtils DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/vmtools.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libGlibUtils_la_LIBADD = am_libGlibUtils_la_OBJECTS = libGlibUtils_la-fileLogger.lo \ libGlibUtils_la-stdLogger.lo libGlibUtils_la-sysLogger.lo libGlibUtils_la_OBJECTS = $(am_libGlibUtils_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ 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 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libGlibUtils_la_SOURCES) DIST_SOURCES = $(libGlibUtils_la_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ COMMON_PLUGIN_INSTALLDIR = @COMMON_PLUGIN_INSTALLDIR@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CUNIT_CPPFLAGS = @CUNIT_CPPFLAGS@ CUNIT_LIBS = @CUNIT_LIBS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ DOT = @DOT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FUSE_CPPFLAGS = @FUSE_CPPFLAGS@ FUSE_LIBS = @FUSE_LIBS@ GLIB2_CPPFLAGS = @GLIB2_CPPFLAGS@ GLIB2_LIBS = @GLIB2_LIBS@ GMODULE_CPPFLAGS = @GMODULE_CPPFLAGS@ GMODULE_LIBS = @GMODULE_LIBS@ GOBJECT_CPPFLAGS = @GOBJECT_CPPFLAGS@ GOBJECT_LIBS = @GOBJECT_LIBS@ GREP = @GREP@ GTHREAD_CPPFLAGS = @GTHREAD_CPPFLAGS@ GTHREAD_LIBS = @GTHREAD_LIBS@ GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@ GTKMM_LIBS = @GTKMM_LIBS@ GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ HAVE_DOT = @HAVE_DOT@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ HGFS_LIBS = @HGFS_LIBS@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTVMSG = @INSTVMSG@ KERNEL_RELEASE = @KERNEL_RELEASE@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBVMTOOLS_LIBADD = @LIBVMTOOLS_LIBADD@ LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LINUXINCLUDE = @LINUXINCLUDE@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ MSCGEN = @MSCGEN@ MSCGEN_DIR = @MSCGEN_DIR@ MSPACK_CPPFLAGS = @MSPACK_CPPFLAGS@ MSPACK_LIBS = @MSPACK_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PAM_CPPFLAGS = @PAM_CPPFLAGS@ PAM_LIBS = @PAM_LIBS@ PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLUGIN_CPPFLAGS = @PLUGIN_CPPFLAGS@ PLUGIN_LDFLAGS = @PLUGIN_LDFLAGS@ PROCPS_CPPFLAGS = @PROCPS_CPPFLAGS@ PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ RPCGEN = @RPCGEN@ RPCGENFLAGS = @RPCGENFLAGS@ RPCGEN_WRAPPER = @RPCGEN_WRAPPER@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CPPFLAGS = @SSL_CPPFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ SYSDIR = @SYSDIR@ TARGET_OS = @TARGET_OS@ TEST_PLUGIN_INSTALLDIR = @TEST_PLUGIN_INSTALLDIR@ TOOLS_VERSION = @TOOLS_VERSION@ VERSION = @VERSION@ VGAUTH_LIBADD = @VGAUTH_LIBADD@ VIX_LIBADD = @VIX_LIBADD@ VMSVC_PLUGIN_INSTALLDIR = @VMSVC_PLUGIN_INSTALLDIR@ VMTOOLS_CPPFLAGS = @VMTOOLS_CPPFLAGS@ VMTOOLS_LIBS = @VMTOOLS_LIBS@ VMUSR_PLUGIN_INSTALLDIR = @VMUSR_PLUGIN_INSTALLDIR@ XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ XDR_LIBS = @XDR_LIBS@ XERCES_CPPFLAGS = @XERCES_CPPFLAGS@ XERCES_LIBS = @XERCES_LIBS@ XMKMF = @XMKMF@ XMLSECURITY_CPPFLAGS = @XMLSECURITY_CPPFLAGS@ XMLSECURITY_LIBS = @XMLSECURITY_LIBS@ XSM_LIBS = @XSM_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_vmw_lib_cfg = @ac_vmw_lib_cfg@ 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@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ have_cxx = @have_cxx@ have_doxygen = @have_doxygen@ have_genmarshal = @have_genmarshal@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libGlibUtils.la libGlibUtils_la_CPPFLAGS = @GLIB2_CPPFLAGS@ libGlibUtils_la_SOURCES = fileLogger.c stdLogger.c sysLogger.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(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/glibUtils/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/glibUtils/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: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_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 libGlibUtils.la: $(libGlibUtils_la_OBJECTS) $(libGlibUtils_la_DEPENDENCIES) $(LINK) $(libGlibUtils_la_OBJECTS) $(libGlibUtils_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libGlibUtils_la-fileLogger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libGlibUtils_la-stdLogger.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libGlibUtils_la-sysLogger.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @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 $@ $< libGlibUtils_la-fileLogger.lo: fileLogger.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGlibUtils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGlibUtils_la-fileLogger.lo -MD -MP -MF $(DEPDIR)/libGlibUtils_la-fileLogger.Tpo -c -o libGlibUtils_la-fileLogger.lo `test -f 'fileLogger.c' || echo '$(srcdir)/'`fileLogger.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGlibUtils_la-fileLogger.Tpo $(DEPDIR)/libGlibUtils_la-fileLogger.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fileLogger.c' object='libGlibUtils_la-fileLogger.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGlibUtils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGlibUtils_la-fileLogger.lo `test -f 'fileLogger.c' || echo '$(srcdir)/'`fileLogger.c libGlibUtils_la-stdLogger.lo: stdLogger.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGlibUtils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGlibUtils_la-stdLogger.lo -MD -MP -MF $(DEPDIR)/libGlibUtils_la-stdLogger.Tpo -c -o libGlibUtils_la-stdLogger.lo `test -f 'stdLogger.c' || echo '$(srcdir)/'`stdLogger.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGlibUtils_la-stdLogger.Tpo $(DEPDIR)/libGlibUtils_la-stdLogger.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='stdLogger.c' object='libGlibUtils_la-stdLogger.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGlibUtils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGlibUtils_la-stdLogger.lo `test -f 'stdLogger.c' || echo '$(srcdir)/'`stdLogger.c libGlibUtils_la-sysLogger.lo: sysLogger.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGlibUtils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGlibUtils_la-sysLogger.lo -MD -MP -MF $(DEPDIR)/libGlibUtils_la-sysLogger.Tpo -c -o libGlibUtils_la-sysLogger.lo `test -f 'sysLogger.c' || echo '$(srcdir)/'`sysLogger.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGlibUtils_la-sysLogger.Tpo $(DEPDIR)/libGlibUtils_la-sysLogger.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='sysLogger.c' object='libGlibUtils_la-sysLogger.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGlibUtils_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGlibUtils_la-sysLogger.lo `test -f 'sysLogger.c' || echo '$(srcdir)/'`sysLogger.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ 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) 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 clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am 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: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES 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-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ 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 # 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: open-vm-tools-10.0.7-3227872/lib/include/0000755000000000000000000000000012660700526016045 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/include/circList.h0000644000000000000000000002370512660700526020001 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * circList.h -- * * macros, prototypes and struct definitions for double-linked * circular lists. */ #ifndef _CIRCLIST_H_ #define _CIRCLIST_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #include "vmware.h" typedef struct ListItem { struct ListItem *prev; struct ListItem *next; } ListItem; /* A list with no elements is a null pointer. */ #define LIST_ITEM_DEF(name) \ ListItem * name = NULL #define LIST_EMPTY(l) ((l) == NULL) /* initialize list item */ #define INIT_LIST_ITEM(p) \ do { \ (p)->prev = (p)->next = (p); \ } while (0) /* check if initialized */ #define IS_LIST_ITEM_INITIALIZED(li) \ (((li) == (li)->prev) && ((li) == (li)->next)) /* return first element in the list */ #define LIST_FIRST(l) (l) #define LIST_FIRST_CHK(l) (l) /* return last element in the list */ #define LIST_LAST(l) ((l)->prev) #define LIST_LAST_CHK(l) (LIST_EMPTY(l) ? NULL : LIST_LAST(l)) /* * LIST_CONTAINER - get the struct for this entry (like list_entry) * @ptr: the &struct ListItem pointer. * @type: the type of the struct this is embedded in. * @member: the name of the list struct within the struct. */ #define LIST_CONTAINER(ptr, type, member) \ VMW_CONTAINER_OF(ptr, type, member) /* * delete item from the list */ #define LIST_DEL DelListItem /* * link two lists together */ #define LIST_SPLICE SpliceLists /* * Split a list into two lists */ #define LIST_SPLIT SplitLists /* * Add item to front of stack. List pointer points to new head. */ #define LIST_PUSH PushListItem /* * Add item at back of queue. List pointer only changes if list was empty. */ #define LIST_QUEUE QueueListItem /* * Get the list size. */ #define LIST_SIZE GetListSize /* * LIST_SCAN_FROM scans the list from "from" up until "until". * The loop variable p should not be destroyed in the process. * "from" is an element in the list where to start scanning. * "until" is the element where search should stop. * member is the field to use for the search - either "next" or "prev". */ #define LIST_SCAN_FROM(p, from, until, member) \ for (p = (from); (p) != NULL; \ (p) = (((p)->member == (until)) ? NULL : (p)->member)) /* scan the entire list (non-destructively) */ #define LIST_SCAN(p, l) \ LIST_SCAN_FROM(p, LIST_FIRST(l), LIST_FIRST(l), next) /* scan a list backward from last element to first (non-destructively) */ #define LIST_SCAN_BACK(p, l) \ LIST_SCAN_FROM(p, LIST_LAST_CHK(l), LIST_LAST(l), prev) /* scan the entire list where loop element may be destroyed */ #define LIST_SCAN_SAFE(p, pn, l) \ if (!LIST_EMPTY(l)) \ for (p = (l), (pn) = NextListItem(p, l); (p) != NULL; \ (p) = (pn), (pn) = NextListItem(p, l)) /* scan the entire list backwards where loop element may be destroyed */ #define LIST_SCAN_BACK_SAFE(p, pn, l) \ if (!LIST_EMPTY(l)) \ for (p = LIST_LAST(l), (pn) = PrevListItem(p, l); (p) != NULL; \ (p) = (pn), (pn) = PrevListItem(p, l)) /* function definitions */ /* *---------------------------------------------------------------------- * * NextListItem -- * * Returns the next member of a doubly linked list, or NULL if last. * Assumes: p is member of the list headed by head. * * Result: * If head or p is NULL, return NULL. Otherwise, * next list member (or null if last). * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE ListItem * NextListItem(ListItem *p, // IN ListItem *head) // IN { if (head == NULL || p == NULL) { return NULL; } /* both p and head are non-null */ p = p->next; return p == head ? NULL : p; } /* *---------------------------------------------------------------------- * * PrevListItem -- * * Returns the prev member of a doubly linked list, or NULL if first. * Assumes: p is member of the list headed by head. * * Result: * If head or prev is NULL, return NULL. Otherwise, * prev list member (or null if first). * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE ListItem * PrevListItem(ListItem *p, // IN ListItem *head) // IN { if (head == NULL || p == NULL) { return NULL; } /* both p and head are non-null */ return p == head ? NULL : p->prev; } /* *---------------------------------------------------------------------- * * DelListItem -- * * Deletes a member of a doubly linked list, possibly modifies the * list header itself. * Assumes neither p nor headp is null and p is a member of *headp. * * Result: * None * * Side effects: * Modifies *headp. * *---------------------------------------------------------------------- */ static INLINE void DelListItem(ListItem *p, // IN ListItem **headp) // IN/OUT { ListItem *next; ASSERT(p); ASSERT(headp); next = p->next; if (p == next) { *headp = NULL; } else { next->prev = p->prev; p->prev->next = next; if (*headp == p) { *headp = next; } } } /* *---------------------------------------------------------------------- * * QueueListItem -- * * Adds a new member to the back of a doubly linked list (queue) * Assumes neither p nor headp is null and p is not a member of *headp. * * Result: * None * * Side effects: * Modifies *headp. * *---------------------------------------------------------------------- */ static INLINE void QueueListItem(ListItem *p, // IN ListItem **headp) // IN/OUT { ListItem *head; head = *headp; if (LIST_EMPTY(head)) { INIT_LIST_ITEM(p); *headp = p; } else { p->prev = head->prev; p->next = head; p->prev->next = p; head->prev = p; } } /* *---------------------------------------------------------------------- * * PushListItem -- * * Adds a new member to the front of a doubly linked list (stack) * Assumes neither p nor headp is null and p is not a member of *headp. * * Result: * None * * Side effects: * Modifies *headp. * *---------------------------------------------------------------------- */ static INLINE void PushListItem(ListItem *p, // IN ListItem **headp) // IN/OUT { QueueListItem(p, headp); *headp = p; } /* *---------------------------------------------------------------------- * * SpliceLists -- * * Make a single list {l1 l2} from {l1} and {l2} and return it. * It is okay for one or both lists to be NULL. * No checking is done. It is assumed that l1 and l2 are two * distinct lists. * * Result: * A list { l1 l2 }. * * Side effects: * Modifies l1 and l2 list pointers. * *---------------------------------------------------------------------- */ static INLINE ListItem * SpliceLists(ListItem *l1, // IN ListItem *l2) // IN { ListItem *l1Last, *l2Last; if (LIST_EMPTY(l1)) { return l2; } if (LIST_EMPTY(l2)) { return l1; } l1Last = l1->prev; /* last elem of l1 */ l2Last = l2->prev; /* last elem of l2 */ /* * l1 -> ... -> l1Last l2 -> ... l2Last */ l1Last->next = l2; l2->prev = l1Last; l1->prev = l2Last; l2Last->next = l1; return l1; } /* *---------------------------------------------------------------------- * * SplitLists -- * * Make a list l = {l1 l2} into two separate lists {l1} and {l2}, where: * l = { ... x -> p -> ... } split into: * l1 = { ... -> x } * l2 = { p -> ... } * Assumes neither p nor l is null and p is a member of l. * If p is the first element of l, then l1 will be NULL. * * Result: * None. * * Side effects: * Sets *l1p and *l2p to the resulting two lists. * Modifies l's pointers. * *---------------------------------------------------------------------- */ static INLINE void SplitLists(ListItem *p, // IN ListItem *l, // IN ListItem **l1p, // OUT ListItem **l2p) // OUT { ListItem *last; if (p == LIST_FIRST(l)) { /* first element */ *l1p = NULL; *l2p = l; return; } last = l->prev; *l1p = l; p->prev->next = l; l->prev = p->prev; *l2p = p; p->prev = last; last->next = p; } /* *---------------------------------------------------------------------- * * GetListSize -- * * Return the number of items in the list. * * Result: * The number of items in the list. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE int GetListSize(ListItem *head) // IN { ListItem *li; int ret = 0; LIST_SCAN(li, head) { ret++; } return ret; } #endif /* _CIRCLIST_H_ */ open-vm-tools-10.0.7-3227872/lib/include/vm_assert.h0000644000000000000000000003115612660700526020227 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * vm_assert.h -- * * The basic assertion facility for all VMware code. * * For proper use, see bora/doc/assert and * http://vmweb.vmware.com/~mts/WebSite/guide/programming/asserts.html. */ #ifndef _VM_ASSERT_H_ #define _VM_ASSERT_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMKDRIVERS #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" // XXX not necessary except some places include vm_assert.h improperly #include "vm_basic_types.h" #ifdef __cplusplus extern "C" { #endif /* * Some bits of vmcore are used in VMKernel code and cannot have * the VMKERNEL define due to other header dependencies. */ #if defined(VMKERNEL) && !defined(VMKPANIC) #define VMKPANIC 1 #endif /* * Internal macros, functions, and strings * * The monitor wants to save space at call sites, so it has specialized * functions for each situation. User level wants to save on implementation * so it uses generic functions. */ #if !defined VMM || defined MONITOR_APP // { #if defined (VMKPANIC) #include "vmk_assert.h" #else /* !VMKPANIC */ #define _ASSERT_PANIC(name) \ Panic(_##name##Fmt "\n", __FILE__, __LINE__) #define _ASSERT_PANIC_BUG(bug, name) \ Panic(_##name##Fmt " bugNr=%d\n", __FILE__, __LINE__, bug) #define _ASSERT_PANIC_NORETURN(name) \ Panic(_##name##Fmt "\n", __FILE__, __LINE__) #define _ASSERT_PANIC_BUG_NORETURN(bug, name) \ Panic(_##name##Fmt " bugNr=%d\n", __FILE__, __LINE__, bug) #endif /* VMKPANIC */ #endif // } // These strings don't have newline so that a bug can be tacked on. #define _AssertPanicFmt "PANIC %s:%d" #define _AssertAssertFmt "ASSERT %s:%d" #define _AssertVerifyFmt "VERIFY %s:%d" #define _AssertNotImplementedFmt "NOT_IMPLEMENTED %s:%d" #define _AssertNotReachedFmt "NOT_REACHED %s:%d" #define _AssertMemAllocFmt "MEM_ALLOC %s:%d" #define _AssertNotTestedFmt "NOT_TESTED %s:%d" /* * Panic and log functions */ void Log(const char *fmt, ...) PRINTF_DECL(1, 2); void Warning(const char *fmt, ...) PRINTF_DECL(1, 2); #if defined VMKPANIC void Panic_SaveRegs(void); #ifdef VMX86_DEBUG void Panic_NoSave(const char *fmt, ...) PRINTF_DECL(1, 2); #else NORETURN void Panic_NoSave(const char *fmt, ...) PRINTF_DECL(1, 2); #endif NORETURN void Panic_NoSaveNoReturn(const char *fmt, ...) PRINTF_DECL(1, 2); #define Panic(fmt...) do { \ Panic_SaveRegs(); \ Panic_NoSave(fmt); \ } while(0) #define Panic_NoReturn(fmt...) do { \ Panic_SaveRegs(); \ Panic_NoSaveNoReturn(fmt); \ } while(0) #else NORETURN void Panic(const char *fmt, ...) PRINTF_DECL(1, 2); #endif void LogThrottled(uint32 *count, const char *fmt, ...) PRINTF_DECL(2, 3); void WarningThrottled(uint32 *count, const char *fmt, ...) PRINTF_DECL(2, 3); #ifndef ASSERT_IFNOT /* * PR 271512: When compiling with gcc, catch assignments inside an ASSERT. * * 'UNLIKELY' is defined with __builtin_expect, which does not warn when * passed an assignment (gcc bug 36050). To get around this, we put 'cond' * in an 'if' statement and make sure it never gets executed by putting * that inside of 'if (0)'. We use gcc's statement expression syntax to * make ASSERT an expression because some code uses it that way. * * Since statement expression syntax is a gcc extension and since it's * not clear if this is a problem with other compilers, the ASSERT * definition was not changed for them. Using a bare 'cond' with the * ternary operator may provide a solution. */ #ifdef __GNUC__ #define ASSERT_IFNOT(cond, panic) \ ({if (UNLIKELY(!(cond))) { panic; if (0) { if (cond) {;}}} (void)0;}) #else #define ASSERT_IFNOT(cond, panic) \ (UNLIKELY(!(cond)) ? (panic) : (void)0) #endif #endif /* * Assert, panic, and log macros * * Some of these are redefined below undef !VMX86_DEBUG. * ASSERT() is special cased because of interaction with Windows DDK. */ #if defined VMX86_DEBUG #undef ASSERT #define ASSERT(cond) ASSERT_IFNOT(cond, _ASSERT_PANIC(AssertAssert)) #define ASSERT_BUG(bug, cond) \ ASSERT_IFNOT(cond, _ASSERT_PANIC_BUG(bug, AssertAssert)) #endif #undef VERIFY #define VERIFY(cond) \ ASSERT_IFNOT(cond, _ASSERT_PANIC_NORETURN(AssertVerify)) #define VERIFY_BUG(bug, cond) \ ASSERT_IFNOT(cond, _ASSERT_PANIC_BUG_NORETURN(bug, AssertVerify)) #define PANIC() _ASSERT_PANIC(AssertPanic) #define PANIC_BUG(bug) _ASSERT_PANIC_BUG(bug, AssertPanic) #define ASSERT_NOT_IMPLEMENTED(cond) \ ASSERT_IFNOT(cond, NOT_IMPLEMENTED()) #define ASSERT_NOT_IMPLEMENTED_BUG(bug, cond) \ ASSERT_IFNOT(cond, NOT_IMPLEMENTED_BUG(bug)) #if defined VMKPANIC || defined VMM #define NOT_IMPLEMENTED() _ASSERT_PANIC_NORETURN(AssertNotImplemented) #else #define NOT_IMPLEMENTED() _ASSERT_PANIC(AssertNotImplemented) #endif #if defined VMM #define NOT_IMPLEMENTED_BUG(bug) \ _ASSERT_PANIC_BUG_NORETURN(bug, AssertNotImplemented) #else #define NOT_IMPLEMENTED_BUG(bug) _ASSERT_PANIC_BUG(bug, AssertNotImplemented) #endif #if defined VMKPANIC || defined VMM #define NOT_REACHED() _ASSERT_PANIC_NORETURN(AssertNotReached) #else #define NOT_REACHED() _ASSERT_PANIC(AssertNotReached) #endif #define ASSERT_MEM_ALLOC(cond) \ ASSERT_IFNOT(cond, _ASSERT_PANIC(AssertMemAlloc)) #ifdef VMX86_DEVEL #define ASSERT_DEVEL(cond) ASSERT(cond) #define NOT_TESTED() Warning(_AssertNotTestedFmt "\n", __FILE__, __LINE__) #else #define ASSERT_DEVEL(cond) ((void)0) #define NOT_TESTED() Log(_AssertNotTestedFmt "\n", __FILE__, __LINE__) #endif #define ASSERT_NO_INTERRUPTS() ASSERT(!INTERRUPTS_ENABLED()) #define ASSERT_HAS_INTERRUPTS() ASSERT(INTERRUPTS_ENABLED()) #define ASSERT_NOT_TESTED(cond) (UNLIKELY(!(cond)) ? NOT_TESTED() : (void)0) #define NOT_TESTED_ONCE() DO_ONCE(NOT_TESTED()) #define NOT_TESTED_1024() \ do { \ static uint16 count = 0; \ if (UNLIKELY(count == 0)) { NOT_TESTED(); } \ count = (count + 1) & 1023; \ } while (0) #define LOG_ONCE(_s) DO_ONCE(Log _s) /* * Redefine macros that are only in debug versions */ #if !defined VMX86_DEBUG // { #undef ASSERT #define ASSERT(cond) ((void)0) #define ASSERT_BUG(bug, cond) ((void)0) /* * Expand NOT_REACHED() as appropriate for each situation. * * Mainly, we want the compiler to infer the same control-flow * information as it would from Panic(). Otherwise, different * compilation options will lead to different control-flow-derived * errors, causing some make targets to fail while others succeed. * * VC++ has the __assume() built-in function which we don't trust * (see bug 43485); gcc has no such construct; we just panic in * userlevel code. The monitor doesn't want to pay the size penalty * (measured at 212 bytes for the release vmm for a minimal infinite * loop; panic would cost even more) so it does without and lives * with the inconsistency. */ #if defined VMKPANIC || defined VMM #undef NOT_REACHED #if defined __GNUC__ && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 5) #define NOT_REACHED() (__builtin_unreachable()) #else #define NOT_REACHED() ((void)0) #endif #else // keep debug definition #endif #undef LOG_UNEXPECTED #define LOG_UNEXPECTED(bug) ((void)0) #undef ASSERT_NOT_TESTED #define ASSERT_NOT_TESTED(cond) ((void)0) #undef NOT_TESTED #define NOT_TESTED() ((void)0) #undef NOT_TESTED_ONCE #define NOT_TESTED_ONCE() ((void)0) #undef NOT_TESTED_1024 #define NOT_TESTED_1024() ((void)0) #endif // !VMX86_DEBUG } /* * Compile-time assertions. * * ASSERT_ON_COMPILE does not use the common * switch (0) { case 0: case (e): ; } trick because some compilers (e.g. MSVC) * generate code for it. * * The implementation uses both enum and typedef because the typedef alone is * insufficient; gcc allows arrays to be declared with non-constant expressions * (even in typedefs, where it makes no sense). * * NOTE: if GCC ever changes so that it ignores unused types altogether, this * assert might not fire! We explicitly mark it as unused because GCC 4.8+ * uses -Wunused-local-typedefs as part of -Wall, which means the typedef will * generate a warning. */ #if defined(_Static_assert) || defined(__cplusplus) || \ !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) #define ASSERT_ON_COMPILE(e) \ do { \ enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ UNUSED_TYPE(typedef char AssertOnCompileFailed[AssertOnCompileMisused]); \ } while (0) #else #define ASSERT_ON_COMPILE(e) \ do { \ _Static_assert(e, #e); \ } while (0); #endif /* * To put an ASSERT_ON_COMPILE() outside a function, wrap it * in MY_ASSERTS(). The first parameter must be unique in * each .c file where it appears. For example, * * MY_ASSERTS(FS3_INT, * ASSERT_ON_COMPILE(sizeof(FS3_DiskLock) == 128); * ASSERT_ON_COMPILE(sizeof(FS3_DiskLockReserved) == DISK_BLOCK_SIZE); * ASSERT_ON_COMPILE(sizeof(FS3_DiskBlock) == DISK_BLOCK_SIZE); * ASSERT_ON_COMPILE(sizeof(Hardware_DMIUUID) == 16); * ) * * Caution: ASSERT() within MY_ASSERTS() is silently ignored. * The same goes for anything else not evaluated at compile time. */ #define MY_ASSERTS(name, assertions) \ static INLINE void name(void) { \ assertions \ } #ifdef __cplusplus } /* extern "C" */ #endif #endif /* ifndef _VM_ASSERT_H_ */ open-vm-tools-10.0.7-3227872/lib/include/vm_atomic.h0000644000000000000000000031457412660700526020212 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * vm_atomic.h -- * * Atomic power * * Note: Only partially tested on ARM processors: Works for View Open * Client, which shouldn't have threads, and ARMv8 processors. * * In ARM, GCC intrinsics (__sync*) compile but might not * work, while MS intrinsics (_Interlocked*) do not compile. */ #ifndef _ATOMIC_H_ #define _ATOMIC_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKDRIVERS #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_assert.h" /* * In the Atomic_* definitions below, memory ordering and atomicity are somewhat * conflated in an inconsistent manner. First, we have Atomic_{Read,Write}, * which only guarantees single copy atomicity, i.e. that the read/write occurs * in an atomic fashion, but have no implication on memory ordering. The second * class of Atomics are all the non-unfenced operations excluding * Atomic_{Read,Write}*, which both imply atomicity and act as a memory barrier, * implying sequentially consistent ordering of the atomic operation with all * loads/stores prior to and after it. * * Since on x86, the second class of operations are associated with LOCK * semantics, assumptions have been made about the ordering these operations * imply on surrounding code (see for example the vmkernel's RefCount * implementation). As a result, on arm64 we have to provide these same * guarantees. We do this by making use of DMB barriers both before and after * the atomic ldrx/strx sequences. A barrier before and after is required to * avoid having part of the atomic operation reordered with surrounding code, * e.g. a store-load reordering of the strx with a following load outside the * Atomic_ op. For the first class of operations, Atomic_{Read,Write}, we do not * implement a barrier. * * This implementation of Atomic operations is suboptimal on arm64, since * both atomicity and memory ordering are fused together. Ideally the Atomic * operations would only imply atomicity, and an explicit memory barrier in the * surrounding code used to enforce ordering where necessary. This would eschew * the need for the DMBs. A middle ground can be implemented where we use the * arm64 load-acquire/store-release exclusive instructions to implement Atomics. * This would imply sequential consistency of the Atomic operations (but not * with any of the surrounding non-atomic operations) without the need for a * DMB. Using these without a DMB today can still result in problematic * reordering by the processor with surrounding non-atomic operations, e.g. a * store-load reordering with a stlxr. Future optimization for arm64 should * consider the wider change required at the call sites to minimize DMBs. * * For further details on x86 and ARM memory ordering see * https://wiki.eng.vmware.com/ARM/MemoryOrdering. */ #ifdef VM_ARM_64 #include "vm_basic_asm_arm64.h" #define ARM_64_ATOMIC_16_OPV_PRIVATE(atm,modval,op) ({ \ uint32 _failed; \ uint16 _sample; \ __asm__ __volatile__ ( \ "1: ldxrh %w0, [%2] \n\t" \ #op " %w0, %w0, %w3 \n\t" \ " stxrh %w1, %w0, [%2] \n\t" \ " cbnz %w1, 1b \n\t" \ : "=&r" (_sample), \ "=&r" (_failed) \ : "r" (atm), \ "r" (modval) \ : "memory"); \ }) #define ARM_64_ATOMIC_16_OPO_PRIVATE(atm,modval,op) ({ \ uint32 _failed; \ uint16 _newval; \ uint16 _oldval; \ __asm__ __volatile__ ( \ "1: ldxrh %w0, [%3] \n\t" \ #op " %w1, %w0, %w4 \n\t" \ " stxrh %w2, %w1, [%3] \n\t" \ " cbnz %w2, 1b \n\t" \ : "=&r" (_oldval), \ "=&r" (_newval), \ "=&r" (_failed) \ : "r" (atm), \ "r" (modval) \ : "memory"); \ _oldval; \ }) #define ARM_64_ATOMIC_32_OPV_PRIVATE(atm,modval,op) ({ \ uint32 _failed; \ uint32 _sample; \ __asm__ __volatile__ ( \ "1: ldxr %w0, [%2] \n\t" \ #op " %w0, %w0, %w3 \n\t" \ " stxr %w1, %w0, [%2] \n\t" \ " cbnz %w1, 1b \n\t" \ : "=&r" (_sample), \ "=&r" (_failed) \ : "r" (atm), \ "r" (modval) \ : "memory"); \ }) #define ARM_64_ATOMIC_32_OPO_PRIVATE(atm,modval,op) ({ \ uint32 _failed; \ uint32 _newval; \ uint32 _oldval; \ __asm__ __volatile__ ( \ "1: ldxr %w0, [%3] \n\t" \ #op " %w1, %w0, %w4 \n\t" \ " stxr %w2, %w1, [%3] \n\t" \ " cbnz %w2, 1b \n\t" \ : "=&r" (_oldval), \ "=&r" (_newval), \ "=&r" (_failed) \ : "r" (atm), \ "r" (modval) \ : "memory"); \ _oldval; \ }) #define ARM_64_ATOMIC_64_OPV_PRIVATE(atm,modval,op) ({ \ uint32 _failed; \ uint64 _sample; \ __asm__ __volatile__ ( \ "1: ldxr %x0, [%2] \n\t" \ #op " %x0, %x0, %x3 \n\t" \ " stxr %w1, %x0, [%2] \n\t" \ " cbnz %w1, 1b \n\t" \ : "=&r" (_sample), \ "=&r" (_failed) \ : "r" (atm), \ "r" (modval) \ : "memory"); \ }) #define ARM_64_ATOMIC_64_OPO_PRIVATE(atm,modval,op) ({ \ uint32 _failed; \ uint64 _newval; \ uint64 _oldval; \ __asm__ __volatile__ ( \ "1: ldxr %x0, [%3] \n\t" \ #op " %x1, %x0, %x4 \n\t" \ " stxr %w2, %x1, [%3] \n\t" \ " cbnz %w2, 1b \n\t" \ : "=&r" (_oldval), \ "=&r" (_newval), \ "=&r" (_failed) \ : "r" (atm), \ "r" (modval) \ : "memory"); \ _oldval; \ }) #define ARM_64_ATOMIC_16_OPV_PRIVATE_FENCED(atm,modval,op) ({ \ DMB(); \ ARM_64_ATOMIC_16_OPV_PRIVATE(atm,modval,op); \ DMB(); \ }) #define ARM_64_ATOMIC_16_OPO_PRIVATE_FENCED(atm,modval,op) ({ \ uint16 _oldval_fenced; \ DMB(); \ _oldval_fenced = ARM_64_ATOMIC_16_OPO_PRIVATE(atm,modval,op); \ DMB(); \ _oldval_fenced; \ }) #define ARM_64_ATOMIC_32_OPV_PRIVATE_FENCED(atm,modval,op) ({ \ DMB(); \ ARM_64_ATOMIC_32_OPV_PRIVATE(atm,modval,op); \ DMB(); \ }) #define ARM_64_ATOMIC_32_OPO_PRIVATE_FENCED(atm,modval,op) ({ \ uint32 _oldval_fenced; \ DMB(); \ _oldval_fenced = ARM_64_ATOMIC_32_OPO_PRIVATE(atm,modval,op); \ DMB(); \ _oldval_fenced; \ }) #define ARM_64_ATOMIC_64_OPV_PRIVATE_FENCED(atm,modval,op) ({ \ DMB(); \ ARM_64_ATOMIC_64_OPV_PRIVATE(atm,modval,op); \ DMB(); \ }) #define ARM_64_ATOMIC_64_OPO_PRIVATE_FENCED(atm,modval,op) ({ \ uint64 _oldval_fenced; \ DMB(); \ _oldval_fenced = ARM_64_ATOMIC_64_OPO_PRIVATE(atm,modval,op); \ DMB(); \ _oldval_fenced; \ }) #endif /* VM_ARM_64 */ /* Basic atomic types: 16, 32 and 64 bits */ typedef struct Atomic_uint16 { volatile uint16 value; } Atomic_uint16 ALIGNED(2); typedef struct Atomic_uint32 { volatile uint32 value; } Atomic_uint32 ALIGNED(4); typedef struct Atomic_uint64 { volatile uint64 value; } Atomic_uint64 ALIGNED(8); /* * Prototypes for msft atomics. These are defined & inlined by the * compiler so no function definition is needed. The prototypes are * needed for C++. Since amd64 compiler doesn't support inline asm we * have to use these. Unfortunately, we still have to use some inline asm * for the 32 bit code since the and/or/xor implementations didn't show up * until XP or 2k3. * * The declarations for the intrinsic functions were taken from ntddk.h * in the DDK. The declarations must match otherwise the 64-bit C++ * compiler will complain about second linkage of the intrinsic functions. * We define the intrinsic using the basic types corresponding to the * Windows typedefs. This avoids having to include windows header files * to get to the windows types. */ #if defined(_MSC_VER) && _MSC_VER >= 1310 && !defined(BORA_NO_WIN32_INTRINS) #ifdef __cplusplus extern "C" { #endif long _InterlockedExchange(long volatile*, long); long _InterlockedCompareExchange(long volatile*, long, long); long _InterlockedExchangeAdd(long volatile*, long); long _InterlockedDecrement(long volatile*); long _InterlockedIncrement(long volatile*); void _ReadWriteBarrier(void); #pragma intrinsic(_InterlockedExchange, _InterlockedCompareExchange) #pragma intrinsic(_InterlockedExchangeAdd, _InterlockedDecrement) #pragma intrinsic(_InterlockedIncrement, _ReadWriteBarrier) # if _MSC_VER >= 1600 char _InterlockedExchange8(char volatile *, char); char _InterlockedCompareExchange8(char volatile *, char, char); #pragma intrinsic(_InterlockedCompareExchange8, _InterlockedCompareExchange8) #endif #if defined(VM_X86_64) long _InterlockedAnd(long volatile*, long); __int64 _InterlockedAnd64(__int64 volatile*, __int64); long _InterlockedOr(long volatile*, long); __int64 _InterlockedOr64(__int64 volatile*, __int64); long _InterlockedXor(long volatile*, long); __int64 _InterlockedXor64(__int64 volatile*, __int64); __int64 _InterlockedExchangeAdd64(__int64 volatile*, __int64); __int64 _InterlockedIncrement64(__int64 volatile*); __int64 _InterlockedDecrement64(__int64 volatile*); __int64 _InterlockedExchange64(__int64 volatile*, __int64); __int64 _InterlockedCompareExchange64(__int64 volatile*, __int64, __int64); #if !defined(_WIN64) #pragma intrinsic(_InterlockedAnd, _InterlockedAnd64) #pragma intrinsic(_InterlockedOr, _InterlockedOr64) #pragma intrinsic(_InterlockedXor, _InterlockedXor64) #pragma intrinsic(_InterlockedExchangeAdd64, _InterlockedIncrement64) #pragma intrinsic(_InterlockedDecrement64, _InterlockedExchange64) #pragma intrinsic(_InterlockedCompareExchange64) #endif /* !_WIN64 */ #endif /* __x86_64__ */ #ifdef __cplusplus } #endif #endif /* _MSC_VER */ #if defined(__arm__) /* * LDREX without STREX or CLREX may cause problems in environments where the * context switch may not clear the reference monitor - according ARM manual * the reference monitor should be cleared after a context switch, but some * may not like Linux kernel's non-preemptive context switch path. So use of * ARM routines in kernel code may not be safe. */ # if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) # define VM_ARM_V7 # ifdef __KERNEL__ # warning LDREX/STREX may not be safe in linux kernel, since it \ does not issue CLREX on context switch (as of 2011-09-29). # endif # else # error Only ARMv7 extends the synchronization primitives ldrex/strex. \ For the lower ARM version, please implement the atomic functions \ by kernel APIs. # endif #endif /* Data Memory Barrier */ #ifdef VM_ARM_V7 #define dmb() __asm__ __volatile__("dmb" : : : "memory") #endif /* Convert a volatile uint32 to Atomic_uint32. */ static INLINE Atomic_uint32 * Atomic_VolatileToAtomic(volatile uint32 *var) // IN: { return (Atomic_uint32 *)var; } /* Convert a volatile uint64 to Atomic_uint64. */ static INLINE Atomic_uint64 * Atomic_VolatileToAtomic64(volatile uint64 *var) // IN: { return (Atomic_uint64 *)var; } /* *----------------------------------------------------------------------------- * * Atomic_Init, Atomic_SetFence, AtomicUseFence -- * * Determine whether an lfence intruction is executed after * every locked instruction. * * Certain AMD processors have a bug (see bug 107024) that * requires an lfence after every locked instruction. * * The global variable AtomicUseFence controls whether lfence * is used (see AtomicEpilogue). * * Atomic_SetFence sets AtomicUseFence to the given value. * * Atomic_Init computes and sets AtomicUseFence for x86. * It does not take into account the number of processors. * * The rationale for all this complexity is that Atomic_Init * is the easy-to-use interface. It can be called a number * of times cheaply, and does not depend on other libraries. * However, because the number of CPUs is difficult to compute, * it does without it and always assumes there are more than one. * * For programs that care or have special requirements, * Atomic_SetFence can be called directly, in addition to Atomic_Init. * It overrides the effect of Atomic_Init, and can be called * before, after, or between calls to Atomic_Init. * *----------------------------------------------------------------------------- */ // The freebsd assembler doesn't know the lfence instruction #if defined(__GNUC__) && \ __GNUC__ >= 3 && \ (defined(__VMKERNEL__) || !defined(__FreeBSD__)) && \ (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \ !defined(__APPLE__) && \ (defined(__i386__) || defined(__x86_64__)) /* PR136775 */ #define ATOMIC_USE_FENCE #endif /* * Starting with vSphere 2014, we no longer support ESX on AMD Rev F. * Thus, we can eliminate all dynamic checks for whether to enable * the Errata 147 work-around when compiling many of our binaries. * However, we use an opt-in approach here rather than assuming all * parts of our builds are safe. For example, the "fdm" binary from * a new build may time travel back to hosts running older versions * of ESX on Rev F, so "fdm" continues to require the ability to * dynamically enable the errata work-around. With vSphere 2017, * this will no longer be required as the oldest version of ESX that * VC 2017 will support is ESX 2014 (which won't run on Rev F). * * Modules may explicitly define MAY_NEED_AMD_REVF_WORKAROUND as 0 prior to * inclusion of vm_atomic.h when they are safe on AMD Rev F with the elided * lfence. */ #if !defined(MAY_NEED_AMD_REVF_WORKAROUND) #if (!defined(VMX86_SERVER) || \ (!defined(VMX86_VMX) && !defined(VMKERNEL) && \ !defined(VMM) && !defined(VMCORE))) #define MAY_NEED_AMD_REVF_WORKAROUND 1 #else #define MAY_NEED_AMD_REVF_WORKAROUND 0 #endif #endif #if MAY_NEED_AMD_REVF_WORKAROUND #if defined(VMATOMIC_IMPORT_DLLDATA) VMX86_EXTERN_DATA Bool AtomicUseFence; #else EXTERN Bool AtomicUseFence; #endif EXTERN Bool atomicFenceInitialized; #else /* MAY_NEED_AMD_REVF_WORKAROUND */ #define AtomicUseFence FALSE #define atomicFenceInitialized TRUE #endif /* MAY_NEED_AMD_REVF_WORKAROUND */ void AtomicInitFence(void); static INLINE void Atomic_Init(void) { #ifdef ATOMIC_USE_FENCE if (MAY_NEED_AMD_REVF_WORKAROUND && !atomicFenceInitialized) { AtomicInitFence(); } #endif } static INLINE void Atomic_SetFence(Bool fenceAfterLock) // IN: { (void)fenceAfterLock; /* Work around unused parameter. */ #if MAY_NEED_AMD_REVF_WORKAROUND AtomicUseFence = fenceAfterLock; atomicFenceInitialized = TRUE; #endif } /* Conditionally execute fence after interlocked instruction. */ static INLINE void AtomicEpilogue(void) { #if MAY_NEED_AMD_REVF_WORKAROUND && defined(ATOMIC_USE_FENCE) #ifdef VMM /* The monitor conditionally patches out the lfence when not needed.*/ /* Construct a MonitorPatchTextEntry in the .patchtext section. */ asm volatile ("1:\n\t" "lfence\n\t" "2:\n\t" ".pushsection .patchtext\n\t" ".quad 1b\n\t" ".quad 2b\n\t" ".quad 0\n\t" ".popsection\n\t" ::: "memory"); #else if (UNLIKELY(AtomicUseFence)) { asm volatile ("lfence" ::: "memory"); } #endif #endif } /* * All the assembly code is tricky and written conservatively. * For example, to make sure gcc won't introduce copies, * we force the addressing mode like this: * * "xchgl %0, (%1)" * : "=r" (val) * : "r" (&var->value), * "0" (val) * : "memory" * * - edward * * Actually - turns out that gcc never generates memory aliases (it * still does generate register aliases though), so we can be a bit * more agressive with the memory constraints. The code above can be * modified like this: * * "xchgl %0, %1" * : "=r" (val), * "=m" (var->value), * : "0" (val), * "1" (var->value) * * The advantages are that gcc can use whatever addressing mode it * likes to access the memory value, and that we dont have to use a * way-too-generic "memory" clobber as there is now an explicit * declaration that var->value is modified. * * see also /usr/include/asm/atomic.h to convince yourself this is a * valid optimization. * * - walken */ #if defined(_MSC_VER) && _MSC_VER < 1600 && defined(__x86_64__) Bool VMWInterlockedExchangeBool(Bool volatile *ptr, Bool val); Bool VMWInterlockedCompareExchangeBool(Bool volatile *ptr, Bool newVal, Bool oldVal); #endif typedef struct Atomic_Bool { volatile Bool value; } Atomic_Bool; /* The ARM team can come along and add the code real soon now */ extern Bool AtomicUndefinedOnARM(void); /* *----------------------------------------------------------------------------- * * Atomic_ReadBool -- * * Read the value of the specified object atomically. * * Results: * The value of the atomic variable. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Atomic_ReadBool(Atomic_Bool const *var) // IN: { Bool val; #if defined(__GNUC__) && (defined(VM_ARM_32) || defined(VM_ARM_64)) val = AtomicUndefinedOnARM(); #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( "movb %1, %0" : "=q" (val) : "m" (var->value) ); #elif defined(_MSC_VER) val = var->value; #else #error No compiler defined for Atomic_ReadBool #endif return val; } /* *----------------------------------------------------------------------------- * * Atomic_ReadWriteBool -- * * Read followed by write. * * Results: * The value of the atomic variable before the write. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool Atomic_ReadWriteBool(Atomic_Bool *var, // IN/OUT: Bool val) // IN: { #if defined(__GNUC__) && (defined(VM_ARM_32) || defined(VM_ARM_64)) return AtomicUndefinedOnARM(); #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( "xchgb %0, %1" : "=q" (val), "+m" (var->value) : "0" (val) ); AtomicEpilogue(); return val; #elif defined(_MSC_VER) && _MSC_VER >= 1600 return _InterlockedExchange8(&var->value, val); #elif defined(_MSC_VER) && defined(__i386__) #pragma warning(push) #pragma warning(disable : 4035) // disable no-return warning { __asm movzx eax, val __asm mov ebx, var __asm xchg [ebx]Atomic_Bool.value, al } #pragma warning(pop) #elif defined(_MSC_VER) && defined(__x86_64__) return VMWInterlockedExchangeBool(&var->value, val); #else #error No compiler defined for Atomic_ReadBool #endif } /* *----------------------------------------------------------------------------- * * Atomic_WriteBool -- * * Write the specified value to the specified object atomically. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void Atomic_WriteBool(Atomic_Bool *var, // IN/OUT: Bool val) // IN: { #if defined(__GNUC__) && (defined(VM_ARM_32) || defined(VM_ARM_64)) AtomicUndefinedOnARM(); #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( "movb %1, %0" : "=m" (var->value) : "qn" (val) ); #elif defined(_MSC_VER) var->value = val; #else #error No compiler defined for Atomic_WriteBool #endif } /* *----------------------------------------------------------------------------- * * Atomic_ReadIfEqualWriteBool -- * * Compare exchange: Read variable, if equal to oldVal, write newVal. * * Results: * The value of the atomic variable before the write. * * Side effects: * The variable may be modified. * *----------------------------------------------------------------------------- */ static INLINE Bool Atomic_ReadIfEqualWriteBool(Atomic_Bool *var, // IN/OUT: Bool oldVal, // IN: Bool newVal) // IN: { #if defined(__GNUC__) && (defined(VM_ARM_32) || defined(VM_ARM_64)) return AtomicUndefinedOnARM(); #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) Bool val; __asm__ __volatile__( "lock; cmpxchgb %2, %1" : "=a" (val), "+m" (var->value) : "q" (newVal), "0" (oldVal) : "cc" ); AtomicEpilogue(); return val; #elif defined(_MSC_VER) && _MSC_VER >= 1600 return _InterlockedCompareExchange8(&var->value, newVal, oldVal); #elif defined(_MSC_VER) && defined(__i386__) #pragma warning(push) #pragma warning(disable : 4035) // disable no-return warning { __asm mov al, oldVal __asm mov ebx, var __asm mov cl, newVal __asm lock cmpxchg [ebx]Atomic_Bool.value, cl __asm movzx eax, al // eax is the return value, this is documented to work - edward } #pragma warning(pop) #elif defined(_MSC_VER) && defined(__x86_64__) return VMWInterlockedCompareExchangeBool(&var->value, newVal, oldVal); #else #error No compiler defined for Atomic_ReadIfEqualWriteBool #endif } /* *----------------------------------------------------------------------------- * * Atomic_Read -- * * Read * * Results: * The value of the atomic variable. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_Read(Atomic_uint32 const *var) // IN { uint32 value; #if defined(VMM) ASSERT(((uintptr_t)var % 4) == 0); #endif #if defined(__GNUC__) /* * Use inline assembler to force using a single load instruction to * ensure that the compiler doesn't split a transfer operation into multiple * instructions. */ #if defined(VM_ARM_32) __asm__ __volatile__( "ldr %0, [%1]" : "=r" (value) : "r" (&var->value) ); #elif defined(VM_ARM_64) __asm__ __volatile__ ( "ldr %w0, [%1]" : "=r" (value) : "r" (&var->value) ); #else __asm__ __volatile__( "mov %1, %0" : "=r" (value) : "m" (var->value) ); #endif #elif defined(_MSC_VER) /* * Microsoft docs guarantee simple reads and writes to properly * aligned 32-bit variables use only a single instruction. * http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx */ value = var->value; #else #error No compiler defined for Atomic_Read #endif return value; } #define Atomic_Read32 Atomic_Read /* *----------------------------------------------------------------------------- * * Atomic_ReadWrite -- * * Read followed by write * * Results: * The value of the atomic variable before the write. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadWrite(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 retVal; register volatile uint32 res; dmb(); __asm__ __volatile__( "1: ldrex %[retVal], [%[var]] \n\t" "strex %[res], %[val], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [retVal] "=&r" (retVal), [res] "=&r" (res) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); return retVal; #elif defined(VM_ARM_64) register uint32 retVal; register uint32 failed; __asm__ __volatile__( " dmb sy \n\t" "1: ldxr %w0, [%2] \n\t" " stxr %w1, %w3, [%2] \n\t" " cbnz %w1, 1b \n\t" " dmb sy \n\t" : "=&r" (retVal), "=&r" (failed) : "r" (&var->value), "r" (val) : "memory" ); return retVal; #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "xchgl %0, %1" : "=r" (val), "+m" (var->value) : "0" (val) ); AtomicEpilogue(); return val; #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 return _InterlockedExchange((long *)&var->value, (long)val); #else #pragma warning(push) #pragma warning(disable : 4035) // disable no-return warning { __asm mov eax, val __asm mov ebx, var __asm xchg [ebx]Atomic_uint32.value, eax // eax is the return value, this is documented to work - edward } #pragma warning(pop) #endif // _MSC_VER >= 1310 #else #error No compiler defined for Atomic_ReadWrite #endif // __GNUC__ } #define Atomic_ReadWrite32 Atomic_ReadWrite /* *----------------------------------------------------------------------------- * * Atomic_Write -- * * Write * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Write(Atomic_uint32 *var, // OUT uint32 val) // IN { #if defined(VMM) ASSERT(((uintptr_t)var % 4) == 0); #endif #if defined(__GNUC__) #if defined(VM_ARM_ANY) /* * A3.4.1 ARM DDI 0406C: * * When a processor writes using any instruction other than a * Store-Exclusive: * * - if the write is to a physical address that is not covered by its local * monitor the write does not affect the state of the local monitor * - if the write is to a physical address that is covered by its local * monitor it is IMPLEMENTATION DEFINED whether the write affects the * state of the local monitor. * * A3.4.5 ARM DDI 0406C: * * If two STREX instructions are executed without an intervening LDREX the * second STREX returns a status value of 1. This means that: * * - ARM recommends that, in a given thread of execution, every STREX has a * preceding LDREX associated with it * - it is not necessary for every LDREX to have a subsequent STREX. */ Atomic_ReadWrite(var, val); #else /* * Use inline assembler to force using a single store instruction to * ensure that the compiler doesn't split a transfer operation into multiple * instructions. */ __asm__ __volatile__( "mov %1, %0" : "=m" (var->value) : "r" (val) ); #endif #elif defined(_MSC_VER) /* * Microsoft docs guarantee simple reads and writes to properly * aligned 32-bit variables use only a single instruction. * http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx */ var->value = val; #else #error No compiler defined for Atomic_Write #endif } #define Atomic_Write32 Atomic_Write /* *----------------------------------------------------------------------------- * * Atomic_ReadIfEqualWrite -- * * Compare exchange: Read variable, if equal to oldVal, write newVal * * Results: * The value of the atomic variable before the write. * * Side effects: * The variable may be modified. * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadIfEqualWrite(Atomic_uint32 *var, // IN/OUT uint32 oldVal, // IN uint32 newVal) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register uint32 retVal; register uint32 res; dmb(); __asm__ __volatile__( "1: ldrex %[retVal], [%[var]] \n\t" "mov %[res], #0 \n\t" "teq %[retVal], %[oldVal] \n\t" "strexeq %[res], %[newVal], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [retVal] "=&r" (retVal), [res] "=&r" (res) : [var] "r" (&var->value), [oldVal] "r" (oldVal), [newVal] "r" (newVal) : "cc" ); dmb(); return retVal; #elif defined(VM_ARM_64) register uint32 retVal; register uint32 failed; __asm__ __volatile__ ( " dmb sy \n\t" "1: ldxr %w0, [%2] \n\t" " cmp %w0, %w3 \n\t" " b.ne 2f \n\t" " stxr %w1, %w4, [%2] \n\t" " cbnz %w1, 1b \n\t" "2: clrex \n\t" " dmb sy \n\t" : "=&r" (retVal), "=&r" (failed) : "r" (&var->value), "r" (oldVal), "r" (newVal) : "cc", "memory"); return retVal; #else /* VM_X86_ANY */ uint32 val; /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; cmpxchgl %2, %1" : "=a" (val), "+m" (var->value) : "r" (newVal), "0" (oldVal) : "cc" ); AtomicEpilogue(); return val; #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 return _InterlockedCompareExchange((long *)&var->value, (long)newVal, (long)oldVal); #else #pragma warning(push) #pragma warning(disable : 4035) // disable no-return warning { __asm mov eax, oldVal __asm mov ebx, var __asm mov ecx, newVal __asm lock cmpxchg [ebx]Atomic_uint32.value, ecx // eax is the return value, this is documented to work - edward } #pragma warning(pop) #endif #else #error No compiler defined for Atomic_ReadIfEqualWrite #endif } #define Atomic_ReadIfEqualWrite32 Atomic_ReadIfEqualWrite #if defined(VM_64BIT) || defined(VM_ARM_V7) /* *----------------------------------------------------------------------------- * * Atomic_ReadIfEqualWrite64 -- * * Compare exchange: Read variable, if equal to oldVal, write newVal * * Results: * The value of the atomic variable before the write. * * Side effects: * The variable may be modified. * *----------------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadIfEqualWrite64(Atomic_uint64 *var, // IN/OUT uint64 oldVal, // IN uint64 newVal) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register uint64 retVal; register uint32 res; dmb(); /* * Under Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn) * There will be a warning: * "value size does not match register size specified by the constraint * and modifier [-Wasm-operand-widths]" * on the lines: * : [var] "r" (&var->value), [oldVal] "r" (oldVal), [newVal] "r" (newVal) * ^ * : [var] "r" (&var->value), [oldVal] "r" (oldVal), [newVal] "r" (newVal) * ^ * * Furthermore, using a 32-bits register to store a * 64-bits value of an variable looks risky. */ #if defined(__APPLE__) && __clang__ == 1 && __clang_major__ >= 5 #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wasm-operand-widths" #endif __asm__ __volatile__( "1: ldrexd %[retVal], %H[retVal], [%[var]] \n\t" "mov %[res], #0 \n\t" "teq %[retVal], %[oldVal] \n\t" "teqeq %H[retVal], %H[oldVal] \n\t" "strexdeq %[res], %[newVal], %H[newVal], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [retVal] "=&r" (retVal), [res] "=&r" (res) : [var] "r" (&var->value), [oldVal] "r" (oldVal), [newVal] "r" (newVal) : "cc" ); #if defined(__APPLE__) && __clang__ == 1 && __clang_major__ >= 5 #pragma clang diagnostic pop #endif // defined(__APPLE__) && __clang__ == 1 && __clang_major__ >= 5 dmb(); return retVal; #elif defined(VM_ARM_64) register uint64 retVal; register uint32 failed; __asm__ __volatile__ ( " dmb sy \n\t" "1: ldxr %x0, [%2] \n\t" " cmp %x0, %x3 \n\t" " b.ne 2f \n\t" " stxr %w1, %x4, [%2] \n\t" " cbnz %w1, 1b \n\t" "2: clrex \n\t" " dmb sy \n\t" : "=&r" (retVal), "=&r" (failed) : "r" (&var->value), "r" (oldVal), "r" (newVal) : "cc", "memory"); return retVal; #else /* VM_X86_64 */ uint64 val; /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; cmpxchgq %2, %1" : "=a" (val), "+m" (var->value) : "r" (newVal), "0" (oldVal) : "cc" ); AtomicEpilogue(); return val; #endif //VM_ARM_V7 #elif defined _MSC_VER return _InterlockedCompareExchange64((__int64 *)&var->value, (__int64)newVal, (__int64)oldVal); #else #error No compiler defined for Atomic_ReadIfEqualWrite64 #endif } #endif /* *----------------------------------------------------------------------------- * * Atomic_And -- * * Atomic read, bitwise AND with a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_And(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 res; register volatile uint32 tmp; dmb(); __asm__ __volatile__( "1: ldrex %[tmp], [%[var]] \n\t" "and %[tmp], %[tmp], %[val] \n\t" "strex %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_32_OPV_PRIVATE_FENCED(var, val, and); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; andl %1, %0" : "+m" (var->value) : "ri" (val) : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if defined(__x86_64__) _InterlockedAnd((long *)&var->value, (long)val); #else __asm mov eax, val __asm mov ebx, var __asm lock and [ebx]Atomic_uint32.value, eax #endif #else #error No compiler defined for Atomic_And #endif } #define Atomic_And32 Atomic_And /* *----------------------------------------------------------------------------- * * Atomic_Or -- * * Atomic read, bitwise OR with a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Or(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 res; register volatile uint32 tmp; dmb(); __asm__ __volatile__( "1: ldrex %[tmp], [%[var]] \n\t" "orr %[tmp], %[tmp], %[val] \n\t" "strex %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_32_OPV_PRIVATE_FENCED(var, val, orr); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; orl %1, %0" : "+m" (var->value) : "ri" (val) : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if defined(__x86_64__) _InterlockedOr((long *)&var->value, (long)val); #else __asm mov eax, val __asm mov ebx, var __asm lock or [ebx]Atomic_uint32.value, eax #endif #else #error No compiler defined for Atomic_Or #endif } #define Atomic_Or32 Atomic_Or /* *----------------------------------------------------------------------------- * * Atomic_Xor -- * * Atomic read, bitwise XOR with a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Xor(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 res; register volatile uint32 tmp; dmb(); __asm__ __volatile__( "1: ldrex %[tmp], [%[var]] \n\t" "eor %[tmp], %[tmp], %[val] \n\t" "strex %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_32_OPV_PRIVATE_FENCED(var, val, eor); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; xorl %1, %0" : "+m" (var->value) : "ri" (val) : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if defined(__x86_64__) _InterlockedXor((long *)&var->value, (long)val); #else __asm mov eax, val __asm mov ebx, var __asm lock xor [ebx]Atomic_uint32.value, eax #endif #else #error No compiler defined for Atomic_Xor #endif } #define Atomic_Xor32 Atomic_Xor #if defined(VM_64BIT) /* *----------------------------------------------------------------------------- * * Atomic_Xor64 -- * * Atomic read, bitwise XOR with a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Xor64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if defined(__GNUC__) #if defined(VM_ARM_64) ARM_64_ATOMIC_64_OPV_PRIVATE_FENCED(var, val, eor); #else /* VM_X86_64 */ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; xorq %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #endif #elif defined _MSC_VER _InterlockedXor64((__int64 *)&var->value, (__int64)val); #else #error No compiler defined for Atomic_Xor64 #endif } #endif /* *----------------------------------------------------------------------------- * * Atomic_Add -- * * Atomic read, add a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Add(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 res; register volatile uint32 tmp; dmb(); __asm__ __volatile__( "1: ldrex %[tmp], [%[var]] \n\t" "add %[tmp], %[tmp], %[val] \n\t" "strex %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_32_OPV_PRIVATE_FENCED(var, val, add); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; addl %1, %0" : "+m" (var->value) : "ri" (val) : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 _InterlockedExchangeAdd((long *)&var->value, (long)val); #else __asm mov eax, val __asm mov ebx, var __asm lock add [ebx]Atomic_uint32.value, eax #endif #else #error No compiler defined for Atomic_Add #endif } #define Atomic_Add32 Atomic_Add /* *----------------------------------------------------------------------------- * * Atomic_Sub -- * * Atomic read, subtract a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Sub(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 res; register volatile uint32 tmp; dmb(); __asm__ __volatile__( "1: ldrex %[tmp], [%[var]] \n\t" "sub %[tmp], %[tmp], %[val] \n\t" "strex %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_32_OPV_PRIVATE_FENCED(var, val, sub); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; subl %1, %0" : "+m" (var->value) : "ri" (val) : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 _InterlockedExchangeAdd((long *)&var->value, (long)-val); #else __asm mov eax, val __asm mov ebx, var __asm lock sub [ebx]Atomic_uint32.value, eax #endif #else #error No compiler defined for Atomic_Sub #endif } #define Atomic_Sub32 Atomic_Sub /* *----------------------------------------------------------------------------- * * Atomic_Inc -- * * Atomic read, increment, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Inc(Atomic_uint32 *var) // IN/OUT { #ifdef __GNUC__ #if defined(VM_ARM_ANY) Atomic_Add(var, 1); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; incl %0" : "+m" (var->value) : : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 _InterlockedIncrement((long *)&var->value); #else __asm mov ebx, var __asm lock inc [ebx]Atomic_uint32.value #endif #else #error No compiler defined for Atomic_Inc #endif } #define Atomic_Inc32 Atomic_Inc /* *----------------------------------------------------------------------------- * * Atomic_Dec -- * * Atomic read, decrement, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Dec(Atomic_uint32 *var) // IN/OUT { #ifdef __GNUC__ #if defined(VM_ARM_ANY) Atomic_Sub(var, 1); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; decl %0" : "+m" (var->value) : : "cc" ); AtomicEpilogue(); #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 _InterlockedDecrement((long *)&var->value); #else __asm mov ebx, var __asm lock dec [ebx]Atomic_uint32.value #endif #else #error No compiler defined for Atomic_Dec #endif } #define Atomic_Dec32 Atomic_Dec /* * Note that the technique below can be used to implement ReadX(), where X is * an arbitrary mathematical function. */ /* *----------------------------------------------------------------------------- * * Atomic_ReadOr32 -- * * Atomic read (returned), bitwise OR with a value, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadOr32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { uint32 res; do { res = Atomic_Read(var); } while (res != Atomic_ReadIfEqualWrite(var, res, res | val)); return res; } /* *----------------------------------------------------------------------------- * * Atomic_ReadAnd32 -- * * Atomic read (returned), bitwise And with a value, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadAnd32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { uint32 res; do { res = Atomic_Read(var); } while (res != Atomic_ReadIfEqualWrite(var, res, res & val)); return res; } #if defined(VM_64BIT) /* *----------------------------------------------------------------------------- * * Atomic_ReadOr64 -- * * Atomic read (returned), bitwise OR with a value, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadOr64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { uint64 res; do { res = var->value; } while (res != Atomic_ReadIfEqualWrite64(var, res, res | val)); return res; } /* *----------------------------------------------------------------------------- * * Atomic_ReadAnd64 -- * * Atomic read (returned), bitwise AND with a value, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadAnd64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { uint64 res; do { res = var->value; } while (res != Atomic_ReadIfEqualWrite64(var, res, res & val)); return res; } #endif /* defined(VM_64BIT) */ /* *----------------------------------------------------------------------------- * * Atomic_ReadAdd32 -- * * Atomic read (returned), add a value, write. * * If you have to implement ReadAdd32() on an architecture other than * x86 or x86-64, you might want to consider doing something similar to * Atomic_ReadOr32(). * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadAdd32(Atomic_uint32 *var, // IN/OUT uint32 val) // IN { #if defined(__GNUC__) #ifdef VM_ARM_V7 register volatile uint32 res; register volatile uint32 retVal; register volatile uint32 tmp; dmb(); __asm__ __volatile__( "1: ldrex %[retVal], [%[var]] \n\t" "add %[tmp], %[val], %[retVal] \n\t" "strex %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [tmp] "=&r" (tmp), [res] "=&r" (res), [retVal] "=&r" (retVal) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); return retVal; #elif defined(VM_ARM_64) return ARM_64_ATOMIC_32_OPO_PRIVATE_FENCED(var, val, add); #else /* VM_X86_ANY */ /* Checked against the Intel manual and GCC --walken */ __asm__ __volatile__( "lock; xaddl %0, %1" : "=r" (val), "+m" (var->value) : "0" (val) : "cc" ); AtomicEpilogue(); return val; #endif /* VM_X86_ANY */ #elif defined _MSC_VER #if _MSC_VER >= 1310 return _InterlockedExchangeAdd((long *)&var->value, (long)val); #else #pragma warning(push) #pragma warning(disable : 4035) // disable no-return warning { __asm mov eax, val __asm mov ebx, var __asm lock xadd [ebx]Atomic_uint32.value, eax } #pragma warning(pop) #endif #else #error No compiler defined for Atomic_ReadAdd32 #endif } /* *----------------------------------------------------------------------------- * * Atomic_ReadInc32 -- * * Atomic read (returned), increment, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadInc32(Atomic_uint32 *var) // IN/OUT { return Atomic_ReadAdd32(var, 1); } /* *----------------------------------------------------------------------------- * * Atomic_ReadDec32 -- * * Atomic read (returned), decrement, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint32 Atomic_ReadDec32(Atomic_uint32 *var) // IN/OUT { return Atomic_ReadAdd32(var, (uint32)-1); } #if defined VMKERNEL || defined VMM #if !defined(VM_ARM_64) /* *----------------------------------------------------------------------------- * * CMPXCHG1B -- * * Compare and exchange a single byte. * * Results: * The value read from ptr. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint8 CMPXCHG1B(volatile uint8 *ptr, // IN/OUT uint8 oldVal, // IN uint8 newVal) // IN { uint8 val; __asm__ __volatile__("lock; cmpxchgb %b2, %1" : "=a" (val), "+m" (*ptr) : "r" (newVal), "0" (oldVal) : "cc"); return val; } #endif /* !defined(VM_ARM_64) */ #endif /* * Usage of this helper struct is strictly reserved to the following * function. --hpreg */ typedef struct { uint32 lowValue; uint32 highValue; } S_uint64; /* *----------------------------------------------------------------------------- * * Atomic_CMPXCHG64 -- * * Compare exchange: Read variable, if equal to oldVal, write newVal * * XXX: Ensure that if this function is to be inlined by gcc, it is * compiled with -fno-strict-aliasing. Otherwise it will break. * Unfortunately we know that gcc 2.95.3 (used to build the FreeBSD 3.2 * Tools) does not honor -fno-strict-aliasing. As a workaround, we avoid * inlining the function entirely for versions of gcc under 3.0. * * Results: * TRUE if equal, FALSE if not equal * * Side effects: * None * *----------------------------------------------------------------------------- */ #if defined(__GNUC__) && __GNUC__ < 3 static Bool #else static INLINE Bool #endif Atomic_CMPXCHG64(Atomic_uint64 *var, // IN/OUT uint64 const *oldVal, // IN uint64 const *newVal) // IN { #if defined(__GNUC__) #if defined(VM_ARM_ANY) return (Atomic_ReadIfEqualWrite64(var, *oldVal, *newVal) == *oldVal); #else /* VM_X86_ANY */ Bool equal; /* Checked against the Intel manual and GCC --walken */ #if defined(__x86_64__) uint64 dummy; __asm__ __volatile__( "lock; cmpxchgq %3, %0" "\n\t" "sete %1" : "+m" (*var), "=qm" (equal), "=a" (dummy) : "r" (*newVal), "2" (*oldVal) : "cc" ); #else /* 32-bit version for non-ARM */ int dummy1, dummy2; # if defined __PIC__ /* * Rules for __asm__ statements in __PIC__ code * -------------------------------------------- * * The compiler uses %ebx for __PIC__ code, so an __asm__ statement cannot * clobber %ebx. The __asm__ statement can temporarily modify %ebx, but _for * each parameter that is used while %ebx is temporarily modified_: * * 1) The constraint cannot be "m", because the memory location the compiler * chooses could then be relative to %ebx. * * 2) The constraint cannot be a register class which contains %ebx (such as * "r" or "q"), because the register the compiler chooses could then be * %ebx. (This happens when compiling the Fusion UI with gcc 4.2.1, Apple * build 5577.) * * 3) Using register classes even for other values is problematic, as gcc * can decide e.g. %ecx == %edi == 0 (as compile-time constants) and * ends up using one register for two things. Which breaks xchg's ability * to temporarily put the PIC pointer somewhere else. PR772455 * * For that reason alone, the __asm__ statement should keep the regions * where it temporarily modifies %ebx as small as possible, and should * prefer specific register assignments. */ # if __GNUC__ < 3 // Part of #188541 - for RHL 6.2 etc. __asm__ __volatile__( "xchg %%ebx, %6" "\n\t" "mov 4(%%ebx), %%ecx" "\n\t" "mov (%%ebx), %%ebx" "\n\t" "lock; cmpxchg8b (%3)" "\n\t" "xchg %%ebx, %6" "\n\t" "sete %0" : "=a" (equal), "=d" (dummy2), "=D" (dummy1) : /* * See the "Rules for __asm__ statements in __PIC__ code" above: %3 * must use a register class which does not contain %ebx. */ "S" (var), "0" (((S_uint64 const *)oldVal)->lowValue), "1" (((S_uint64 const *)oldVal)->highValue), "D" (newVal) : "ecx", "cc", "memory" ); # else __asm__ __volatile__( "xchgl %%ebx, %6" "\n\t" "lock; cmpxchg8b (%3)" "\n\t" "xchgl %%ebx, %6" "\n\t" "sete %0" : "=qm" (equal), "=a" (dummy1), "=d" (dummy2) : /* * See the "Rules for __asm__ statements in __PIC__ code" above: %3 * must use a register class which does not contain %ebx. * "a"/"c"/"d" are already used, so we are left with either "S" or "D". * * Note that this assembly uses ALL GP registers (with %esp reserved for * stack, %ebp reserved for frame, %ebx reserved for PIC). */ "S" (var), "1" (((S_uint64 const *)oldVal)->lowValue), "2" (((S_uint64 const *)oldVal)->highValue), "D" (((S_uint64 const *)newVal)->lowValue), "c" (((S_uint64 const *)newVal)->highValue) : "cc", "memory" ); # endif # else __asm__ __volatile__( "lock; cmpxchg8b %0" "\n\t" "sete %1" : "+m" (*var), "=qm" (equal), "=a" (dummy1), "=d" (dummy2) : "2" (((S_uint64 const *)oldVal)->lowValue), "3" (((S_uint64 const *)oldVal)->highValue), "b" (((S_uint64 const *)newVal)->lowValue), "c" (((S_uint64 const *)newVal)->highValue) : "cc" ); # endif #endif AtomicEpilogue(); return equal; #endif //VM_ARM_V7 #elif defined _MSC_VER #if defined(__x86_64__) return (__int64)*oldVal == _InterlockedCompareExchange64((__int64 *)&var->value, (__int64)*newVal, (__int64)*oldVal); #else #pragma warning(push) #pragma warning(disable : 4035) // disable no-return warning { __asm mov esi, var __asm mov edx, oldVal __asm mov ecx, newVal __asm mov eax, [edx]S_uint64.lowValue __asm mov edx, [edx]S_uint64.highValue __asm mov ebx, [ecx]S_uint64.lowValue __asm mov ecx, [ecx]S_uint64.highValue __asm lock cmpxchg8b [esi] __asm sete al __asm movzx eax, al // eax is the return value, this is documented to work - edward } #pragma warning(pop) #endif #else #error No compiler defined for Atomic_CMPXCHG64 #endif // !GNUC } /* *----------------------------------------------------------------------------- * * Atomic_CMPXCHG32 -- * * Compare exchange: Read variable, if equal to oldVal, write newVal * * Results: * TRUE if equal, FALSE if not equal * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool Atomic_CMPXCHG32(Atomic_uint32 *var, // IN/OUT uint32 oldVal, // IN uint32 newVal) // IN { #if defined(__GNUC__) #if defined(VM_ARM_ANY) return (Atomic_ReadIfEqualWrite(var, oldVal, newVal) == oldVal); #else /* VM_X86_ANY */ Bool equal; uint32 dummy; __asm__ __volatile__( "lock; cmpxchgl %3, %0" "\n\t" "sete %1" : "+m" (*var), "=qm" (equal), "=a" (dummy) : "r" (newVal), "2" (oldVal) : "cc" ); AtomicEpilogue(); return equal; #endif /* VM_X86_ANY */ #else // defined(__GNUC__) return (Atomic_ReadIfEqualWrite(var, oldVal, newVal) == oldVal); #endif // !defined(__GNUC__) } /* *----------------------------------------------------------------------------- * * Atomic_Read64 -- * * Read and return. * * Results: * The value of the atomic variable. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE uint64 Atomic_Read64(Atomic_uint64 const *var) // IN { #if defined(__GNUC__) && defined(__x86_64__) uint64 value; #ifdef VMM ASSERT((uintptr_t)var % 8 == 0); #endif /* * Use asm to ensure we emit a single load. */ __asm__ __volatile__( "movq %1, %0" : "=r" (value) : "m" (var->value) ); return value; #elif defined(__GNUC__) && defined(__i386__) uint64 value; /* * Since cmpxchg8b will replace the contents of EDX:EAX with the * value in memory if there is no match, we need only execute the * instruction once in order to atomically read 64 bits from * memory. The only constraint is that ECX:EBX must have the same * value as EDX:EAX so that if the comparison succeeds. We * intentionally don't tell gcc that we are using ebx and ecx as we * don't modify them and do not care what value they store. */ __asm__ __volatile__( "mov %%ebx, %%eax" "\n\t" "mov %%ecx, %%edx" "\n\t" "lock; cmpxchg8b %1" : "=&A" (value) : "m" (*var) : "cc" ); AtomicEpilogue(); return value; #elif defined (_MSC_VER) && defined(__x86_64__) /* * Microsoft docs guarantee "Simple reads and writes to properly * aligned 64-bit variables are atomic on 64-bit Windows." * http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx * * XXX Verify that value is properly aligned. Bug 61315. */ return var->value; #elif defined (_MSC_VER) && defined(__i386__) # pragma warning(push) # pragma warning(disable : 4035) // disable no-return warning { __asm mov ecx, var __asm mov edx, ecx __asm mov eax, ebx __asm lock cmpxchg8b [ecx] // edx:eax is the return value; this is documented to work. --mann } # pragma warning(pop) #elif defined(__GNUC__) && defined (VM_ARM_V7) uint64 value; __asm__ __volatile__( "ldrexd %[value], %H[value], [%[var]] \n\t" : [value] "=&r" (value) : [var] "r" (&var->value) ); return value; #elif defined(__GNUC__) && defined(VM_ARM_64) uint64 value; __asm__ __volatile__( "ldr %0, [%1]" : "=r" (value) : "r" (&var->value)); return value; #endif /* defined(__GNUC__) && defined(VM_ARM_64) */ } /* *---------------------------------------------------------------------- * * Atomic_ReadUnaligned64 -- * * Atomically read a 64 bit integer, possibly misaligned. * This function can be *very* expensive, costing over 50 kcycles * on Nehalem. * * Note that "var" needs to be writable, even though it will not * be modified. * * Results: * The value of the atomic variable. * * Side effects: * None * *---------------------------------------------------------------------- */ #if defined(VM_64BIT) static INLINE uint64 Atomic_ReadUnaligned64(Atomic_uint64 const *var) // IN: { return Atomic_ReadIfEqualWrite64((Atomic_uint64*)var, 0, 0); } #endif /* *---------------------------------------------------------------------- * * Atomic_ReadAdd64 -- * * Atomically adds a 64-bit integer to another * * Results: * Returns the old value just prior to the addition * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadAdd64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if defined(VM_ARM_64) return ARM_64_ATOMIC_64_OPO_PRIVATE_FENCED(var, val, add); #elif defined(__x86_64__) #if defined(__GNUC__) __asm__ __volatile__( "lock; xaddq %0, %1" : "=r" (val), "+m" (var->value) : "0" (val) : "cc" ); AtomicEpilogue(); return val; #elif defined _MSC_VER return _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)val); #else #error No compiler defined for Atomic_ReadAdd64 #endif #else uint64 oldVal; uint64 newVal; do { oldVal = var->value; newVal = oldVal + val; } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); return oldVal; #endif } /* *---------------------------------------------------------------------- * * Atomic_ReadSub64 -- * * Atomically subtracts a 64-bit integer to another * * Results: * Returns the old value just prior to the subtraction * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadSub64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { return Atomic_ReadAdd64(var, -val); } /* *---------------------------------------------------------------------- * * Atomic_ReadInc64 -- * * Atomically increments a 64-bit integer * * Results: * Returns the old value just prior to incrementing * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadInc64(Atomic_uint64 *var) // IN/OUT { return Atomic_ReadAdd64(var, 1); } /* *---------------------------------------------------------------------- * * Atomic_ReadDec64 -- * * Atomically decrements a 64-bit integer * * Results: * Returns the old value just prior to decrementing * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadDec64(Atomic_uint64 *var) // IN/OUT { return Atomic_ReadAdd64(var, CONST64U(-1)); } /* *----------------------------------------------------------------------------- * * Atomic_Add64 -- * * Atomic read, add a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Add64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if !defined(VM_64BIT) Atomic_ReadAdd64(var, val); /* Return value is unused. */ #elif defined(__GNUC__) #if defined(VM_ARM_64) ARM_64_ATOMIC_64_OPV_PRIVATE_FENCED(var, val, add); #else /* defined(VM_X86_64) */ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; addq %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #endif #elif defined _MSC_VER _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)val); #else #error No compiler defined for Atomic_Add64 #endif } /* *----------------------------------------------------------------------------- * * Atomic_Sub64 -- * * Atomic read, subtract a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Sub64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if !defined(__x86_64__) Atomic_ReadSub64(var, val); /* Return value is unused. */ #elif defined(__GNUC__) #if defined(VM_ARM_64) ARM_64_ATOMIC_64_OPV_PRIVATE_FENCED(var, val, sub); #else /* VM_X86_64 */ /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; subq %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #endif #elif defined _MSC_VER _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)-val); #else #error No compiler defined for Atomic_Sub64 #endif } /* *----------------------------------------------------------------------------- * * Atomic_Inc64 -- * * Atomic read, increment, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Inc64(Atomic_uint64 *var) // IN/OUT { #if !defined(__x86_64__) Atomic_ReadInc64(var); /* Return value is unused. */ #elif defined(__GNUC__) /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; incq %0" : "+m" (var->value) : : "cc" ); AtomicEpilogue(); #elif defined _MSC_VER _InterlockedIncrement64((__int64 *)&var->value); #else #error No compiler defined for Atomic_Inc64 #endif } /* *----------------------------------------------------------------------------- * * Atomic_Dec64 -- * * Atomic read, decrement, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Dec64(Atomic_uint64 *var) // IN/OUT { #if !defined(__x86_64__) Atomic_ReadDec64(var); /* Return value is unused. */ #elif defined(__GNUC__) /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; decq %0" : "+m" (var->value) : : "cc" ); AtomicEpilogue(); #elif defined _MSC_VER _InterlockedDecrement64((__int64 *)&var->value); #else #error No compiler defined for Atomic_Dec64 #endif } /* *----------------------------------------------------------------------------- * * Atomic_ReadWrite64 -- * * Read followed by write * * Results: * The value of the atomic variable before the write. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint64 Atomic_ReadWrite64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if defined(__x86_64__) #if defined(__GNUC__) /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "xchgq %0, %1" : "=r" (val), "+m" (var->value) : "0" (val) ); AtomicEpilogue(); return val; #elif defined _MSC_VER return _InterlockedExchange64((__int64 *)&var->value, (__int64)val); #else #error No compiler defined for Atomic_ReadWrite64 #endif #else uint64 oldVal; do { oldVal = var->value; } while (!Atomic_CMPXCHG64(var, &oldVal, &val)); return oldVal; #endif } /* *----------------------------------------------------------------------------- * * Atomic_Write64 -- * * Write * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Write64(Atomic_uint64 *var, // OUT uint64 val) // IN { #if defined(__x86_64__) #if defined(__GNUC__) #ifdef VMM ASSERT((uintptr_t)var % 8 == 0); #endif /* * There is no move instruction for 64-bit immediate to memory, so unless * the immediate value fits in 32-bit (i.e. can be sign-extended), GCC * breaks the assignment into two movl instructions. The code below forces * GCC to load the immediate value into a register first. */ __asm__ __volatile__( "movq %1, %0" : "=m" (var->value) : "r" (val) ); #elif defined _MSC_VER /* * Microsoft docs guarantee "Simple reads and writes to properly aligned * 64-bit variables are atomic on 64-bit Windows." * http://msdn.microsoft.com/en-us/library/ms684122%28VS.85%29.aspx * * XXX Verify that value is properly aligned. Bug 61315. */ var->value = val; #else #error No compiler defined for Atomic_Write64 #endif #else /* defined(__x86_64__) */ (void)Atomic_ReadWrite64(var, val); #endif } /* *----------------------------------------------------------------------------- * * Atomic_Or64 -- * * Atomic read, bitwise OR with a 64-bit value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Or64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if defined(__x86_64__) #if defined(__GNUC__) /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; orq %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined _MSC_VER _InterlockedOr64((__int64 *)&var->value, (__int64)val); #else #error No compiler defined for Atomic_Or64 #endif #else // __x86_64__ uint64 oldVal; uint64 newVal; do { oldVal = var->value; newVal = oldVal | val; } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); #endif } /* *----------------------------------------------------------------------------- * * Atomic_And64 -- * * Atomic read, bitwise AND with a 64-bit value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_And64(Atomic_uint64 *var, // IN/OUT uint64 val) // IN { #if defined(__x86_64__) #if defined(__GNUC__) /* Checked against the AMD manual and GCC --hpreg */ __asm__ __volatile__( "lock; andq %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined _MSC_VER _InterlockedAnd64((__int64 *)&var->value, (__int64)val); #else #error No compiler defined for Atomic_And64 #endif #else // __x86_64__ uint64 oldVal; uint64 newVal; do { oldVal = var->value; newVal = oldVal & val; } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); #endif } /* *----------------------------------------------------------------------------- * * Atomic_SetBit64 -- * * Atomically set the bit 'bit' in var. Bit must be between 0 and 63. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_SetBit64(Atomic_uint64 *var, // IN/OUT uint64 bit) // IN { #if defined(__x86_64__) #if defined(__GNUC__) ASSERT(bit <= 63); __asm__ __volatile__( "lock; bts %1, %0" : "+m" (var->value) : "ri" (bit) : "cc" ); AtomicEpilogue(); #elif defined _MSC_VER uint64 oldVal; uint64 newVal; ASSERT(bit <= 63); do { oldVal = var->value; newVal = oldVal | (CONST64U(1) << bit); } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); #else #error No compiler defined for Atomic_SetBit64 #endif #else // __x86_64__ uint64 oldVal; uint64 newVal; ASSERT(bit <= 63); do { oldVal = var->value; newVal = oldVal | (CONST64U(1) << bit); } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); #endif } /* *----------------------------------------------------------------------------- * * Atomic_ClearBit64 -- * * Atomically clear the bit 'bit' in var. Bit must be between 0 and 63. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_ClearBit64(Atomic_uint64 *var, // IN/OUT uint64 bit) // IN { #if defined(__x86_64__) #if defined(__GNUC__) ASSERT(bit <= 63); __asm__ __volatile__( "lock; btr %1, %0" : "+m" (var->value) : "ri" (bit) : "cc" ); AtomicEpilogue(); #elif defined _MSC_VER uint64 oldVal; uint64 newVal; ASSERT(bit <= 63); do { oldVal = var->value; newVal = oldVal & ~(CONST64U(1) << bit); } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); #else #error No compiler defined for Atomic_ClearBit64 #endif #else // __x86_64__ uint64 oldVal; uint64 newVal; ASSERT(bit <= 63); do { oldVal = var->value; newVal = oldVal & ~(CONST64U(1) << bit); } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); #endif } /* *----------------------------------------------------------------------------- * * Atomic_TestBit64 -- * * Read the bit 'bit' in var. Bit must be between 0 and 63. * * Results: * TRUE if the tested bit was set; else FALSE. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool Atomic_TestBit64(Atomic_uint64 *var, // IN uint64 bit) // IN { #if defined(__x86_64__) #if defined(__GNUC__) Bool out = FALSE; ASSERT(bit <= 63); __asm__ __volatile__( "bt %2, %1; setc %0" : "=rm"(out) : "m" (var->value), "rJ" (bit) : "cc" ); return out; #elif defined _MSC_VER ASSERT(bit <= 63); return (var->value & (CONST64U(1) << bit)) != 0; #else #error No compiler defined for Atomic_TestBit64 #endif #else // __x86_64__ ASSERT(bit <= 63); return (var->value & (CONST64U(1) << bit)) != 0; #endif } #if defined(__GNUC__) /* *----------------------------------------------------------------------------- * * Atomic_Read16 -- * * Read and return. * * Results: * The value of the atomic variable. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE uint16 Atomic_Read16(Atomic_uint16 const *var) // IN { uint16 value; #ifdef VMM ASSERT((uintptr_t)var % 2 == 0); #endif #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "movw %1, %0" : "=r" (value) : "m" (var->value) ); #elif defined(VM_ARM_V7) NOT_TESTED(); __asm__ __volatile__( "ldrh %0, [%1]" : "=r" (value) : "r" (&var->value) ); #elif defined(VM_ARM_64) __asm__ __volatile__ ( "ldrh %w0, [%1]" : "=r" (value) : "r" (&var->value) ); #else #error No 16-bits atomics. #endif #endif return value; } /* *----------------------------------------------------------------------------- * * Atomic_ReadWrite16 -- * * Read followed by write * * Results: * The value of the atomic variable before the write. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint16 Atomic_ReadWrite16(Atomic_uint16 *var, // IN/OUT: uint16 val) // IN: { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "xchgw %0, %1" : "=r" (val), "+m" (var->value) : "0" (val) ); AtomicEpilogue(); return val; #elif defined(VM_ARM_V7) register volatile uint16 retVal; register volatile uint16 res; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[retVal], [%[var]] \n\t" "strexh %[res], %[val], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [retVal] "=&r" (retVal), [res] "=&r" (res) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); return retVal; #elif defined(VM_ARM_64) register uint16 retVal; register uint16 failed; __asm__ __volatile__( " dmb sy \n\t" "1: ldxrh %w0, [%2] \n\t" " stxrh %w1, %w3, [%2] \n\t" " cbnz %w1, 1b \n\t" " dmb sy \n\t" : "=&r" (retVal), "=&r" (failed) : "r" (&var->value), "r" (val) : "memory" ); return retVal; #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Write16 -- * * Write * * Results: * None. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Write16(Atomic_uint16 *var, // OUT: uint16 val) // IN: { #ifdef VMM ASSERT((uintptr_t)var % 2 == 0); #endif #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "movw %1, %0" : "=m" (var->value) : "r" (val) ); #elif defined(VM_ARM_ANY) Atomic_ReadWrite16(var, val); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_ReadIfEqualWrite16 -- * * Compare exchange: Read variable, if equal to oldVal, write newVal * * Results: * The value of the atomic variable before the write. * * Side effects: * The variable may be modified. * *----------------------------------------------------------------------------- */ static INLINE uint16 Atomic_ReadIfEqualWrite16(Atomic_uint16 *var, // IN/OUT uint16 oldVal, // IN uint16 newVal) // IN { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) uint16 val; __asm__ __volatile__( "lock; cmpxchgw %2, %1" : "=a" (val), "+m" (var->value) : "r" (newVal), "0" (oldVal) : "cc" ); AtomicEpilogue(); return val; #elif defined(VM_ARM_V7) register uint16 retVal; register uint16 res; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[retVal], [%[var]] \n\t" "mov %[res], #0 \n\t" "teq %[retVal], %[oldVal] \n\t" "strexheq %[res], %[newVal], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [retVal] "=&r" (retVal), [res] "=&r" (res) : [var] "r" (&var->value), [oldVal] "r" (oldVal), [newVal] "r" (newVal) : "cc" ); dmb(); return retVal; #elif defined(VM_ARM_64) register uint16 retVal; register uint16 failed; __asm__ __volatile__ ( " dmb sy \n\t" "1: ldxrh %w0, [%2] \n\t" " cmp %w0, %w3 \n\t" " b.ne 2f \n\t" " stxrh %w1, %w4, [%2] \n\t" " cbnz %w1, 1b \n\t" "2: clrex \n\t" " dmb sy \n\t" : "=&r" (retVal), "=&r" (failed) : "r" (&var->value), "r" (oldVal), "r" (newVal) : "cc", "memory"); return retVal; #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_And16 -- * * Atomic read, bitwise AND with a 16-bit value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_And16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; andw %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_V7) register volatile uint16 res; register volatile uint16 tmp; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[tmp], [%[var]] \n\t" "and %[tmp], %[tmp], %[val] \n\t" "strexh %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_16_OPV_PRIVATE_FENCED(var, val, and); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Or16 -- * * Atomic read, bitwise OR with a 16-bit value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Or16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; orw %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_V7) register volatile uint16 res; register volatile uint16 tmp; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[tmp], [%[var]] \n\t" "orr %[tmp], %[tmp], %[val] \n\t" "strexh %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_16_OPV_PRIVATE_FENCED(var, val, orr); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Xor16 -- * * Atomic read, bitwise XOR with a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Xor16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; xorw %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_V7) register volatile uint16 res; register volatile uint16 tmp; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[tmp], [%[var]] \n\t" "eor %[tmp], %[tmp], %[val] \n\t" "strexh %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_16_OPV_PRIVATE_FENCED(var, val, eor); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Add16 -- * * Atomic read, add a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Add16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; addw %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_V7) register volatile uint16 res; register volatile uint16 tmp; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[tmp], [%[var]] \n\t" "add %[tmp], %[tmp], %[val] \n\t" "strexh %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_16_OPV_PRIVATE_FENCED(var, val, add); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Sub16 -- * * Atomic read, subtract a value, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Sub16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; subw %1, %0" : "+m" (var->value) : "re" (val) : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_V7) register volatile uint16 res; register volatile uint16 tmp; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[tmp], [%[var]] \n\t" "sub %[tmp], %[tmp], %[val] \n\t" "strexh %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [res] "=&r" (res), [tmp] "=&r" (tmp) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); #elif defined(VM_ARM_64) ARM_64_ATOMIC_16_OPV_PRIVATE_FENCED(var, val, sub); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Inc16 -- * * Atomic read, increment, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Inc16(Atomic_uint16 *var) // IN/OUT { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; incw %0" : "+m" (var->value) : : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_ANY) Atomic_Add16(var, 1); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_Dec16 -- * * Atomic read, decrement, write. * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Atomic_Dec16(Atomic_uint16 *var) // IN/OUT { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; decw %0" : "+m" (var->value) : : "cc" ); AtomicEpilogue(); #elif defined(VM_ARM_ANY) Atomic_Sub16(var, 1); #else #error No 16-bits atomics. #endif #endif } /* *----------------------------------------------------------------------------- * * Atomic_ReadOr16 -- * * Atomic read (returned), bitwise OR with a value, write. * * Results: * The value of the variable before the operation. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE uint16 Atomic_ReadOr16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN { uint16 res; do { res = var->value; } while (res != Atomic_ReadIfEqualWrite16(var, res, res | val)); return res; } /* *---------------------------------------------------------------------- * * Atomic_ReadAdd16 -- * * Atomically adds a 16-bit integer to another * * Results: * Returns the old value just prior to the addition * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint16 Atomic_ReadAdd16(Atomic_uint16 *var, // IN/OUT uint16 val) // IN: { #if defined(__GNUC__) #if (defined(__x86_64__) || defined(__i386__)) __asm__ __volatile__( "lock; xaddw %0, %1" : "=r" (val), "+m" (var->value) : "0" (val) : "cc" ); AtomicEpilogue(); return val; #elif defined(VM_ARM_V7) register volatile uint16 res; register volatile uint16 retVal; register volatile uint16 tmp; NOT_TESTED(); dmb(); __asm__ __volatile__( "1: ldrexh %[retVal], [%[var]] \n\t" "add %[tmp], %[val], %[retVal] \n\t" "strexh %[res], %[tmp], [%[var]] \n\t" "teq %[res], #0 \n\t" "bne 1b" : [tmp] "=&r" (tmp), [res] "=&r" (res), [retVal] "=&r" (retVal) : [var] "r" (&var->value), [val] "r" (val) : "cc" ); dmb(); return retVal; #elif defined(VM_ARM_64) return ARM_64_ATOMIC_16_OPO_PRIVATE_FENCED(var, val, add); #else #error No 16-bits atomics. #endif #endif } /* *---------------------------------------------------------------------- * * Atomic_ReadInc16 -- * * Atomically increments a 64-bit integer * * Results: * Returns the old value just prior to incrementing * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint16 Atomic_ReadInc16(Atomic_uint16 *var) // IN/OUT { return Atomic_ReadAdd16(var, 1); } /* *---------------------------------------------------------------------- * * Atomic_ReadDec16 -- * * Atomically decrements a 64-bit integer * * Results: * Returns the old value just prior to decrementing * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE uint16 Atomic_ReadDec16(Atomic_uint16 *var) // IN/OUT { return Atomic_ReadAdd16(var, -1); } #endif /* * Template code for the Atomic_ type and its operators. * * The cast argument is an intermediate type cast to make some * compilers stop complaining about casting uint32 <-> void *, * even though we only do it in the 32-bit case so they are always * the same size. So for val of type uint32, instead of * (void *)val, we have (void *)(uintptr_t)val. * The specific problem case is the Windows ddk compiler * (as used by the SVGA driver). -- edward * * NOTE: See the comment in vm_assert.h for why we need UNUSED_TYPE in * AtomicAssertOnCompile(), and why we need to be very careful doing so. */ #define MAKE_ATOMIC_TYPE(name, size, in, out, cast) \ typedef Atomic_uint ## size Atomic_ ## name; \ \ \ static INLINE void \ AtomicAssertOnCompile ## name(void) \ { \ enum { AssertOnCompileMisused = 8 * sizeof (in) == size \ && 8 * sizeof (out) == size \ && 8 * sizeof (cast) == size \ ? 1 : -1 }; \ UNUSED_TYPE(typedef char AssertOnCompileFailed[AssertOnCompileMisused]);\ } \ \ \ static INLINE out \ Atomic_Read ## name(Atomic_ ## name const *var) \ { \ return (out)(cast)Atomic_Read ## size(var); \ } \ \ \ static INLINE void \ Atomic_Write ## name(Atomic_ ## name *var, \ in val) \ { \ Atomic_Write ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE out \ Atomic_ReadWrite ## name(Atomic_ ## name *var, \ in val) \ { \ return (out)(cast)Atomic_ReadWrite ## size(var, \ (uint ## size)(cast)val); \ } \ \ \ static INLINE out \ Atomic_ReadIfEqualWrite ## name(Atomic_ ## name *var, \ in oldVal, \ in newVal) \ { \ return (out)(cast)Atomic_ReadIfEqualWrite ## size(var, \ (uint ## size)(cast)oldVal, (uint ## size)(cast)newVal); \ } \ \ \ static INLINE void \ Atomic_And ## name(Atomic_ ## name *var, \ in val) \ { \ Atomic_And ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE void \ Atomic_Or ## name(Atomic_ ## name *var, \ in val) \ { \ Atomic_Or ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE void \ Atomic_Xor ## name(Atomic_ ## name *var, \ in val) \ { \ Atomic_Xor ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE void \ Atomic_Add ## name(Atomic_ ## name *var, \ in val) \ { \ Atomic_Add ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE void \ Atomic_Sub ## name(Atomic_ ## name *var, \ in val) \ { \ Atomic_Sub ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE void \ Atomic_Inc ## name(Atomic_ ## name *var) \ { \ Atomic_Inc ## size(var); \ } \ \ \ static INLINE void \ Atomic_Dec ## name(Atomic_ ## name *var) \ { \ Atomic_Dec ## size(var); \ } \ \ \ static INLINE out \ Atomic_ReadOr ## name(Atomic_ ## name *var, \ in val) \ { \ return (out)(cast)Atomic_ReadOr ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE out \ Atomic_ReadAdd ## name(Atomic_ ## name *var, \ in val) \ { \ return (out)(cast)Atomic_ReadAdd ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE out \ Atomic_ReadInc ## name(Atomic_ ## name *var) \ { \ return (out)(cast)Atomic_ReadInc ## size(var); \ } \ \ \ static INLINE out \ Atomic_ReadDec ## name(Atomic_ ## name *var) \ { \ return (out)(cast)Atomic_ReadDec ## size(var); \ } /* * Since we use a macro to generate these definitions, it is hard to look for * them. So DO NOT REMOVE THIS COMMENT and keep it up-to-date. --hpreg * * Atomic_Ptr * Atomic_ReadPtr -- * Atomic_WritePtr -- * Atomic_ReadWritePtr -- * Atomic_ReadIfEqualWritePtr -- * Atomic_AndPtr -- * Atomic_OrPtr -- * Atomic_XorPtr -- * Atomic_AddPtr -- * Atomic_SubPtr -- * Atomic_IncPtr -- * Atomic_DecPtr -- * Atomic_ReadOrPtr -- * Atomic_ReadAddPtr -- * Atomic_ReadIncPtr -- * Atomic_ReadDecPtr -- * * Atomic_Int * Atomic_ReadInt -- * Atomic_WriteInt -- * Atomic_ReadWriteInt -- * Atomic_ReadIfEqualWriteInt -- * Atomic_AndInt -- * Atomic_OrInt -- * Atomic_XorInt -- * Atomic_AddInt -- * Atomic_SubInt -- * Atomic_IncInt -- * Atomic_DecInt -- * Atomic_ReadOrInt -- * Atomic_ReadAddInt -- * Atomic_ReadIncInt -- * Atomic_ReadDecInt -- */ #if defined(VM_64BIT) MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *, uintptr_t) #else MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *, uintptr_t) #endif MAKE_ATOMIC_TYPE(Int, 32, int, int, int) /* Prevent the compiler from re-ordering memory references. */ #ifdef __GNUC__ #define ATOMIC_COMPILER_BARRIER() __asm__ __volatile__ ("": : :"memory") #elif defined(_MSC_VER) #define ATOMIC_COMPILER_BARRIER() _ReadWriteBarrier() #else #error No compiler defined for ATOMIC_COMPILER_BARRIER #endif /* *----------------------------------------------------------------------------- * * Atomic_MFence -- * * Implements mfence in terms of a lock xor. The reason for implementing * our own mfence is that not all of our supported cpus have an assembly * mfence (P3, Athlon). We put it here to avoid duplicating code which is * also why it is prefixed with "Atomic_". Moreover, this implementation * performs slightly better than 'mfence' on modern CPUs (See PR 817059). * * Results: * None. * * Side effects: * Cause loads and stores prior to this to be globally * visible. * *----------------------------------------------------------------------------- */ static INLINE void Atomic_MFence(void) { Atomic_uint32 fence; ATOMIC_COMPILER_BARRIER(); Atomic_Xor(&fence, 0x1); ATOMIC_COMPILER_BARRIER(); } #ifdef ATOMIC_COMPILER_BARRIER #undef ATOMIC_COMPILER_BARRIER #endif /* ATOMIC_COMPILER_BARRIER */ #endif // ifndef _ATOMIC_H_ open-vm-tools-10.0.7-3227872/lib/include/impersonate.h0000644000000000000000000000320212660700526020541 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * impersonate.h -- * * Provides functions to assist in impersonating and unimpersonating * as a given user. */ #ifndef _IMPERSONATE_H_ #define _IMPERSONATE_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "auth.h" extern void Impersonate_Init(void); extern Bool Impersonate_Owner(const char *file); extern Bool Impersonate_Do(const char *user, AuthToken token); extern Bool Impersonate_Undo(void); extern char *Impersonate_Who(void); extern Bool Impersonate_ForceRoot(void); extern Bool Impersonate_UnforceRoot(void); extern Bool Impersonate_Runas(const char *cfg, const char *caller, AuthToken callerToken); #ifdef _WIN32 extern Bool Impersonate_CfgRunasOnly(const char *cfg); #endif #endif // ifndef _IMPERSONATE_H_ open-vm-tools-10.0.7-3227872/lib/include/mntinfo.h0000644000000000000000000001653312660700526017700 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * mntinfo.h -- * * Macros to abstract differences between structures and functions used in * accessing information about mounted file systems. * */ #ifndef __MNTINFO_H__ #define __MNTINFO_H__ #ifdef sun # include # include # include #elif defined(__linux__) # include #elif defined(__FreeBSD__) # include #endif #include "posix.h" /* *---------------------------------------------------------------------------- * * DECLARE_MNTINFO, MNTINFO * OPEN_MNTFILE, GETNEXT_MNTINFO, CLOSE_MNTFILE, * MNTINFO_NAME, MNTINFO_FSTYPE, MNTINFO_MNTPT -- * * Cross-platform macros for accessing information about the mounted file * systems. This is necessary since the interfaces for getmntent(3) are * slightly different on Linux and Solaris. * * DECLARE_MNTINFO() is used to declare the variable used when invoking * GETNEXT_MNTINFO(). MNTINFO is the type that can be used when passing * between functions. * * OPEN_MNTFILE() and CLOSE_MNTFILE() must be called before and after * a series of GETNEXT_MNTINFO() calls, respectively. GETNEXT_MNTINFO() is * called successively to retrieve information about the next mounted file * system. * * MNTINFO_NAME, MNTINFO_FSTYPE, and MNTINFO_MNTPT retrieve the name, file * system type, and mount point of the provided MNTINFO, respectively. * * MNTFILE is a string with the name of the file containing mount * information. * * Results: * OPEN_MNTFILE: MNTHANDLE on success, NULL on failure * GETNEXT_MNTINFO: on success, TRUE and mnt is filled with file system's * information; FALSE when no mounts left or on failure * CLOSE_MNTFILE: TRUE on success, FALSE on failure * * MNTINFO_NAME: mount's name on success, NULL on failure * MNTINFO_FSTYPE: mount's file system type on success, NULL on failure * MNTINFO_MNTPT: mount's mount point on success, NULL on failure * * Side effects: * None. * *---------------------------------------------------------------------------- */ #ifdef sun # define MNTFILE MNTTAB # define MNTHANDLE FILE * # define MNTINFO struct mnttab # define DECLARE_MNTINFO(name) struct mnttab __ ## name; \ struct mnttab *name = &__ ## name # define OPEN_MNTFILE(mode) Posix_Fopen(MNTFILE, mode) # define GETNEXT_MNTINFO(fp, mnt) (Posix_Getmntent(fp, mnt) == 0) # define CLOSE_MNTFILE(fp) (fclose(fp) == 0) # define MNTINFO_NAME(mnt) mnt->mnt_special # define MNTINFO_FSTYPE(mnt) mnt->mnt_fstype # define MNTINFO_MNTPT(mnt) mnt->mnt_mountp # define MNTINFO_MNT_IS_RO(mnt) (hasmntopt((mnt), "rw") == NULL) #elif defined(__linux__) # define MNTFILE MOUNTED # define MNTHANDLE FILE * # define MNTINFO struct mntent # define DECLARE_MNTINFO(name) struct mntent *name # define OPEN_MNTFILE(mode) Posix_Setmntent(MNTFILE, mode) # define GETNEXT_MNTINFO(fp, mnt) ((mnt = Posix_Getmntent(fp)) != NULL) # define CLOSE_MNTFILE(fp) (endmntent(fp) == 1) # define MNTINFO_NAME(mnt) mnt->mnt_fsname # define MNTINFO_FSTYPE(mnt) mnt->mnt_type # define MNTINFO_MNTPT(mnt) mnt->mnt_dir # define MNTINFO_MNT_IS_RO(mnt) (hasmntopt((mnt), "rw") == NULL) #elif defined(__FreeBSD__) || defined(__APPLE__) struct mntHandle { struct statfs *mountPoints; // array of mountpoints per getmntinfo(3) int numMountPoints; // number of elements in mntArray int mountIndex; // current location within mountPoints array }; # define MNTFILE _PATH_FSTAB # define MNTHANDLE struct mntHandle * # define MNTINFO struct statfs # define DECLARE_MNTINFO(name) struct statfs __ ## name; \ struct statfs *name = &__ ## name # define OPEN_MNTFILE(mode) \ ({ \ MNTHANDLE mntHandle; \ mntHandle = malloc(sizeof *mntHandle); \ if (mntHandle != NULL) { \ mntHandle->numMountPoints = getmntinfo(&mntHandle->mountPoints, \ MNT_NOWAIT); \ mntHandle->mountIndex = 0; \ } \ mntHandle; \ }) # define GETNEXT_MNTINFO(mntHandle, mnt) \ ({ \ /* Avoid multiple evaluations/expansions. */ \ MNTHANDLE thisHandle = (mntHandle); \ MNTINFO *thisMnt = (mnt); \ Bool boolVal = FALSE; \ ASSERT(thisHandle); \ if (thisHandle->mountIndex < thisHandle->numMountPoints) { \ memcpy(thisMnt, \ &thisHandle->mountPoints[thisHandle->mountIndex], \ sizeof *thisMnt); \ ++thisHandle->mountIndex; \ boolVal = TRUE; \ } \ boolVal; \ }) # define CLOSE_MNTFILE(mntHandle) \ ({ \ free(mntHandle); \ TRUE; \ }) # define MNTINFO_NAME(mnt) mnt->f_mntfromname # define MNTINFO_FSTYPE(mnt) mnt->f_fstypename # define MNTINFO_MNTPT(mnt) mnt->f_mntonname # define MNTINFO_MNT_IS_RO(mnt) ((mnt)->f_flags & MNT_RDONLY) #else # error "Define mount information macros for your OS type" #endif #endif /* __MNTINFO_H__ */ open-vm-tools-10.0.7-3227872/lib/include/capsProvider.h0000644000000000000000000000264512660700526020666 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * capsProvider.h -- * * Interface implemented by dnd manager objects to obtain their * capabilities. Mainly needed by Windows host and guest code. */ #ifndef __CAPS_PROVIDER_H__ #define __CAPS_PROVIDER_H__ #if defined VMX86_TOOLS || COMPILE_WITHOUT_CUI # ifdef LIB_EXPORT # undef LIB_EXPORT # endif #define LIB_EXPORT #else #include "libExport.hh" #endif #if defined(SWIG) class CapsProvider #else class LIB_EXPORT CapsProvider #endif { public: virtual ~CapsProvider() {}; virtual Bool CheckCapability(uint32 caps) = 0; }; #endif open-vm-tools-10.0.7-3227872/lib/include/hgfsTransport.h0000644000000000000000000001601312660700526021063 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * hgfsTransport.h -- * * Transport file shared between guest drivers and host. */ #ifndef _HGFS_TRANSPORT_H_ # define _HGFS_TRANSPORT_H_ #include "vmci_defs.h" /************************************************ * VMCI specific data structures, macros * ************************************************/ /* * Limit payload to 16M. * This limit ensures that list of shared pages fits into VMCI datagram. * Client may impose a lower limit in create session request. */ #define HGFS_VMCI_PACKET_MAX (0x1000000) #define HGFS_VMCI_VERSION_1 0x1 #define HGFS_VMCI_VERSION_2 0x2 typedef enum { HGFS_TS_IO_PENDING, HGFS_TS_IO_COMPLETE, HGFS_TS_IO_FAILED, } HgfsTransportRequestState; typedef enum { HGFS_ASYNC_IOREQ_SHMEM, HGFS_ASYNC_IOREQ_GET_PAGES, HGFS_ASYNC_IOREP, } HgfsTransportReplyType; typedef enum { HGFS_TH_REP_GET_PAGES, HGFS_TH_REQUEST, HGFS_TH_TERMINATE_SESSION, } HgfsTransportRequestType; #define HGFS_VMCI_TRANSPORT_ERROR (VMCI_ERROR_CLIENT_MIN - 1) #define HGFS_VMCI_VERSION_MISMATCH (VMCI_ERROR_CLIENT_MIN - 2) #define HGFS_VMCI_TYPE_NOT_SUPPORTED (VMCI_ERROR_CLIENT_MIN - 3) /* * Used By : Guest and Host * Lives in : Inside HgfsVmciTransportHeader */ typedef #include "vmware_pack_begin.h" struct HgfsIov { uint64 pa; /* Physical addr */ uint32 len; /* length of data; should be <= PAGE_SIZE */ } #include "vmware_pack_end.h" HgfsIov; /* * Used By : Guest and Host * Lives in : Inside HgfsVmciTransportHeader */ typedef #include "vmware_pack_begin.h" struct HgfsAsyncIov { uint64 pa; /* Physical addr */ uint64 va; /* Virtual addr */ uint32 len; /* length of data; should be <= PAGE_SIZE */ uint64 index; /* Guest opaque data; should not be changed by host */ Bool chain; /* Are pages chained ? */ } #include "vmware_pack_end.h" HgfsAsyncIov; /* * Every VMCI request will have this transport Header sent over * in the datagram by the Guest OS. * * Node fields are set to be compatible for backwards compatibility * for version 1 and common for newer versions. * * Used By : Guest and Host * Lives in : Sent by Guest inside VMCI datagram */ typedef #include "vmware_pack_begin.h" struct HgfsVmciHeaderNode { uint32 version; /* Version number */ union { HgfsTransportRequestType pktType; /* Type of packet for client to server */ HgfsTransportReplyType replyType; /* Type of packet for server to client */ }; } #include "vmware_pack_end.h" HgfsVmciHeaderNode; typedef #include "vmware_pack_begin.h" struct HgfsVmciTransportHeader { HgfsVmciHeaderNode node; /* Node: version, type etc. */ uint32 iovCount; /* Number of iovs */ union { HgfsIov iov[1]; /* (PA, len) */ HgfsAsyncIov asyncIov[1]; }; } #include "vmware_pack_end.h" HgfsVmciTransportHeader; /* * Every VMCI request will have this transport Header sent over * in the datagram by the Guest or the Host. * This supersedes the above header and the HgfsVmciAsyncReply structure * below. * * Used By : Guest and Host * Lives in : Sent by Guest and Host inside VMCI datagram */ typedef #include "vmware_pack_begin.h" struct HgfsVmciTransportHeaderV2 { HgfsVmciHeaderNode node; /* Common node for all versions. */ uint32 size; /* Size of the header. */ uint64 pktId; /* Id corresponding to the request */ uint64 flags; /* flags to indicate state of the header */ uint32 pktDataSize; /* packet data size (not buffer size) */ uint64 reserved1; /* For future use, sender must zero */ uint64 reserved2; /* For future use, sender must zero */ uint32 iovCount; /* Number of iovs to follow */ union { HgfsIov iov[1]; /* (PA, len) */ HgfsAsyncIov asyncIov[1]; }; } #include "vmware_pack_end.h" HgfsVmciTransportHeaderV2; #define HGFS_VMCI_HDR_FLAGS_REQUEST (1 << 0) /* CLient to the server */ #define HGFS_VMCI_HDR_FLAGS_REPLY (1 << 1) /* Server to the client */ #define HGFS_VMCI_HDR_FLAGS_ASYNCIOV (1 << 2) /* IOV type is async */ /* * Indicates status of VMCI requests. If the requests are processed sync * by the hgfsServer then guest should see IO_COMPLETE otherwise IO_PENDING. * * Used By: Guest and Host * Lives in: Guest Memory */ typedef #include "vmware_pack_begin.h" struct HgfsVmciTransportStatus { HgfsTransportRequestState status; /* IO_PENDING, IO_COMPLETE, IO_FAILED etc */ uint32 size; /* G->H: Size of the packet,H->G: How much more space is needed */ } #include "vmware_pack_end.h" HgfsVmciTransportStatus; typedef #include "vmware_pack_begin.h" struct HgfsVmciAsyncResponse { uint64 id; /* Id corresponding to the guest request */ } #include "vmware_pack_end.h" HgfsVmciAsyncResponse; typedef #include "vmware_pack_begin.h" struct HgfsVmciAsyncShmem { uint32 count; /* Number of iovs */ HgfsAsyncIov iov[1]; } #include "vmware_pack_end.h" HgfsVmciAsyncShmem; typedef #include "vmware_pack_begin.h" struct HgfsVmciAsyncReply { HgfsVmciHeaderNode node; /* Node: version, type etc. */ union { HgfsVmciAsyncResponse response; HgfsVmciAsyncShmem shmem; }; } #include "vmware_pack_end.h" HgfsVmciAsyncReply; #endif /* _HGFS_TRANSPORT_H_ */ open-vm-tools-10.0.7-3227872/lib/include/system.h0000644000000000000000000000607612660700526017553 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * system.h -- * * System-specific routines used by the tools daemon. * */ #ifndef __SYSTEM_H__ # define __SYSTEM_H__ #include "vm_basic_types.h" #ifdef _WIN32 #include "dbllnklst.h" #endif #include "unicode.h" uint64 System_GetTimeMonotonic(void); uint64 System_Uptime(void); char *System_GetTimeAsString(void); void System_Shutdown(Bool reboot); Bool System_GetNodeName(size_t outBufSize, char *outBuf); char *System_GetEnv(Bool global, const char *valueName); int System_SetEnv(Bool global, const char *valueName, const char *value); Bool System_IsUserAdmin(void); #ifdef _WIN32 /* * Representation of monitors gathered by System_GetMonitors. */ typedef struct MonListNode { RECT rect; RECT work; BOOL isPrimary; DWORD bpp; BOOL isActive; uint32 srcId; DblLnkLst_Links l; } MonListNode; /* * The value returned by System_GetServiceState if the current state of the * vmtools service can't be determined. We need to use a value that is not * already used for a real state. The current values run from 0x1 to 0x7, so * 0xffffffff should be fairly safe (cf. winsvc.h). */ #define VM_SERVICE_STATE_UNKNOWN 0xffffffff BOOL System_SetProcessPrivilege(wchar_t *privName, Bool enable); int32 System_GetSPVersion(void); Bool System_IsLoginScreenActive(void); Bool System_IsScreenSaverActive(void); Bool System_IsScreenSaverRunning(void); Bool System_IsSecureDesktopActive(void); Bool System_DisableAndKillScreenSaver(void); DWORD System_GetServiceState(LPCWSTR szServiceName); DblLnkLst_Links *System_GetMonitors(); void System_SetFocusedWindow(HWND windowToFocus, Bool force); Bool System_EnableDesktopComposition(BOOL enabled); LPWSTR System_GetImageFilePathForWindow(HWND hwnd); HANDLE System_OpenProcessForHWND(DWORD mask, BOOL inherit, HWND hwnd); #endif /* * TODO: Targets' make/SCons files, or perhaps the entire build infrastructure * as a whole, should define a POSIX_LIKE_ENVIRONMENT variable which is * then acted upon and translates to a -DPOSIX_LIKE_ENVIRONMENT * preprocessor option. */ #if !defined(_WIN32) const char **System_GetNativeEnviron(const char **compatEnviron); void System_FreeNativeEnviron(const char **nativeEnviron); #endif #endif /* __SYSTEM_H__ */ open-vm-tools-10.0.7-3227872/lib/include/vmGuestLib.h0000644000000000000000000004106712660700526020307 0ustar rootroot/********************************************************* * Copyright (C) 2003-2008 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _VM_GUEST_LIB_H_ #define _VM_GUEST_LIB_H_ #include "vm_basic_types.h" #include "vmSessionId.h" #ifdef __cplusplus extern "C" { #endif /* * This is the VMware GuestLib, an API used for accessing various * performance statistics pertaining to the VMware virtual environment * from within a VMware Virtual Machine. */ /* * Error codes returned by GuestLib functions. * * XXX These should be unified with Foundry's error codes. */ typedef enum { VMGUESTLIB_ERROR_SUCCESS = 0, // No error VMGUESTLIB_ERROR_OTHER, // Other error VMGUESTLIB_ERROR_NOT_RUNNING_IN_VM, // Not running in a VM VMGUESTLIB_ERROR_NOT_ENABLED, // GuestLib not enabled on the host. VMGUESTLIB_ERROR_NOT_AVAILABLE, // This stat not available on this host. VMGUESTLIB_ERROR_NO_INFO, // UpdateInfo() has never been called. VMGUESTLIB_ERROR_MEMORY, // Not enough memory VMGUESTLIB_ERROR_BUFFER_TOO_SMALL, // Buffer too small VMGUESTLIB_ERROR_INVALID_HANDLE, // Handle is invalid VMGUESTLIB_ERROR_INVALID_ARG, // One or more arguments were invalid VMGUESTLIB_ERROR_UNSUPPORTED_VERSION // The host doesn't support this request } VMGuestLibError; char const * VMGuestLib_GetErrorText(VMGuestLibError error); // IN /* * GuestLib handle. * * This handle provides a context for accessing all GuestLib * state. Use VMGuestLib_OpenHandle to get a handle for use with other * GuestLib functions, and use VMGuestLib_CloseHandle to release a * handle previously acquired with VMGuestLib_OpenHandle. * * All of the statistics and session state are maintained per GuestLib * handle, so operating on one GuestLib handle will not affect the * state of another handle. */ struct _VMGuestLibHandle; typedef struct _VMGuestLibHandle* VMGuestLibHandle; VMGuestLibError VMGuestLib_OpenHandle(VMGuestLibHandle *handle); // OUT VMGuestLibError VMGuestLib_CloseHandle(VMGuestLibHandle handle); // IN /* * Update the info and session state for the given handle. * * Concurrency/thread safety: No locking is done internally around the * access of a handle. If a calling program uses multiple threads then * the caller must either ensure that each thread of execution is * using a separate handle, or the caller must implement locking * around calls to VMGuestLib_UpdateInfo() on a given handle to ensure * that two threads do not update the handle concurrently. * * Because the state is maintained per handle and no two handles can * be updated exactly simultaneously, the state of two handles may * differ even if they are updated one immediately after the other. * * VMGuestLib_UpdateInfo() is a fairly heavyweight function; it should * be viewed similar to a system call in terms of the computational * cost and performance hit. For this reason, a user of the API who * is concerned about performance will get best results by minimizing * the number of calls to VMGuestLib_UpdateInfo(). */ VMGuestLibError VMGuestLib_UpdateInfo(VMGuestLibHandle handle); // IN /* * Session ID * * This is used to detect changes in the "session" of a virtual * machine. "Session" in this context refers to the particular running * instance of this virtual machine on a given host. Moving a virtual * machine to another host using VMotion will cause a change in * session ID, as will suspending and resuming a virtual machine or * reverting to a snapshot. * * Any of the events above (VMotion, suspend/resume, snapshot revert) * are likely to render invalid any information previously retrieved * through this API, so the intention of the session ID is to provide * applications with a mechanism to detect those events and react * accordingly, e.g. by refreshing and resetting any state that relies * on validity of previously retrieved information. * * Use VMGuestLib_GetSessionId() to retrieve the ID for the current * session after calling VMGuestLib_UpdateInfo(). After a VMotion or * similar event, VMGuestLib_GetSessionId() will return a new value. * See code example below for an example of how to use this. * * If VMGuestLib_UpdateInfo() has never been called, * VMGUESTLIB_ERROR_NO_INFO is returned. * * The session ID should be considered opaque and cannot be compared * in any meaningful way with the session IDs from any other virtual * machine (e.g. to determine if two virtual machines are on the same * host). * * Here is simple pseudo-code (with no error checking) showing a naive * implementation of detecting stale information using the session ID. * * ----- * * VMSessionId sid = 0; * Bool done = FALSE; * * while (!done) { * VMSessionId tmp; * * VMGuestLib_UpdateInfo(); * VMGuestLib_GetSessionId(&tmp); * if (tmp != sid) { * ResetStats(); * sid = tmp; * } * } * * ----- */ VMGuestLibError VMGuestLib_GetSessionId(VMGuestLibHandle handle, // IN VMSessionId *id); // OUT /* * Specific Stat accessors. The values returned by these accessor * functions are up to date as of the last call to VMGuestLib_UpdateInfo(). * * If VMGuestLib_UpdateInfo() has never been called, * VMGUESTLIB_ERROR_NO_INFO is returned. */ /* CPU */ /* * Retrieves the minimum processing power in MHz available to the virtual * machine. Assigning a cpuReservationMhz ensures that even as other virtual * machines on a single host consume shared processing power, there is * still a certain minimum amount for this virtual machine. */ VMGuestLibError VMGuestLib_GetCpuReservationMHz(VMGuestLibHandle handle, // IN uint32 *cpuReservationMHz); // OUT /* * Retrieves the maximum processing power in MHz available to the virtual * machine. Assigning a cpuLimitMHz ensures that this virtual machine never * consumes more than a certain amount of the available processor power. By * limiting the amount of processing power consumed, a portion of this * shared resource is available to other virtual machines. */ VMGuestLibError VMGuestLib_GetCpuLimitMHz(VMGuestLibHandle handle, // IN uint32 *cpuLimitMHz); // OUT /* * Retrieves the number of CPU shares allocated to the virtual machine. */ VMGuestLibError VMGuestLib_GetCpuShares(VMGuestLibHandle handle, // IN uint32 *cpuShares); // OUT /* * Retrieves the number of milliseconds during which the virtual machine * has been using the CPU. This value is always less than or equal to * elapsedMS. This value, in conjunction with elapsedMS, can be used to * estimate efective virtual machine CPU speed. */ VMGuestLibError VMGuestLib_GetCpuUsedMs(VMGuestLibHandle handle, // IN uint64 *cpuUsedMs); // OUT /* * Host Processor speed. This can be used along with CpuUsedMs and * elapsed time to estimate approximate effective VM CPU speed * over a time interval. The following pseudocode illustrates how * to make this calculation: * * ------------------------------------ * * uint32 effectiveVMSpeed; * uint32 hostMhz; * uint64 elapsed1; * uint64 elapsed2; * uint64 used1; * uint64 used2; * * * VMGuestLib_UpdateInfo(handle); * VMGuestLib_GetHostProcessorSpeed(handle, &hostMhz); * VMGuestLib_GetElapsedMs(handle, &elapsed1); * VMGuestLib_GetUsedMs(handle, &used1); * .... * VMGuestLib_UpdateInfo(handle); * VMGuestLib_GetElapsedMs(handle, &elapsed2); * VMGuestLib_GetUsedMs(handle, &used2); * * effectiveVMSpeed = hostMhz * ((used2 - used1) / (elapsed2 - elapsed1)); * * * ------------------------------------ * * After this code executes, effectiveVMSpeed will be the approximate * average effective speed of the VM's virtual CPU over the time period * between the two calls to VMGuestLib_UpdateInfo(). * */ VMGuestLibError VMGuestLib_GetHostProcessorSpeed(VMGuestLibHandle handle, // IN uint32 *mhz); // OUT /* Memory */ /* * Retrieves the minimum amount of memory that is available to the virtual * machine. Assigning a cpuReservationMB ensures that even as other virtual * machines on a single host consume memory, there is still a certain * minimum amount for this virtual machine. */ VMGuestLibError VMGuestLib_GetMemReservationMB(VMGuestLibHandle handle, // IN uint32 *memReservationMB); // OUT /* * Retrieves the maximum amount of memory that is available to the virtual * machine. Assigning a cpuLimitMB ensures that this virtual machine never * consumes more than a certain amount of the available processor power. By * limiting the amount of processing power consumed, a portion of this * shared resource is available to other virtual machines. */ VMGuestLibError VMGuestLib_GetMemLimitMB(VMGuestLibHandle handle, // IN uint32 *memLimitMB); // OUT /* * Retrieves the number of memory shares allocated to the virtual machine. */ VMGuestLibError VMGuestLib_GetMemShares(VMGuestLibHandle handle, // IN uint32 *memShares); // OUT /* * Retrieves the mapped memory size of this virtual machine. This * is the current total amount of guest memory that is backed by * physical memory. Note that this number may include pages of * memory shared between multiple virtual machines and thus may be * an overestimate of the amount of physical host memory "consumed" * by this virtual machine. */ VMGuestLibError VMGuestLib_GetMemMappedMB(VMGuestLibHandle handle, // IN uint32 *memMappedSizeMB); // OUT /* * Retrieves the estimated amount of memory the virtual machine is actively * using. This method returns an estimated working set size for the virtual * machine. */ VMGuestLibError VMGuestLib_GetMemActiveMB(VMGuestLibHandle handle, // IN uint32 *memActiveMB); // OUT /* * Retrieves the amount of overhead memory associated with this virtual * machine consumed on the host system. */ VMGuestLibError VMGuestLib_GetMemOverheadMB(VMGuestLibHandle handle, // IN uint32 *memOverheadMB); // OUT /* * Retrieves the amount of memory that has been reclaimed from this virtual * machine via the VMware Memory Balloon mechanism. */ VMGuestLibError VMGuestLib_GetMemBalloonedMB(VMGuestLibHandle handle, // IN uint32 *memBalloonedMB); // OUT /* * Retrieves the amount of memory associated with this virtual machine that * has been swapped by the host system. */ VMGuestLibError VMGuestLib_GetMemSwappedMB(VMGuestLibHandle handle, // IN uint32 *memSwappedMB); // OUT /* * Retrieves the amount of physical memory associated with this virtual * machine that is copy-on-write (COW) shared on the host. */ VMGuestLibError VMGuestLib_GetMemSharedMB(VMGuestLibHandle handle, // IN uint32 *memSharedMB); // OUT /* * Retrieves the estimated amount of physical memory on the host saved * from copy-on-write (COW) shared guest physical memory. */ VMGuestLibError VMGuestLib_GetMemSharedSavedMB(VMGuestLibHandle handle, // IN uint32 *memSharedSavedMB); // OUT /* * Retrieves the estimated amount of physical host memory currently * consumed for this virtual machine's physical memory. This is the * same as (mapped memory) - (sharedSaved memory). */ VMGuestLibError VMGuestLib_GetMemUsedMB(VMGuestLibHandle handle, // IN uint32 *memUsedMB); // OUT /* Elapsed Time */ /* * Retrieves the number of milliseconds that have passed in real time since * the virtual machine started running on the current host system. The * elapsed time counter is reset any time the virtual machine is powered * on, resumed, or migrated via VMotion. This value, in conjunction with * cpuUsedMS, can be used to estimate effective virtual machine CPU speed. * The cpuUsedMS value is always less than or equal to this value. */ VMGuestLibError VMGuestLib_GetElapsedMs(VMGuestLibHandle handle, // IN uint64 *elapsedMs); // OUT /* * Resource Pool Path. * * Retrieves a string representation of the path to this virtual machine in * the resource pool namespace of the host system. * * pathBuffer is a pointer to a buffer that will receive the resource * pool path string. bufferSize is a pointer to the size of the * pathBuffer in bytes. If bufferSize is not large enough to * accomodate the path and NUL terminator, then * VMGUESTLIB_ERROR_BUFFER_TOO_SMALL is returned and bufferSize * contains the amount of memory needed (in bytes). */ VMGuestLibError VMGuestLib_GetResourcePoolPath(VMGuestLibHandle handle, // IN size_t *bufferSize, // IN/OUT char *pathBuffer); // OUT /* * CPU stolen time. The time (in ms) that the VM was runnable but not scheduled * to run. */ VMGuestLibError VMGuestLib_GetCpuStolenMs(VMGuestLibHandle handle, // IN uint64 *cpuStolenMs); // OUT /* * Memory Target Size. */ VMGuestLibError VMGuestLib_GetMemTargetSizeMB(VMGuestLibHandle handle, // IN uint64 *memTargetSizeMB); // OUT /* * Number of physical CPU cores on the host machine. */ VMGuestLibError VMGuestLib_GetHostNumCpuCores(VMGuestLibHandle handle, // IN uint32 *hostNumCpuCores); // OUT /* * Total CPU time used by host. */ VMGuestLibError VMGuestLib_GetHostCpuUsedMs(VMGuestLibHandle handle, // IN uint64 *hostCpuUsedMs); // OUT /* * Total memory swapped out on the host. */ VMGuestLibError VMGuestLib_GetHostMemSwappedMB(VMGuestLibHandle handle, // IN uint64 *hostMemSwappedMB); // OUT /* * Total COW (Copy-On-Write) memory on host. */ VMGuestLibError VMGuestLib_GetHostMemSharedMB(VMGuestLibHandle handle, // IN uint64 *hostMemSharedMB); // OUT /* * Total consumed memory on host. */ VMGuestLibError VMGuestLib_GetHostMemUsedMB(VMGuestLibHandle handle, // IN uint64 *hostMemUsedMB); // OUT /* * Total memory available to host OS kernel. */ VMGuestLibError VMGuestLib_GetHostMemPhysMB(VMGuestLibHandle handle, // IN uint64 *hostMemPhysMB); // OUT /* * Total physical memory free on host. */ VMGuestLibError VMGuestLib_GetHostMemPhysFreeMB(VMGuestLibHandle handle, // IN uint64 *hostMemPhysFreeMB); // OUT /* * Total host kernel memory overhead. */ VMGuestLibError VMGuestLib_GetHostMemKernOvhdMB(VMGuestLibHandle handle, // IN uint64 *hostMemKernOvhdMB); // OUT /* * Total mapped memory on host. */ VMGuestLibError VMGuestLib_GetHostMemMappedMB(VMGuestLibHandle handle, // IN uint64 *hostMemMappedMB); // OUT /* * Total unmapped memory on host. */ VMGuestLibError VMGuestLib_GetHostMemUnmappedMB(VMGuestLibHandle handle, // IN uint64 *hostMemUnmappedMB); // OUT /* * Semi-structured hypervisor stats collection, for troubleshooting. */ VMGuestLibError VMGuestLib_StatGet(const char *encoding, // IN const char *stat, // IN char **reply, // OUT size_t *replySize); // OUT void VMGuestLib_StatFree(char *reply, size_t replySize); #ifdef __cplusplus } #endif #endif /* _VM_GUEST_LIB_H_ */ open-vm-tools-10.0.7-3227872/lib/include/cryptoError.h0000644000000000000000000000567312660700526020563 0ustar rootroot/********************************************************* * Copyright (C) 2005-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * cryptoError.h -- * * Error code for cryptographic infrastructure library. */ #ifndef VMWARE_CRYPTOERROR_H #define VMWARE_CRYPTOERROR_H 1 #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "vmware.h" typedef int CryptoError; /* * This set of errors should not be expanded beyond a maximum value of 15 * without also updating the code for AIOMgr errors, which allots only 4 bits * for sub-error codes. * * Adding a lot of error codes to describe particular errors is a bad idea * anyhow, because it can be a security hole in itself; see, for example, the * SSL vulnerability described at . * It is best to distinguish only those types of errors that the caller can * legitimately use to figure out how to fix the problem and try again. */ #define CRYPTO_ERROR_SUCCESS ((CryptoError) 0) #define CRYPTO_ERROR_OPERATION_FAILED ((CryptoError) 1) #define CRYPTO_ERROR_UNKNOWN_ALGORITHM ((CryptoError) 2) #define CRYPTO_ERROR_BAD_BUFFER_SIZE ((CryptoError) 3) #define CRYPTO_ERROR_INVALID_OPERATION ((CryptoError) 4) #define CRYPTO_ERROR_NOMEM ((CryptoError) 5) #define CRYPTO_ERROR_NEED_PASSWORD ((CryptoError) 6) #define CRYPTO_ERROR_BAD_PASSWORD ((CryptoError) 7) #define CRYPTO_ERROR_IO_ERROR ((CryptoError) 8) #define CRYPTO_ERROR_UNKNOWN_ERROR ((CryptoError) 9) #define CRYPTO_ERROR_NAME_NOT_FOUND ((CryptoError) 10) #define CRYPTO_ERROR_NO_CRYPTO ((CryptoError) 11) #define CRYPTO_ERROR_LOCK_FAILURE ((CryptoError) 12) const char * CryptoError_ToString(CryptoError error); const char * CryptoError_ToMsgString(CryptoError error); static INLINE int CryptoError_ToInteger(CryptoError error) { return (int) error; } static INLINE CryptoError CryptoError_FromInteger(int index) { return (CryptoError) index; } static INLINE Bool CryptoError_IsSuccess(CryptoError error) { return (CRYPTO_ERROR_SUCCESS == error); } static INLINE Bool CryptoError_IsFailure(CryptoError error) { return (CRYPTO_ERROR_SUCCESS != error); } #endif /* cryptoError.h */ open-vm-tools-10.0.7-3227872/lib/include/poll.h0000644000000000000000000002410612660700526017167 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #ifndef _POLL_H_ #define _POLL_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_basic_defs.h" #include "vmware.h" #include "userlock.h" #ifdef _WIN32 #define HZ 100 #elif defined linux #include #elif __APPLE__ #include /* * Old SDKs don't define TARGET_OS_IPHONE at all. * New ones define it to 0 on Mac OS X, 1 on iOS. */ #if !defined(TARGET_OS_IPHONE) || TARGET_OS_IPHONE == 0 #include #endif #include #define HZ 100 #endif #ifdef __ANDROID__ /* * of android should be included, but its name is same * with this file. So its content is put here to avoid conflict. */ #include #define HZ 100 typedef unsigned int nfds_t; int poll(struct pollfd *, nfds_t, long); #endif /* * Poll event types: each type has a different reason for firing, * or condition that must be met before firing. */ typedef enum { /* * Actual Poll queue types against which you can register callbacks. */ POLL_VIRTUALREALTIME = -1, /* Negative because it doesn't have its own Q */ POLL_VTIME = 0, POLL_REALTIME, POLL_DEVICE, POLL_MAIN_LOOP, POLL_NUM_QUEUES } PollEventType; /* * Classes of events * * These are the predefined classes. More can be declared * with Poll_AllocClass(). */ typedef enum PollClass { POLL_CLASS_MAIN, POLL_CLASS_PAUSE, POLL_CLASS_IPC, POLL_CLASS_CPT, POLL_CLASS_MKS, POLL_FIXED_CLASSES, POLL_MAX_CLASSES = 320 /* Size enum to maximum */ } PollClass; /* * Each callback is registered in a set of classes */ typedef struct PollClassSet { /* Type is uintptr_t to give best 32/64-bit code. */ #define _POLL_ELEMSIZE (sizeof (uintptr_t) * 8) uintptr_t bits[CEILING(POLL_MAX_CLASSES, _POLL_ELEMSIZE)]; } PollClassSet; /* An empty PollClassSet. */ static INLINE PollClassSet PollClassSet_Empty(void) { PollClassSet set = { { 0 } }; return set; } /* A PollClassSet with the single member. */ static INLINE PollClassSet PollClassSet_Singleton(PollClass c) { PollClassSet s = PollClassSet_Empty(); ASSERT_ON_COMPILE(sizeof s.bits[0] * 8 == _POLL_ELEMSIZE); /* Size correct */ ASSERT_ON_COMPILE((_POLL_ELEMSIZE & (_POLL_ELEMSIZE - 1)) == 0); /* power of 2 */ ASSERT_ON_COMPILE(POLL_MAX_CLASSES <= ARRAYSIZE(s.bits) * _POLL_ELEMSIZE); ASSERT(c < POLL_MAX_CLASSES); s.bits[c / _POLL_ELEMSIZE] = CONST3264U(1) << (c % _POLL_ELEMSIZE); return s; } /* Combine two PollClassSets. */ static INLINE PollClassSet PollClassSet_Union(PollClassSet lhs, PollClassSet rhs) { PollClassSet u; unsigned i; for (i = 0; i < ARRAYSIZE(u.bits); i++) { u.bits[i] = lhs.bits[i] | rhs.bits[i]; } return u; } /* Add single class to PollClassSet. */ static INLINE PollClassSet PollClassSet_Include(PollClassSet set, PollClass c) { return PollClassSet_Union(set, PollClassSet_Singleton(c)); } #define POLL_CS_MAIN PollClassSet_Singleton(POLL_CLASS_MAIN) #define POLL_CS_PAUSE PollClassSet_Union(POLL_CS_MAIN, \ PollClassSet_Singleton(POLL_CLASS_PAUSE)) #define POLL_CS_CPT PollClassSet_Union(POLL_CS_PAUSE, \ PollClassSet_Singleton(POLL_CLASS_CPT)) #define POLL_CS_IPC PollClassSet_Union(POLL_CS_CPT, \ PollClassSet_Singleton(POLL_CLASS_IPC)) #define POLL_CS_VMDB POLL_CS_PAUSE /* POLL_CLASS_VMDB is retired */ #define POLL_CS_MKS PollClassSet_Singleton(POLL_CLASS_MKS) /* * DANGER. You don't need POLL_CS_ALWAYS. Really. So don't use it. */ #define POLL_CS_ALWAYS PollClassSet_Union(POLL_CS_CPT, POLL_CS_IPC) /* * Poll class-set taxonomy: * POLL_CS_MAIN * - Unless you NEED another class, use POLL_CS_MAIN. * POLL_CS_PAUSE * - For callbacks that must occur even if the guest is paused. * Most VMDB or Foundry commands are in this category. * POLL_CS_CPT * - Only for callbacks which can trigger intermediate Checkpoint * transitions. * The ONLY such callback is Migrate. * POLL_CS_IPC * - Only for callbacks which can contain Msg_(Post|Hint|Question) * responses, and for signal handlers (why)? * Vigor, VMDB, and Foundry can contain Msg_* responses. * POLL_CS_MKS * - Callback runs in MKS thread. * POLL_CS_ALWAYS * - Only for events that must be processed immediately. * The ONLY such callback is OvhdMemVmxSizeCheck. */ /* * Poll_Callback flags */ #define POLL_FLAG_PERIODIC 0x01 // keep after firing #define POLL_FLAG_REMOVE_AT_POWEROFF 0x02 // self-explanatory #define POLL_FLAG_READ 0x04 // device is ready for reading #define POLL_FLAG_WRITE 0x08 // device is ready for writing #define POLL_FLAG_SOCKET 0x10 // device is a Windows socket #define POLL_FLAG_NO_BULL 0x20 // callback does its own locking #define POLL_FLAG_WINSOCK 0x40 // Winsock style write events #define POLL_FLAG_FD 0x80 // device is a Windows file descriptor. #define POLL_FLAG_ACCEPT_INVALID_FDS 0x100 // For broken 3rd party libs, e.g. curl #define POLL_FLAG_THUNK_TO_WND 0x200 // thunk callback to window message loop /* * Advisory minimum time period. * Users that want the fastest running real-time poll * should use TICKS_TO_USECS(1). */ #define TICKS_TO_USECS(_x) ((_x) * (1000000 / HZ)) #define USECS_TO_TICKS(_x) ((_x) / (1000000 / HZ)) typedef void (*PollerFunction)(void *clientData); typedef void (*PollerFireWrapper)(PollerFunction func, void *funcData, void *wrapperData); typedef Bool (*PollerErrorFn)(const char *errorStr); /* * Initialisers: * * For the sake of convenience, we declare the initialisers * for custom implmentations here, even though the actual * implementations are distinct from the core poll code. */ typedef struct PollOptions { Bool locked; // Use internal MXUser for locking Bool allowFullQueue; // Don't assert when device event queue is full. VThreadID windowsMsgThread; // thread that processes Windows messages PollerFireWrapper fireWrapperFn; // optional; may be useful for stats void *fireWrapperData; // optional PollerErrorFn errorFn; // optional; called upon unrecoverable error } PollOptions; void Poll_InitDefault(void); void Poll_InitDefaultEx(const PollOptions *opts); void Poll_InitGtk(void); // On top of glib for Linux void Poll_InitCF(void); // On top of CoreFoundation for OSX /* * Functions */ int Poll_SocketPair(Bool vmci, Bool stream, int fds[2]); void Poll_Loop(Bool loop, Bool *exit, PollClass c); void Poll_LoopTimeout(Bool loop, Bool *exit, PollClass c, int timeout); Bool Poll_LockingEnabled(void); void Poll_Exit(void); /* * Poll_Callback adds a callback regardless of whether an identical one exists. * * Likewise, Poll_CallbackRemove removes exactly one callback. */ VMwareStatus Poll_Callback(PollClassSet classSet, int flags, PollerFunction f, void *clientData, PollEventType type, PollDevHandle info, // fd/microsec delay MXUserRecLock *lck); Bool Poll_CallbackRemove(PollClassSet classSet, int flags, PollerFunction f, void *clientData, PollEventType type); Bool Poll_CallbackRemoveOneByCB(PollClassSet classSet, int flags, PollerFunction f, PollEventType type, void **clientData); void Poll_NotifyChange(PollClassSet classSet); /* * Wrappers for Poll_Callback and Poll_CallbackRemove that present * simpler subsets of those interfaces. */ VMwareStatus Poll_CB_Device(PollerFunction f, void *clientData, PollDevHandle device, Bool periodic); Bool Poll_CB_DeviceRemove(PollerFunction f, void *clientData, Bool periodic); VMwareStatus Poll_CB_RTime(PollerFunction f, void *clientData, int delay, // microseconds Bool periodic, MXUserRecLock *lock); Bool Poll_CB_RTimeRemove(PollerFunction f, void *clientData, Bool periodic); #ifdef _WIN32 void Poll_SetWindowMessageRecipient(HWND hWnd, UINT msg, Bool alwaysThunk); Bool Poll_FireWndCallback(void *lparam); #endif #endif // _POLL_H_ open-vm-tools-10.0.7-3227872/lib/include/dynarray.h0000644000000000000000000002630112660700526020051 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * dynarray.h -- * * Dynamic array of objects. * * Use a DynArray to hold a dynamically resizable array * of objects with a fixed width. */ #ifndef _DYNARRAY_H_ #define _DYNARRAY_H_ #include "dynbuf.h" #include "vm_basic_types.h" #include "vm_assert.h" typedef struct DynArray { DynBuf buf; size_t width; } DynArray; /* * The SVGA drivers require the __cdecl calling convention. * The qsort comparison function is compiled with the __stdecl * convention by default, so if we are compiling SVGA (which defines * STD_CALL) we need to explicitly declare the function with __cdecl. */ #if defined(STD_CALL) #define CDECLCONV __cdecl #else #define CDECLCONV #endif typedef int (CDECLCONV *DynArrayCmp)(const void *, const void *); Bool DynArray_Init(DynArray *a, unsigned int count, size_t width); void DynArray_Destroy(DynArray *a); Bool DynArray_SetCount(DynArray *a, unsigned int c); void DynArray_QSort(DynArray *a, DynArrayCmp compare); unsigned int DynArray_AllocCount(const DynArray *a); /* *----------------------------------------------------------------------------- * * DynArray_Trim -- * * Resize the array to fit exactly DynArray_Count() elements. * * Results: * TRUE on success * FALSE on failure (why? who knows...) * * Side effects: * Resizes the array * *----------------------------------------------------------------------------- */ static INLINE Bool DynArray_Trim(DynArray *a) // IN/OUT { ASSERT(a); return DynBuf_Trim(&a->buf); } /* *----------------------------------------------------------------------------- * * DynArray_AddressOf -- * * Fetch a pointer to the address of the ith element. * * Results: * The pointer to the ith element or NULL if the index is out of * bounds. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void * DynArray_AddressOf(const DynArray *a, // IN unsigned int i) // IN { uintptr_t offset = i * a->width; ASSERT(a); if (offset + a->width <= DynBuf_GetSize(&a->buf)) { return offset + (uint8 *)DynBuf_Get(&a->buf); } return NULL; } /* *----------------------------------------------------------------------------- * * DynArray_AddressOfUnsafe -- * * Fetch a pointer to the address of the ith element. Only call * this if you already know that 'i' is valid. The index is not * checked against the size of the array. * * Results: * Always returns a pointer to the ith element. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void * DynArray_AddressOfUnsafe(const DynArray *a, // IN unsigned int i) // IN { uintptr_t offset = i * a->width; ASSERT(a); ASSERT(offset + a->width <= DynBuf_GetSize(&a->buf)); return offset + (uint8 *)DynBuf_Get(&a->buf); } /* *----------------------------------------------------------------------------- * * DynArray_Count -- * * Returns the number of elements in the array. * * XXX: This is relatively slow, since we do an integer division. * Avoid calling this in inner loops. * * Results: * See above. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE unsigned int DynArray_Count(const DynArray *a) // IN { ASSERT(a); return (unsigned int) (DynBuf_GetSize(&a->buf) / a->width); } /* *----------------------------------------------------------------------------- * * DynArray_Copy -- * * Copies all data and metadata from src Dynarray to dest DynArray. * * Dest should be an initialized DynArray of size zero. * * Results: * TRUE on success, FALSE on failure. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool DynArray_Copy(DynArray *src, // IN DynArray *dest) // OUT { ASSERT(src); ASSERT(dest); ASSERT(dest->width); ASSERT(dest->width == src->width); ASSERT(DynArray_AllocCount(dest) == 0); return DynBuf_Copy(&src->buf, &dest->buf); } /* * Use the following macros to define your own DynArray type to * make its usage less cumbersome. You also get type-checking * for free, as demonstrated by this example: * * Assume: * * typedef struct { int n, d; } Fraction; * typedef struct { float r, i; } Complex; * * Without DEFINE_DYNARRAY_TYPE: * * DynArray a1, a2; * DynArray_Init(&a1, 4, sizeof(Fraction)); * DynArray_Init(&a2, 16, sizeof(Complex)); * * Fraction *f2 = (Fraction *)DynArray_AddressOf(&a2, 3); // Runtime Error * * * With DEFINE_DYNARRAY_TYPE: * * DEFINE_DYNARRAY_TYPE(Fraction) * DEFINE_DYNARRAY_TYPE(Complex) * FractionArray a1; * ComplexArray a2; * FractionArray_Init(&a1, 4); * ComplexArray_Init(&a2, 16); * * Fraction *f2 = FractionArray_AddressOf(&a2, 3); // Compile Error * * Yes, it's a poor man's template (but better than nothing). * */ #define DEFINE_DYNARRAY_TYPE(T) DEFINE_DYNARRAY_NAMED_TYPE(T, T) #define DEFINE_DYNARRAY_NAMED_TYPE(T, TYPE) \ DECLARE_DYNARRAY_TYPE(T) \ DEFINEONLY_DYNARRAY_NAMED_TYPE(T, TYPE) #define DECLARE_DYNARRAY_TYPE(T) \ typedef DynArray T##Array; #define DEFINEONLY_DYNARRAY_NAMED_TYPE(T, TYPE) \ \ typedef int (CDECLCONV *DynArray##T##Cmp)(const TYPE *, \ const TYPE *); \ \ static INLINE Bool \ T##Array_Init(T##Array *a, unsigned int count) \ { \ return DynArray_Init((DynArray *)a, count, sizeof(TYPE)); \ } \ \ static INLINE void \ T##Array_Destroy(T##Array *a) \ { \ DynArray_Destroy((DynArray *)a); \ } \ \ static INLINE TYPE* \ T##Array_AddressOf(T##Array *a, unsigned int i) \ { \ return (TYPE*)DynArray_AddressOf((DynArray *)a, i); \ } \ \ static INLINE unsigned int \ T##Array_Count(T##Array *a) \ { \ return DynArray_Count((DynArray *)a); \ } \ \ static INLINE Bool \ T##Array_SetCount(T##Array *a, unsigned int c) \ { \ return DynArray_SetCount((DynArray *)a, c); \ } \ \ static INLINE Bool \ T##Array_Push(T##Array *a, TYPE val) \ { \ unsigned int count = T##Array_Count(a); \ if (!T##Array_SetCount(a, count + 1)) { \ return FALSE; \ } \ *T##Array_AddressOf(a, count) = val; \ return TRUE; \ } \ \ static INLINE unsigned int \ T##Array_AllocCount(T##Array *a) \ { \ return DynArray_AllocCount((DynArray *)a); \ } \ \ static INLINE Bool \ T##Array_Trim(T##Array *a) \ { \ return DynArray_Trim((DynArray *)a); \ } \ static INLINE void \ T##Array_QSort(T##Array *a, DynArray##T##Cmp compare) \ { \ DynArray_QSort((DynArray *)a, (DynArrayCmp)compare); \ } \ static INLINE Bool \ T##Array_Copy(T##Array *src, T##Array *dest) \ { \ return DynArray_Copy((DynArray *)src, (DynArray *)dest); \ } /* Define DynArray of DynBuf. */ DEFINE_DYNARRAY_TYPE(DynBuf) #endif /* _DYNARRAY_H_ */ open-vm-tools-10.0.7-3227872/lib/include/dictll.h0000644000000000000000000000341212660700526017471 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * dictll.h -- * * Low-level dictionary format --hpreg */ #ifndef __DICTLL_H__ # define __DICTLL_H__ #include "vm_basic_types.h" #include "dynbuf.h" int DictLL_ReadLine(FILE *stream, // IN char **line, // OUT char **name, // OUT char **value); // OUT Bool DictLL_WriteLine(FILE *stream, // IN char const *name, // IN char const *value); // IN const char * DictLL_UnmarshalLine(const char *buf, // IN size_t bufSize, // IN char **line, // OUT char **name, // OUT char **value); // OUT Bool DictLL_MarshalLine(DynBuf *output, // IN/OUT char const *name, // IN/OPT char const *value); // IN Bool DictLL_ReadUTF8BOM(FILE *file); // IN/OUT #endif /* __DICTLL_H__ */ open-vm-tools-10.0.7-3227872/lib/include/nicInfo.h0000644000000000000000000000455612660700526017615 0ustar rootroot/********************************************************* * Copyright (C) 2014-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * nicInfo.h -- * * Functions used to communicate guest networking information to the host. * */ #ifndef NICINFO_H #define NICINFO_H #include #include "guestInfo.h" Bool GuestInfo_GetFqdn(int outBufLen, char fqdn[]); Bool GuestInfo_GetNicInfo(NicInfoV3 **nicInfo); void GuestInfo_FreeNicInfo(NicInfoV3 *nicInfo); char *GuestInfo_GetPrimaryIP(void); /* * Comparison routines -- handy for caching, unit testing. */ Bool GuestInfo_IsEqual_DhcpConfigInfo(const DhcpConfigInfo *a, const DhcpConfigInfo *b); Bool GuestInfo_IsEqual_DnsConfigInfo(const DnsConfigInfo *a, const DnsConfigInfo *b); Bool GuestInfo_IsEqual_DnsHostname(const DnsHostname *a, const DnsHostname *b); Bool GuestInfo_IsEqual_InetCidrRouteEntry(const InetCidrRouteEntry *a, const InetCidrRouteEntry *b, const NicInfoV3 *aInfo, const NicInfoV3 *bInfo); Bool GuestInfo_IsEqual_IpAddressEntry(const IpAddressEntry *a, const IpAddressEntry *b); Bool GuestInfo_IsEqual_NicInfoV3(const NicInfoV3 *a, const NicInfoV3 *b); Bool GuestInfo_IsEqual_TypedIpAddress(const TypedIpAddress *a, const TypedIpAddress *b); Bool GuestInfo_IsEqual_WinsConfigInfo(const WinsConfigInfo *a, const WinsConfigInfo *b); #endif open-vm-tools-10.0.7-3227872/lib/include/vmk_exports.h0000644000000000000000000001004012660700526020572 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * vmk_exports.h -- * * Macros for exporting symbols from vmkernel */ #ifndef _VMK_EXPORTS_H #define _VMK_EXPORTS_H #ifdef VMKERNEL #include "vm_basic_defs.h" /* * The following macros allow you to export symbols from vmkernel, * thus making them available for modules to access. * * The versions with no explicit name-space and version imply the * default vmkernel name-space/version. They should be considered * deprecated as they impede your ability to create very stable APIs. * * Sample usage: * * VMK_KERNEL_EXPORT(foo) : export foo * * VMK_KERNEL_ALIAS(foo, fooAlias) : export foo as fooAlias * * VMK_KERNEL_EXPORT_TO_NAMESPACE(foo, "ns", "ver") : * export foo @ns:ver * * VMK_KERNEL_ALIAS_TO_NAMESPACE(foo, fooAlias, "ns", "ver") : * export foo as fooAlias @ns:ver * * Further details on the name-space/version implementation can be * found in the VMKAPI module headers and documentation. The 2 second * version is that if you export foo@myns:1, modules wanting access to * that symbol will require an explicit * VMK_MODULE_NAMESPACE_REQUIRED("myns", "1") tag to see that symbol. */ #define VMK_KERNEL_EXPORT_SEC ".vmkexports" #define VMK_KERNEL_EXPORT(symbol) \ asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ "\t.string \"" XSTR(symbol) "\" \n" "\t.popsection\n"); #define VMK_KERNEL_ALIAS(symbol, alias) \ asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ "\t.string \"" XSTR(symbol) "!" XSTR(alias) "\" \n" \ "\t.popsection\n"); /* name@namespace:version */ #define VMK_KERNEL_EXPORT_TO_NAMESPACE(symbol, namespace, version) \ asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ "\t.string \"" XSTR(symbol) "@" namespace ":" version "\" \n" \ "\t.popsection\n"); /* name!alias@namespace:version */ #define VMK_KERNEL_ALIAS_TO_NAMESPACE(symbol, alias, namespace, version) \ asm(".pushsection " VMK_KERNEL_EXPORT_SEC ",\"aS\", @progbits\n" \ "\t.string \"" XSTR(symbol) "!" XSTR(alias) "@" namespace ":" \ version "\" \n\t.popsection\n"); #else /* ! defined VMKERNEL */ /* * Empty definitions for kernel exports when built in non-kernel environments. */ #define VMK_KERNEL_EXPORT(_symbol) #define VMK_KERNEL_ALIAS(symbol, alias) #define VMK_KERNEL_EXPORT_TO_NAMESPACE(symbol, namespace, version) #define VMK_KERNEL_ALIAS_TO_NAMESPACE(symbol, alias, namespace, version) #endif /* defined VMKERNEL */ #endif /* _VMK_EXPORTS_H */ open-vm-tools-10.0.7-3227872/lib/include/vm_basic_asm_x86.h0000644000000000000000000004365012660700526021356 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * vm_basic_asm_x86.h * * Basic IA32 asm macros */ #ifndef _VM_BASIC_ASM_X86_H_ #define _VM_BASIC_ASM_X86_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #ifdef VM_X86_64 /* * The gcc inline asm uses the "A" constraint which differs in 32 & 64 * bit mode. 32 bit means eax and edx, 64 means rax or rdx. */ #error "x86-64 not supported" #endif /* * XTEST * Return TRUE if processor is in transaction region. * */ #if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) static INLINE Bool xtest(void) { uint8 al; __asm__ __volatile__(".byte 0x0f, 0x01, 0xd6 # xtest \n" "setnz %%al\n" : "=a"(al) : : "cc"); return al; } #endif /* __GNUC__ */ /* * FXSAVE/FXRSTOR * save/restore SIMD/MMX fpu state * * The pointer passed in must be 16-byte aligned. * * Intel and AMD processors behave differently w.r.t. fxsave/fxrstor. Intel * processors unconditionally save the exception pointer state (instruction * ptr., data ptr., and error instruction opcode). FXSAVE_ES1 and FXRSTOR_ES1 * work correctly for Intel processors. * * AMD processors only save the exception pointer state if ES=1. This leads to a * security hole whereby one process/VM can inspect the state of another process * VM. The AMD recommended workaround involves clobbering the exception pointer * state unconditionally, and this is implemented in FXRSTOR_AMD_ES0. Note that * FXSAVE_ES1 will only save the exception pointer state for AMD processors if * ES=1. * * The workaround (FXRSTOR_AMD_ES0) only costs 1 cycle more than just doing an * fxrstor, on both AMD Opteron and Intel Core CPUs. */ #if defined(__GNUC__) static INLINE void FXSAVE_ES1(void *save) { __asm__ __volatile__ ("fxsave %0\n" : "=m" (*(uint8 *)save) : : "memory"); } static INLINE void FXRSTOR_ES1(const void *load) { __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*(const uint8 *)load) : "memory"); } static INLINE void FXRSTOR_AMD_ES0(const void *load) { uint64 dummy = 0; __asm__ __volatile__ ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap "1: \n" "ffree %%st(7) \n" // Clear tag bit - avoid poss. stack overflow "fildl %0 \n" // Dummy Load from "safe address" changes all // x87 exception pointers. "fxrstor %1 \n" : : "m" (dummy), "m" (*(const uint8 *)load) : "ax", "memory"); } #endif /* __GNUC__ */ /* * XSAVE/XRSTOR * save/restore GSSE/SIMD/MMX fpu state * * The pointer passed in must be 64-byte aligned. * See above comment for more information. */ #if defined(__GNUC__) && (defined(VMM) || defined(VMKERNEL) || defined(FROBOS)) static INLINE void XSAVE_ES1(void *save, uint64 mask) { #if __GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ == 1 __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0x21 \n" : : "c" ((uint8 *)save), "a" ((uint32)mask), "d" ((uint32)(mask >> 32)) : "memory"); #else __asm__ __volatile__ ( "xsave %0 \n" : "=m" (*(uint8 *)save) : "a" ((uint32)mask), "d" ((uint32)(mask >> 32)) : "memory"); #endif } static INLINE void XSAVEOPT_ES1(void *save, uint64 mask) { __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0x31 \n" : : "c" ((uint8 *)save), "a" ((uint32)mask), "d" ((uint32)(mask >> 32)) : "memory"); } static INLINE void XRSTOR_ES1(const void *load, uint64 mask) { #if __GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ == 1 __asm__ __volatile__ ( ".byte 0x0f, 0xae, 0x29 \n" : : "c" ((const uint8 *)load), "a" ((uint32)mask), "d" ((uint32)(mask >> 32)) : "memory"); #else __asm__ __volatile__ ( "xrstor %0 \n" : : "m" (*(const uint8 *)load), "a" ((uint32)mask), "d" ((uint32)(mask >> 32)) : "memory"); #endif } static INLINE void XRSTOR_AMD_ES0(const void *load, uint64 mask) { uint64 dummy = 0; __asm__ __volatile__ ("fnstsw %%ax \n" // Grab x87 ES bit "bt $7,%%ax \n" // Test ES bit "jnc 1f \n" // Jump if ES=0 "fnclex \n" // ES=1. Clear it so fild doesn't trap "1: \n" "ffree %%st(7) \n" // Clear tag bit - avoid poss. stack overflow "fildl %0 \n" // Dummy Load from "safe address" changes all // x87 exception pointers. "mov %%ebx, %%eax \n" #if __GNUC__ < 4 || __GNUC__ == 4 && __GNUC_MINOR__ == 1 ".byte 0x0f, 0xae, 0x29 \n" : : "m" (dummy), "c" ((const uint8 *)load), "b" ((uint32)mask), "d" ((uint32)(mask >> 32)) #else "xrstor %1 \n" : : "m" (dummy), "m" (*(const uint8 *)load), "b" ((uint32)mask), "d" ((uint32)(mask >> 32)) #endif : "eax", "memory"); } #endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- * * Div643232 -- * * Unsigned integer division: * The dividend is 64-bit wide * The divisor is 32-bit wide * The quotient is 32-bit wide * * Use this function if you are certain that: * o Either the quotient will fit in 32 bits, * o Or your code is ready to handle a #DE exception indicating overflow. * If that is not the case, then use Div643264(). * * Results: * Quotient and remainder * * Side effects: * None * *----------------------------------------------------------------------------- */ #if defined(__GNUC__) static INLINE void Div643232(uint64 dividend, // IN uint32 divisor, // IN uint32 *quotient, // OUT uint32 *remainder) // OUT { __asm__( "divl %4" : "=a" (*quotient), "=d" (*remainder) : "0" ((uint32)dividend), "1" ((uint32)(dividend >> 32)), "rm" (divisor) : "cc" ); } #elif defined _MSC_VER static INLINE void Div643232(uint64 dividend, // IN uint32 divisor, // IN uint32 *quotient, // OUT uint32 *remainder) // OUT { __asm { mov eax, DWORD PTR [dividend] mov edx, DWORD PTR [dividend+4] div DWORD PTR [divisor] mov edi, DWORD PTR [quotient] mov [edi], eax mov edi, DWORD PTR [remainder] mov [edi], edx } } #else #error No compiler defined for Div643232 #endif #if defined(__GNUC__) /* *----------------------------------------------------------------------------- * * Div643264 -- * * Unsigned integer division: * The dividend is 64-bit wide * The divisor is 32-bit wide * The quotient is 64-bit wide * * Results: * Quotient and remainder * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE void Div643264(uint64 dividend, // IN uint32 divisor, // IN uint64 *quotient, // OUT uint32 *remainder) // OUT { uint32 hQuotient; uint32 lQuotient; __asm__( "divl %5" "\n\t" "movl %%eax, %0" "\n\t" "movl %4, %%eax" "\n\t" "divl %5" : "=&rm" (hQuotient), "=a" (lQuotient), "=d" (*remainder) : "1" ((uint32)(dividend >> 32)), "g" ((uint32)dividend), "rm" (divisor), "2" (0) : "cc" ); *quotient = (uint64)hQuotient << 32 | lQuotient; } #endif /* *----------------------------------------------------------------------------- * * Mul64x3264 -- * * Unsigned integer by fixed point multiplication, with rounding: * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) * * Unsigned 64-bit integer multiplicand. * Unsigned 32-bit fixed point multiplier, represented as * (multiplier, shift), where shift < 64. * * Result: * Unsigned 64-bit integer product. * *----------------------------------------------------------------------------- */ #if defined(__GNUC__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && \ !defined(MUL64_NO_ASM) static INLINE uint64 Mul64x3264(uint64 multiplicand, uint32 multiplier, uint32 shift) { uint64 result; uint32 tmp1, tmp2; // ASSERT(shift >= 0 && shift < 64); __asm__("mov %%eax, %2\n\t" // Save lo(multiplicand) "mov %%edx, %%eax\n\t" // Get hi(multiplicand) "mull %4\n\t" // p2 = hi(multiplicand) * multiplier "xchg %%eax, %2\n\t" // Save lo(p2), get lo(multiplicand) "mov %%edx, %1\n\t" // Save hi(p2) "mull %4\n\t" // p1 = lo(multiplicand) * multiplier "addl %2, %%edx\n\t" // hi(p1) += lo(p2) "adcl $0, %1\n\t" // hi(p2) += carry from previous step "cmpl $32, %%ecx\n\t" // shift < 32? "jl 2f\n\t" // Go if so "shll $1, %%eax\n\t" // Save lo(p1) bit 31 in CF in case shift=32 "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) "mov %1, %%edx\n\t" "shrdl %%edx, %%eax\n\t" "mov $0, %2\n\t" "adcl $0, %2\n\t" // Get highest order bit shifted out, from CF "shrl %%cl, %%edx\n\t" "jmp 3f\n" "2:\n\t" "xor %2, %2\n\t" "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift "adcl $0, %2\n\t" // Get highest order bit shifted out, from CF "shrdl %1, %%edx\n" "3:\n\t" "addl %2, %%eax\n\t" // result += highest order bit shifted out "adcl $0, %%edx" : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) : "0" (multiplicand), "rm" (multiplier), "c" (shift) : "cc"); return result; } #elif defined _MSC_VER #pragma warning(disable: 4035) static INLINE uint64 Mul64x3264(uint64 multiplicand, uint32 multiplier, uint32 shift) { // ASSERT(shift >= 0 && shift < 64); __asm { mov eax, DWORD PTR [multiplicand+4] // Get hi(multiplicand) mul DWORD PTR [multiplier] // p2 = hi(multiplicand) * multiplier mov ecx, eax // Save lo(p2) mov ebx, edx // Save hi(p2) mov eax, DWORD PTR [multiplicand] // Get lo(multiplicand) mul DWORD PTR [multiplier+0] // p1 = lo(multiplicand) * multiplier add edx, ecx // hi(p1) += lo(p2) adc ebx, 0 // hi(p2) += carry from previous step mov ecx, DWORD PTR [shift] // Get shift cmp ecx, 32 // shift < 32? jl SHORT l2 // Go if so shl eax, 1 // Save lo(p1) bit 31 in CF in case shift=32 mov eax, edx // result = hi(p2):hi(p1) >> (shift & 31) mov edx, ebx shrd eax, edx, cl mov esi, 0 adc esi, 0 // Get highest order bit shifted out, from CF shr edx, cl jmp SHORT l3 l2: xor esi, esi shrd eax, edx, cl // result = hi(p2):hi(p1):lo(p1) >> shift adc esi, 0 // Get highest order bit shifted out, from CF shrd edx, ebx, cl l3: add eax, esi // result += highest order bit shifted out adc edx, 0 } // return with result in edx:eax } #pragma warning(default: 4035) #else #define MUL64_NO_ASM 1 #include "mul64.h" #endif /* *----------------------------------------------------------------------------- * * Muls64x32s64 -- * * Signed integer by fixed point multiplication, with rounding: * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) * * Signed 64-bit integer multiplicand. * Unsigned 32-bit fixed point multiplier, represented as * (multiplier, shift), where shift < 64. * * Result: * Signed 64-bit integer product. * *----------------------------------------------------------------------------- */ #if defined(__GNUC__) && \ (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) && \ !defined(MUL64_NO_ASM) static INLINE int64 Muls64x32s64(int64 multiplicand, uint32 multiplier, uint32 shift) { int64 result; uint32 tmp1, tmp2; // ASSERT(shift >= 0 && shift < 64); __asm__("mov %%eax, %2\n\t" // Save lo(multiplicand) "mov %%edx, %%eax\n\t" // Get hi(multiplicand) "test %%eax, %%eax\n\t" // Check sign of multiplicand "jl 0f\n\t" // Go if negative "mull %4\n\t" // p2 = hi(multiplicand) * multiplier "jmp 1f\n" "0:\n\t" "mull %4\n\t" // p2 = hi(multiplicand) * multiplier "sub %4, %%edx\n" // hi(p2) += -1 * multiplier "1:\n\t" "xchg %%eax, %2\n\t" // Save lo(p2), get lo(multiplicand) "mov %%edx, %1\n\t" // Save hi(p2) "mull %4\n\t" // p1 = lo(multiplicand) * multiplier "addl %2, %%edx\n\t" // hi(p1) += lo(p2) "adcl $0, %1\n\t" // hi(p2) += carry from previous step "cmpl $32, %%ecx\n\t" // shift < 32? "jl 2f\n\t" // Go if so "shll $1, %%eax\n\t" // Save lo(p1) bit 31 in CF in case shift=32 "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) "mov %1, %%edx\n\t" "shrdl %%edx, %%eax\n\t" "mov $0, %2\n\t" "adcl $0, %2\n\t" // Get highest order bit shifted out from CF "sarl %%cl, %%edx\n\t" "jmp 3f\n" "2:\n\t" "xor %2, %2\n\t" "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift "adcl $0, %2\n\t" // Get highest order bit shifted out from CF "shrdl %1, %%edx\n" "3:\n\t" "addl %2, %%eax\n\t" // result += highest order bit shifted out "adcl $0, %%edx" : "=A" (result), "=&r" (tmp1), "=&rm" (tmp2) : "0" (multiplicand), "rm" (multiplier), "c" (shift) : "cc"); return result; } #elif defined(_MSC_VER) #pragma warning(disable: 4035) static INLINE int64 Muls64x32s64(int64 multiplicand, uint32 multiplier, uint32 shift) { //ASSERT(shift >= 0 && shift < 64); __asm { mov eax, DWORD PTR [multiplicand+4] // Get hi(multiplicand) test eax, eax // Check sign of multiplicand jl SHORT l0 // Go if negative mul DWORD PTR [multiplier] // p2 = hi(multiplicand) * multiplier jmp SHORT l1 l0: mul DWORD PTR [multiplier] // p2 = hi(multiplicand) * multiplier sub edx, DWORD PTR [multiplier] // hi(p2) += -1 * multiplier l1: mov ecx, eax // Save lo(p2) mov ebx, edx // Save hi(p2) mov eax, DWORD PTR [multiplicand] // Get lo(multiplicand) mul DWORD PTR [multiplier] // p1 = lo(multiplicand) * multiplier add edx, ecx // hi(p1) += lo(p2) adc ebx, 0 // hi(p2) += carry from previous step mov ecx, DWORD PTR [shift] // Get shift cmp ecx, 32 // shift < 32? jl SHORT l2 // Go if so shl eax, 1 // Save lo(p1) bit 31 in CF in case shift=32 mov eax, edx // result = hi(p2):hi(p1) >> (shift & 31) mov edx, ebx shrd eax, edx, cl mov esi, 0 adc esi, 0 // Get highest order bit shifted out, from CF sar edx, cl jmp SHORT l3 l2: xor esi, esi shrd eax, edx, cl // result = hi(p2):hi(p1):lo(p1) << shift adc esi, 0 // Get highest order bit shifted out, from CF shrd edx, ebx, cl l3: add eax, esi // result += highest order bit shifted out adc edx, 0 } // return with result in edx:eax } #pragma warning(default: 4035) #endif #endif open-vm-tools-10.0.7-3227872/lib/include/vmsupport.h0000644000000000000000000000367112660700526020304 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * vmsupport.h -- * * Defines constants related to VM support data collection. * */ #ifndef _VMSUPPORT_H_ #define _VMSUPPORT_H_ /* * The status of vm-support tool running in the guest, exported in VMDB at: * vm/#/vmx/guestTools/vmsupport/gStatus * This enum must be kept in sync with vm-support script implementation. * The ordering in enum is important. */ typedef enum { VMSUPPORT_NOT_RUNNING = 0, /* script is not running */ VMSUPPORT_BEGINNING = 1, /* script is beginning */ VMSUPPORT_RUNNING = 2, /* script running in progress */ VMSUPPORT_ENDING = 3, /* script is ending */ VMSUPPORT_ERROR = 10, /* script failed */ VMSUPPORT_UNKNOWN = 100 /* collection not supported */ } VMSupportStatus; /* * The command for vm-support tool launched in the guest, set in VMDB at: * vm/#/vmx/guestTools/vmsupport/hgCmd */ typedef enum { VMSUPPORT_CMD_RESET = 0, VMSUPPORT_CMD_SET = 1 } VMSupportCmd; #define RPC_VMSUPPORT_START "vmsupport.start" #define RPC_VMSUPPORT_STATUS "tools.vmsupport.status" #endif // _VMSUPPORT_H_ open-vm-tools-10.0.7-3227872/lib/include/fileIO.h0000644000000000000000000003673112660700526017377 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * fileIO.h -- * * Host-independent wrapper for low-level fileIO functions. * */ /* * Note: * * . FileIO_[Read|Write]() [read|write]s exactly the number of bytes requested * unless an error occurs * . FileIO_Seek() supports files larger than 2 GB * . If a function returns a generic error, you can call your native function * to retrieve the last error code */ #ifndef _FILEIO_H_ #define _FILEIO_H_ #ifdef __cplusplus extern "C"{ #endif #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include #include #if !defined(_WIN32) #include #include #endif #include "vm_basic_types.h" #include "unicodeTypes.h" #include "iovector.h" // for struct iovec struct FileLockToken; #if defined(_WIN32) # include typedef struct FileIODescriptor { HANDLE win32; uint32 flags; char *fileName; struct FileLockToken *lockToken; } FileIODescriptor; #else typedef struct FileIODescriptor { int posix; int flags; char *fileName; struct FileLockToken *lockToken; } FileIODescriptor; #endif typedef enum { /* distance is relative to the beginning of the file */ FILEIO_SEEK_BEGIN, /* distance is relative to the current position in the file */ FILEIO_SEEK_CURRENT, /* distance is relative to the end of the file */ FILEIO_SEEK_END, } FileIOSeekOrigin; #define FILEIO_OPEN_ACCESS_READ (1 << 0) #define FILEIO_OPEN_ACCESS_WRITE (1 << 1) /* * Use synchronous writes (no lazy buffer cache flush) */ #define FILEIO_OPEN_SYNC (1 << 2) /* * Delete the file as soon as possible (i.e. when nobody uses it anymore) */ #define FILEIO_OPEN_DELETE_ASAP (1 << 3) #define FILEIO_OPEN_UNBUFFERED (1 << 4) /* * Lock the file on open */ #define FILEIO_OPEN_LOCKED (1 << 5) /* * Asynchronous file I/O */ #define FILEIO_ASYNCHRONOUS (1 << 6) /* * Open non-blocking mode */ #define FILEIO_OPEN_NONBLOCK (1 << 7) /* * Open with more privileges */ #define FILEIO_OPEN_PRIVILEGED (1 << 8) /* * Open exclusive. * On Windows host it doesn't pass the flag FILE_SHARE_(READ|WRITE) to * CreateFile. Right now, EXCLUSIVE_READ is not used and EXCLUSIVE_WRITE * is only used by the cdrom code to implement the exclusive option. * On Linux hosts, it passes O_EXCL if both are set. * By default, we share r/w. -Maxime */ #define FILEIO_OPEN_EXCLUSIVE_READ (1 << 9) #define FILEIO_OPEN_EXCLUSIVE_WRITE (1 << 10) /* * Open sequential. * This flag only changes the behavior on Windows host. It is off by default. */ #define FILEIO_OPEN_SEQUENTIAL_SCAN (1 << 11) /* * Make IOCTL be run by root. This flag only changes the behavior on Linux * host. It is off by default. * * XXX: This has nothing to do with fileIO, but since AIOMgr shares the flags * with fileIO, I had to add it here. In some future it would be nice to * unshare the flags between the two at which point this could be fixed. * --Tommy */ #define FILEIO_OPEN_PRIVILEGED_IOCTL (1 << 12) /* * Lock the file on open with a exclusive leased lock that can be broken * (supported on ESX file systems) */ #define FILEIO_OPEN_EXCLUSIVE_LOCK (1 << 13) /* * Lock the file on open with a multiwriter leased lock that can be broken * (supported on ESX file systems) */ #define FILEIO_OPEN_MULTIWRITER_LOCK (1 << 14) /* * Valid only for MacOS. It eventually results into O_EXLOCK flag passed to open * system call. * * O_EXLOCK, O_SHLOCK behavior is tested on Mac OS X Server 10.6, kernel 10.0.0. * * | | Block devices | Regular files * |----------------------|--------------------|---------------- * | Locking behavior | mandatory | advisory * | | | * | If O_NONBLOCK absent | open doesn't block | open blocks * | | on conflicts | on conflicts */ #define FILEIO_OPEN_EXCLUSIVE_LOCK_MACOS (1 << 16) /* * Open file in APPEND-only mode. All writes go to the current end of file, * not to the current file pointer location. */ #define FILEIO_OPEN_APPEND (1 << 17) /* * Valid only on POSIXen. Don't follow a symbolic link. */ #define FILEIO_OPEN_ACCESS_NOFOLLOW (1 << 18) /* * Valid only on Windows. Set FILE_SHARE_DELETE. */ #define FILEIO_OPEN_SHARE_DELETE (1 << 19) /* * Strengths of file lock. * Advisory: * Must use FileIO plus lock flags to get locking. * Never uses kernel/fs-level lock, so naked open() bypasses locking. * Mandatory: * Requires kernel/fs-level, so naked open() respects lock. * Kernel/fs-level locks are available on ESX but not hosted. * Best: * Adaptively picks between mandatory and advisory. * Almost all cases should use the "best" lock. */ #define FILEIO_OPEN_LOCK_BEST FILEIO_OPEN_LOCKED /* historical */ #define FILEIO_OPEN_LOCK_ADVISORY (1 << 20) #define FILEIO_OPEN_LOCK_MANDATORY (1 << 21) /* * OPTIMISTIC is an alternative to EXCLUSIVE and MANDATORY. It applies * only on ESX, and gives VMkernel permission to use a type of lock * called "optimistic" to speed up opens. Rule-of-thumb is to use it * only for read-only opens of small files (< 1KB). */ #define FILEIO_OPEN_OPTIMISTIC_LOCK (1 << 22) /* * Flag passed to open() to not attempt to get the lun attributes as part of * the open operation. Applicable only to opening of SCSI devices. This * definition must match the definition of USEROBJ_OPEN_NOATTR in * user_vsiTypes.h and FS_OPEN_NOATTR in fs_public.h */ #define O_NOATTR 0x04000000 // Flag passed to open() to get multiwriter VMFS lock. This definition must // match USEROBJ_OPEN_MULTIWRITER_LOCK in user_vsiTypes.h. #define O_MULTIWRITER_LOCK 0x08000000 // Flag passed to open() to get exclusive VMFS lock. This definition must // match USEROBJ_OPEN_EXCLUSIVE_LOCK in user_vsiTypes.h. #define O_EXCLUSIVE_LOCK 0x10000000 // Flag passed to open() to enable use of oplocks on VMFS. This definition // must match USEROBJ_OPEN_OPTIMISTIC_LOCK in user_vsiTypes.h. #define O_OPTIMISTIC_LOCK 0x00400000 /* File Access check args */ #define FILEIO_ACCESS_READ (1 << 0) #define FILEIO_ACCESS_WRITE (1 << 1) #define FILEIO_ACCESS_EXEC (1 << 2) #define FILEIO_ACCESS_EXISTS (1 << 3) typedef enum { // File doesn't exist File exists FILEIO_OPEN, // error FILEIO_OPEN_EMPTY, // error size = 0 FILEIO_OPEN_CREATE, // create FILEIO_OPEN_CREATE_SAFE, // create error FILEIO_OPEN_CREATE_EMPTY, // create size = 0 } FileIOOpenAction; typedef enum { /* * Generic status codes */ /* No error */ FILEIO_SUCCESS, /* The user cancelled the operation */ FILEIO_CANCELLED, /* Generic error */ FILEIO_ERROR, /* * Status codes specific to FileIO_Open() */ /* FILEIO_OPEN_CREATE_SAFE was used and the file already existed */ FILEIO_OPEN_ERROR_EXIST, /* Couldn't obtain the requested lock */ FILEIO_LOCK_FAILED, /* Status codes specific to FileIO_Read() */ /* Tried to read beyond the end of a file */ FILEIO_READ_ERROR_EOF, /* Couldnt locate file */ FILEIO_FILE_NOT_FOUND, /* Insufficient Permissions */ FILEIO_NO_PERMISSION, /* File name too long */ FILEIO_FILE_NAME_TOO_LONG, /* * Status codes specific for FileIO_Write() */ /* Attempts to write file that exceeds maximum file size */ FILEIO_WRITE_ERROR_FBIG, /* The device containint the file has no room for the data */ FILEIO_WRITE_ERROR_NOSPC, /* Attempts to write file that exceeds user's disk quota */ FILEIO_WRITE_ERROR_DQUOT, /* * NB: Until disklib error handling is changed, there must be no more * than 16 total error codes here. */ FILEIO_ERROR_LAST, /* Must be last! */ } FileIOResult; const char *FileIO_MsgError(FileIOResult status); void FileIO_Invalidate(FileIODescriptor *file); Bool FileIO_IsValid(const FileIODescriptor *fd); FileIOResult FileIO_Create(FileIODescriptor *file, const char *pathName, int access, FileIOOpenAction action, int mode); FileIOResult FileIO_Open(FileIODescriptor *file, const char *pathName, int access, FileIOOpenAction action); FileIOResult FileIO_OpenRetry(FileIODescriptor *file, const char *pathName, int access, FileIOOpenAction action, uint32 msecMaxWaitTime); uint64 FileIO_Seek(const FileIODescriptor *file, int64 distance, FileIOSeekOrigin origin); FileIOResult FileIO_Read(FileIODescriptor *file, void *buf, size_t requested, size_t *actual); FileIOResult FileIO_Write(FileIODescriptor *file, const void *buf, size_t requested, size_t *actual); char *FileIO_AtomicTempPath(const char *path); FileIOResult FileIO_AtomicTempFile(FileIODescriptor *fileFD, FileIODescriptor *tempFD); Bool FileIO_AtomicUpdate(FileIODescriptor *newFD, FileIODescriptor *currFD); #if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) FileIOResult FileIO_Readv(FileIODescriptor *fd, struct iovec const *v, int count, size_t totalSize, size_t *bytesRead); FileIOResult FileIO_Writev(FileIODescriptor *fd, struct iovec const *v, int count, size_t totalSize, size_t *bytesWritten); #endif FileIOResult FileIO_Preadv(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to read into int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start reading size_t totalSize, // IN: totalSize (bytes) in entries size_t *actual); // OUT: number of bytes read FileIOResult FileIO_Pwritev(FileIODescriptor *fd, // IN: File descriptor struct iovec const *entries, // IN: Vector to write from int numEntries, // IN: Number of vector entries uint64 offset, // IN: Offset to start writing size_t totalSize, // IN: Total size (bytes) in entries size_t *actual); // OUT: number of bytes written FileIOResult FileIO_Pread(FileIODescriptor *fd, // IN: File descriptor void *buf, // IN: Buffer to read into size_t len, // IN: Length of the buffer uint64 offset); // IN: Offset to start reading FileIOResult FileIO_Pwrite(FileIODescriptor *fd, // IN: File descriptor void const *buf, // IN: Buffer to write from size_t len, // IN: Length of the buffer uint64 offset); // IN: Offset to start writing FileIOResult FileIO_Access(const char *pathName, int accessMode); Bool FileIO_Truncate(FileIODescriptor *file, uint64 newSize); FileIOResult FileIO_Sync(const FileIODescriptor *file); FileIOResult FileIO_GetAllocSize(const FileIODescriptor *fd, uint64 *logicalBytes, uint64 *allocedBytes); int64 FileIO_GetSize(const FileIODescriptor *fd); Bool FileIO_SetAllocSize(const FileIODescriptor *fd, uint64 size); FileIOResult FileIO_GetAllocSizeByPath(const char *pathName, uint64 *logicalBytes, uint64 *allocedBytes); int64 FileIO_GetSizeByPath(const char *pathName); FileIOResult FileIO_Close(FileIODescriptor *file); FileIOResult FileIO_CloseAndUnlink(FileIODescriptor *file); uint32 FileIO_GetFlags(FileIODescriptor *file); Bool FileIO_GetVolumeSectorSize(const char *name, uint32 *sectorSize); Bool FileIO_SupportsFileSize(const FileIODescriptor *file, uint64 testSize); int64 FileIO_GetModTime(const FileIODescriptor *fd); FileIOResult FileIO_Lock(FileIODescriptor *file, int access); FileIOResult FileIO_Unlock(FileIODescriptor *file); /* Only users not using FileIO_Open should use these two */ void FileIO_Init(FileIODescriptor *fd, const char *pathName); void FileIO_Cleanup(FileIODescriptor *fd); const char *FileIO_ErrorEnglish(FileIOResult status); void FileIO_OptionalSafeInitialize(void); #if defined(_WIN32) FileIODescriptor FileIO_CreateFDWin32(HANDLE win32, DWORD access, DWORD attributes); #else FileIODescriptor FileIO_CreateFDPosix(int posix, int flags); int FileIO_PrivilegedPosixOpen(const char *pathName, int flags); #endif FILE *FileIO_DescriptorToStream(FileIODescriptor *fd, Bool textMode); const char *FileIO_Filename(FileIODescriptor *fd); /* *------------------------------------------------------------------------- * * FileIO_IsSuccess -- * * Returns TRUE if the error code is success. * * Result: * TRUE/FALSE. * * Side effects: * None. * *------------------------------------------------------------------------- */ #if !defined(sun) || __GNUC__ >= 3 static INLINE Bool FileIO_IsSuccess(FileIOResult res) // IN { return res == FILEIO_SUCCESS; } #else /* * XXX: Crosscompiler used for Solaris tools builds (gcc 2.95.3) complains * whenever the above definition is unused, even though that shouldn't be * a problem for static functions that are also inline. So for Solaris, we * have a separate definition that is neither static nor inline. */ Bool FileIO_IsSuccess(FileIOResult res); #endif Bool FileIO_SupportsPrealloc(const char *pathName, Bool fsCheck); #ifdef __cplusplus } // extern "C" { #endif #endif // _FILEIO_H_ open-vm-tools-10.0.7-3227872/lib/include/vm_basic_defs.h0000644000000000000000000004771012660700526021013 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * vm_basic_defs.h -- * * Standard macros for VMware source code. */ #ifndef _VM_BASIC_DEFS_H_ #define _VM_BASIC_DEFS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMKDRIVERS #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_types.h" // For INLINE. /* Checks for FreeBSD, filtering out VMKERNEL. */ #define __IS_FREEBSD__ (!defined(VMKERNEL) && defined(__FreeBSD__)) #define __IS_FREEBSD_VER__(ver) (__IS_FREEBSD__ && __FreeBSD_version >= (ver)) #if defined _WIN32 && defined USERLEVEL #include /* * We redefine offsetof macro from stddef; make * sure that it's already defined before we do that. */ #include // for Sleep() and LOWORD() etc. #undef GetFreeSpace // Unpollute preprocessor namespace. #endif /* * Simple macros */ #ifndef vmw_offsetof #define vmw_offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #endif #if (defined __APPLE__ || defined __FreeBSD__) && \ (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include #else #ifndef offsetof #define VMW_DEFINED_OFFSETOF /* * XXX While the _WIN32 implementation appears to be identical to vmw_offsetof * in terms of behavior, they need to be separate to match verbatim the * definition used by the respective compilers, to avoid a redefinition warning. * * This is necessary until we eliminate the inclusion of above. */ #ifdef _WIN32 #define offsetof(s,m) (size_t)&(((s *)0)->m) /* * We use the builtin offset for gcc/clang, except when we're running under the * vmkernel's GDB macro preprocessor, since gdb doesn't understand * __builtin_offsetof. */ #elif defined __GNUC__ && !defined VMKERNEL_GDB_MACRO_BUILDER #define offsetof __builtin_offsetof #else #define offsetof vmw_offsetof #endif #endif // offsetof #endif // __APPLE__ #define VMW_CONTAINER_OF(ptr, type, member) \ ((type *)((char *)(ptr) - vmw_offsetof(type, member))) #ifndef ARRAYSIZE #define ARRAYSIZE(a) (sizeof (a) / sizeof *(a)) #endif #ifndef MIN #define MIN(_a, _b) (((_a) < (_b)) ? (_a) : (_b)) #endif /* The Solaris 9 cross-compiler complains about these not being used */ #ifndef sun static INLINE int Min(int a, int b) { return a < b ? a : b; } #endif #ifndef MAX #define MAX(_a, _b) (((_a) > (_b)) ? (_a) : (_b)) #endif #ifndef sun static INLINE int Max(int a, int b) { return a > b ? a : b; } #endif #define VMW_CLAMP(x, min, max) \ ((x) < (min) ? (min) : ((x) > (max) ? (max) : (x))) #define ROUNDUP(x,y) (((x) + (y) - 1) / (y) * (y)) #define ROUNDDOWN(x,y) ((x) / (y) * (y)) #define ROUNDUPBITS(x, bits) (((uintptr_t) (x) + MASK(bits)) & ~MASK(bits)) #define ROUNDDOWNBITS(x, bits) ((uintptr_t) (x) & ~MASK(bits)) #define CEILING(x, y) (((x) + (y) - 1) / (y)) #if defined __APPLE__ #include #undef MASK #endif /* * The MASK macro behaves badly when given negative numbers or numbers larger * than the highest order bit number (e.g. 32 on a 32-bit machine) as an * argument. The range 0..31 is safe. */ #define MASK(n) ((1 << (n)) - 1) /* make an n-bit mask */ #define MASK64(n) ((CONST64U(1) << (n)) - 1) /* make an n-bit mask */ /* * MASKRANGE64 makes a bit vector starting at bit lo and ending at bit hi. No * checking for lo < hi is done. */ #define MASKRANGE64(hi, lo) (MASK64((hi) - (lo) + 1) << (lo)) /* SIGNEXT64 sign extends a n-bit value to 64-bits. */ #define SIGNEXT64(val, n) (((int64)(val) << (64 - (n))) >> (64 - (n))) #define DWORD_ALIGN(x) ((((x) + 3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x) + 7) >> 3) << 3) #define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL */ #ifndef NULL #ifdef __cplusplus #define NULL 0 #else #define NULL ((void *)0) #endif #endif /* * Token concatenation * * The C preprocessor doesn't prescan arguments when they are * concatenated or stringified. So we need extra levels of * indirection to convince the preprocessor to expand its * arguments. */ #define CONC(x, y) x##y #define XCONC(x, y) CONC(x, y) #define XXCONC(x, y) XCONC(x, y) #define MAKESTR(x) #x #define XSTR(x) MAKESTR(x) /* * Wide versions of string constants. */ #ifndef WSTR #define WSTR_(X) L ## X #define WSTR(X) WSTR_(X) #endif /* * Page operations * * It has been suggested that these definitions belong elsewhere * (like x86types.h). However, I deem them common enough * (since even regular user-level programs may want to do * page-based memory manipulation) to be here. * -- edward */ #ifndef PAGE_SHIFT // { #if defined VM_I386 #define PAGE_SHIFT 12 #elif defined __APPLE__ #define PAGE_SHIFT 12 #elif defined VM_ARM_64 #define PAGE_SHIFT 12 #elif defined __arm__ #define PAGE_SHIFT 12 #else #error #endif #endif // } #ifndef PAGE_SIZE #define PAGE_SIZE (1 << PAGE_SHIFT) #endif #ifndef PAGE_MASK #define PAGE_MASK (PAGE_SIZE - 1) #endif #ifndef PAGE_OFFSET #define PAGE_OFFSET(_addr) ((uintptr_t)(_addr) & (PAGE_SIZE - 1)) #endif #ifndef PAGE_NUMBER #define PAGE_NUMBER(_addr) ((uintptr_t)(_addr) / PAGE_SIZE) #endif #ifndef VM_PAGE_BASE #define VM_PAGE_BASE(_addr) ((_addr) & ~(PAGE_SIZE - 1)) #endif #ifndef VM_PAGES_SPANNED #define VM_PAGES_SPANNED(_addr, _size) \ ((((_addr) & (PAGE_SIZE - 1)) + (_size) + (PAGE_SIZE - 1)) >> PAGE_SHIFT) #endif #ifndef BYTES_2_PAGES #define BYTES_2_PAGES(_nbytes) ((_nbytes) >> PAGE_SHIFT) #endif #ifndef PAGES_2_BYTES #define PAGES_2_BYTES(_npages) (((uint64)(_npages)) << PAGE_SHIFT) #endif #ifndef MBYTES_2_PAGES #define MBYTES_2_PAGES(_nbytes) ((_nbytes) << (20 - PAGE_SHIFT)) #endif #ifndef PAGES_2_MBYTES #define PAGES_2_MBYTES(_npages) ((_npages) >> (20 - PAGE_SHIFT)) #endif #ifndef GBYTES_2_PAGES #define GBYTES_2_PAGES(_nbytes) ((_nbytes) << (30 - PAGE_SHIFT)) #endif #ifndef PAGES_2_GBYTES #define PAGES_2_GBYTES(_npages) ((_npages) >> (30 - PAGE_SHIFT)) #endif #ifndef BYTES_2_MBYTES #define BYTES_2_MBYTES(_nbytes) ((_nbytes) >> 20) #endif #ifndef MBYTES_2_BYTES #define MBYTES_2_BYTES(_nbytes) ((uint64)(_nbytes) << 20) #endif #ifndef BYTES_2_GBYTES #define BYTES_2_GBYTES(_nbytes) ((_nbytes) >> 30) #endif #ifndef GBYTES_2_BYTES #define GBYTES_2_BYTES(_nbytes) ((uint64)(_nbytes) << 30) #endif #ifndef VM_PAE_LARGE_PAGE_SHIFT #define VM_PAE_LARGE_PAGE_SHIFT 21 #endif #ifndef VM_PAE_LARGE_PAGE_SIZE #define VM_PAE_LARGE_PAGE_SIZE (1 << VM_PAE_LARGE_PAGE_SHIFT) #endif #ifndef VM_PAE_LARGE_PAGE_MASK #define VM_PAE_LARGE_PAGE_MASK (VM_PAE_LARGE_PAGE_SIZE - 1) #endif #ifndef VM_PAE_LARGE_2_SMALL_PAGES #define VM_PAE_LARGE_2_SMALL_PAGES (BYTES_2_PAGES(VM_PAE_LARGE_PAGE_SIZE)) #endif /* * Word operations */ #ifndef LOWORD #define LOWORD(_dw) ((_dw) & 0xffff) #endif #ifndef HIWORD #define HIWORD(_dw) (((_dw) >> 16) & 0xffff) #endif #ifndef LOBYTE #define LOBYTE(_w) ((_w) & 0xff) #endif #ifndef HIBYTE #define HIBYTE(_w) (((_w) >> 8) & 0xff) #endif #ifndef HIDWORD #define HIDWORD(_qw) ((uint32)((_qw) >> 32)) #endif #ifndef LODWORD #define LODWORD(_qw) ((uint32)(_qw)) #endif #define QWORD(_hi, _lo) ((((uint64)(_hi)) << 32) | ((uint32)(_lo))) /* * Deposit a field _src at _pos bits from the right, * with a length of _len, into the integer _target. */ #define DEPOSIT_BITS(_src,_pos,_len,_target) { \ unsigned mask = ((1 << _len) - 1); \ unsigned shiftedmask = ((1 << _len) - 1) << _pos; \ _target = (_target & ~shiftedmask) | ((_src & mask) << _pos); \ } /* * Get return address. */ #ifdef _MSC_VER #ifdef __cplusplus extern "C" #endif void *_ReturnAddress(void); #pragma intrinsic(_ReturnAddress) #define GetReturnAddress() _ReturnAddress() #elif __GNUC__ #define GetReturnAddress() __builtin_return_address(0) #endif #ifdef __GNUC__ #ifndef sun /* * A bug in __builtin_frame_address was discovered in gcc 4.1.1, and * fixed in 4.2.0; assume it originated in 4.0. PR 147638 and 554369. */ #if !(__GNUC__ == 4 && (__GNUC_MINOR__ == 0 || __GNUC_MINOR__ == 1)) #define GetFrameAddr() __builtin_frame_address(0) #endif #endif // sun #endif // __GNUC__ /* * Data prefetch was added in gcc 3.1.1 * http://www.gnu.org/software/gcc/gcc-3.1/changes.html */ #ifdef __GNUC__ # if ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ > 1) || \ (__GNUC__ == 3 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 1)) # define PREFETCH_R(var) __builtin_prefetch((var), 0 /* read */, \ 3 /* high temporal locality */) # define PREFETCH_W(var) __builtin_prefetch((var), 1 /* write */, \ 3 /* high temporal locality */) # else # define PREFETCH_R(var) ((void)(var)) # define PREFETCH_W(var) ((void)(var)) # endif #endif /* __GNUC__ */ #ifdef USERLEVEL // { /* * Note this might be a problem on NT b/c while sched_yield guarantees it * moves you to the end of your priority list, Sleep(0) offers no such * guarantee. Bummer. --Jeremy. */ #if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) #elif defined(VMKERNEL) /* We don't have a YIELD macro in the vmkernel */ #else # include // For sched_yield. Don't ask. --Jeremy. # define YIELD() sched_yield() #endif /* * Standardize some Posix names on Windows. */ #ifdef _WIN32 // { #define snprintf _snprintf #define strtok_r strtok_s #if (_MSC_VER < 1500) #define vsnprintf _vsnprintf #endif typedef int uid_t; typedef int gid_t; static INLINE void sleep(unsigned int sec) { Sleep(sec * 1000); } static INLINE int usleep(unsigned long usec) { Sleep(CEILING(usec, 1000)); return 0; } typedef int pid_t; #define F_OK 0 #define X_OK 1 #define W_OK 2 #define R_OK 4 #endif // } /* * Macro for username comparison. */ #ifdef _WIN32 // { #define USERCMP(x,y) Str_Strcasecmp(x,y) #else #define USERCMP(x,y) strcmp(x,y) #endif // } #endif // } #ifndef va_copy #ifdef _WIN32 /* * Windows needs va_copy. This works for both 32 and 64-bit Windows * based on inspection of how varags.h from the Visual C CRTL is * implemented. (Future versions of the RTL may break this). */ #define va_copy(dest, src) ((dest) = (src)) #elif defined(__APPLE__) && defined(KERNEL) #include "availabilityMacOS.h" #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 // The Mac OS 10.5 kernel SDK defines va_copy in stdarg.h. #include #else /* * The Mac OS 10.4 kernel SDK needs va_copy. Based on inspection of * stdarg.h from the MacOSX10.4u.sdk kernel framework, this should * work. */ #define va_copy(dest, src) ((dest) = (src)) #endif // MAC_OS_X_VERSION_MIN_REQUIRED #elif defined(__GNUC__) && (__GNUC__ < 3) /* * Old versions of gcc recognize __va_copy, but not va_copy. */ #define va_copy(dest, src) __va_copy(dest, src) #endif // _WIN32 #endif // va_copy /* * This one is outside USERLEVEL because it's used by * files compiled into the Windows hgfs driver or the display * driver. */ #ifdef _WIN32 #define PATH_MAX 256 #ifndef strcasecmp #define strcasecmp(_s1,_s2) _stricmp((_s1),(_s2)) #endif #ifndef strncasecmp #define strncasecmp(_s1,_s2,_n) _strnicmp((_s1),(_s2),(_n)) #endif #endif #if defined __linux__ && !defined __KERNEL__ && !defined MODULE && \ !defined VMM && !defined FROBOS && !defined __ANDROID__ #include #if __GLIBC_PREREQ(2, 1) && !defined GLIBC_VERSION_21 #define GLIBC_VERSION_21 #endif #if __GLIBC_PREREQ(2, 2) && !defined GLIBC_VERSION_22 #define GLIBC_VERSION_22 #endif #if __GLIBC_PREREQ(2, 3) && !defined GLIBC_VERSION_23 #define GLIBC_VERSION_23 #endif #if __GLIBC_PREREQ(2, 4) && !defined GLIBC_VERSION_24 #define GLIBC_VERSION_24 #endif #if __GLIBC_PREREQ(2, 5) && !defined GLIBC_VERSION_25 #define GLIBC_VERSION_25 #endif #if __GLIBC_PREREQ(2, 12) && !defined GLIBC_VERSION_212 #define GLIBC_VERSION_212 #endif #endif /* * Convenience definitions of unicode characters. */ #ifndef UTF8_ELLIPSIS #define UTF8_ELLIPSIS "\xe2\x80\xa6" #endif /* * Convenience macros and definitions. Can often be used instead of #ifdef. */ #undef ARM64_ONLY #ifdef VM_ARM_64 #define ARM64_ONLY(x) x #else #define ARM64_ONLY(x) #endif #undef X86_ONLY #ifdef VM_X86_ANY #define X86_ONLY(x) x #else #define X86_ONLY(x) #endif #undef DEBUG_ONLY #ifdef VMX86_DEBUG #define vmx86_debug 1 #define DEBUG_ONLY(x) x #else #define vmx86_debug 0 #define DEBUG_ONLY(x) #endif #ifdef VMX86_STATS #define vmx86_stats 1 #define STATS_ONLY(x) x #else #define vmx86_stats 0 #define STATS_ONLY(x) #endif #ifdef VMX86_DEVEL #define vmx86_devel 1 #define DEVEL_ONLY(x) x #else #define vmx86_devel 0 #define DEVEL_ONLY(x) #endif #ifdef VMX86_LOG #define vmx86_log 1 #define LOG_ONLY(x) x #else #define vmx86_log 0 #define LOG_ONLY(x) #endif #ifdef VMX86_BETA #define vmx86_beta 1 #define BETA_ONLY(x) x #else #define vmx86_beta 0 #define BETA_ONLY(x) #endif #ifdef VMX86_RELEASE #define vmx86_release 1 #define RELEASE_ONLY(x) x #else #define vmx86_release 0 #define RELEASE_ONLY(x) #endif #ifdef VMX86_SERVER #define vmx86_server 1 #define SERVER_ONLY(x) x #define HOSTED_ONLY(x) #else #define vmx86_server 0 #define SERVER_ONLY(x) #define HOSTED_ONLY(x) x #endif #ifdef VMKERNEL #define vmkernel 1 #define VMKERNEL_ONLY(x) x #else #define vmkernel 0 #define VMKERNEL_ONLY(x) #endif #ifdef _WIN32 #define WIN32_ONLY(x) x #define POSIX_ONLY(x) #define vmx86_win32 1 #else #define WIN32_ONLY(x) #define POSIX_ONLY(x) x #define vmx86_win32 0 #endif #ifdef __linux__ #define vmx86_linux 1 #define LINUX_ONLY(x) x #else #define vmx86_linux 0 #define LINUX_ONLY(x) #endif #ifdef __APPLE__ #define vmx86_apple 1 #define APPLE_ONLY(x) x #else #define vmx86_apple 0 #define APPLE_ONLY(x) #endif #ifdef VMM #define VMM_ONLY(x) x #define USER_ONLY(x) #else #define VMM_ONLY(x) #define USER_ONLY(x) x #endif /* VMVISOR ifdef only allowed in the vmkernel */ #ifdef VMKERNEL #ifdef VMVISOR #define vmvisor 1 #define VMVISOR_ONLY(x) x #else #define vmvisor 0 #define VMVISOR_ONLY(x) #endif #endif #ifdef _WIN32 #define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE #else #define VMW_INVALID_HANDLE (-1LL) #endif #ifdef _WIN32 #define fsync(fd) _commit(fd) #define fileno(f) _fileno(f) #else #endif /* * Debug output macros for Windows drivers (the Eng variant is for * display/printer drivers only. */ #ifdef _WIN32 #ifndef USES_OLD_WINDDK #if defined(VMX86_LOG) #ifdef _WIN64 #define WinDrvPrint(arg, ...) DbgPrintEx(DPFLTR_IHVDRIVER_ID, (ULONG)~0, arg, __VA_ARGS__) #else #define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) #endif #define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else #define WinDrvPrint(arg, ...) #define WinDrvEngPrint(arg, ...) #endif #endif #endif // _WIN32 #ifdef HOSTED_LG_PG #define hosted_lg_pg 1 #else #define hosted_lg_pg 0 #endif /* * Use to initialize cbSize for this structure to preserve < Vista * compatibility. */ #define NONCLIENTMETRICSINFO_V1_SIZE CCSIZEOF_STRUCT(NONCLIENTMETRICS, \ lfMessageFont) /* This is not intended to be thread-safe. */ #define DO_ONCE(code) \ do { \ static Bool _doOnceDone = FALSE; \ if (UNLIKELY(!_doOnceDone)) { \ _doOnceDone = TRUE; \ code; \ } \ } while (0) /* * Bug 827422 and 838523. */ #if defined __GNUC__ && __GNUC__ >= 4 #define VISIBILITY_HIDDEN __attribute__((visibility("hidden"))) #else #define VISIBILITY_HIDDEN /* nothing */ #endif /* * Bitfield extraction. */ #define EXTRACT_BITSLICE32(_val , _lsb, _msb) \ (((uint32)(_val) << (31 - (_msb))) >> ((31 - (_msb)) + (_lsb))) #define EXTRACT_BITFIELD32(_val, _pos, _len) \ EXTRACT_BITSLICE32((_val), (_pos), ((_pos) + (_len) - 1)) #define EXTRACT_BITSLICE64(_val, _lsb, _msb) \ (((uint64)(_val) << (63 - (_msb))) >> ((63 - (_msb)) + (_lsb))) #define EXTRACT_BITFIELD64(_val, _pos, _len) \ EXTRACT_BITSLICE64((_val), (_pos), ((_pos) + (_len) - 1)) /* * Typical cache line size. Use this for aligning structures to cache * lines for performance, but do not rely on it for correctness. * * On x86, all current processors newer than P4 have 64-byte lines, * but P4 had 128. * * On ARM, the line size can vary between cores. 64-byte lines are * common, but either larger or smaller powers of two are possible. */ #define CACHELINE_SIZE 64 #define CACHELINE_SHIFT 6 #define CACHELINE_ALIGNMENT_MASK (CACHELINE_SIZE - 1) /* * Bits to bytes sizes. */ #define SIZE_8BIT 1 #define SIZE_16BIT 2 #define SIZE_24BIT 3 #define SIZE_32BIT 4 #define SIZE_48BIT 6 #define SIZE_64BIT 8 #define SIZE_80BIT 10 #define SIZE_128BIT 16 #define SIZE_256BIT 32 #endif // ifndef _VM_BASIC_DEFS_H_ open-vm-tools-10.0.7-3227872/lib/include/unicodeOperations.h0000644000000000000000000005263112660700526021717 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * unicodeOperations.h -- * * Basic Unicode string operations. * * UnicodeIndex index and length arguments are in terms of code * units, not characters. The size of a code unit depends on the * implementation (one byte for UTF-8, one 16-bit word for * UTF-16). Do not store these values on disk, modify them, or * do arithmetic operations on them. * * Instead of iterating over the code units in a string to do * character operations, use the library functions provided to * search and transform strings. * * If the functionality you need is not present, email the * i18n-dev mailing list. */ #ifndef _UNICODE_OPERATIONS_H_ #define _UNICODE_OPERATIONS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #include #include "unicodeBase.h" #include "vm_assert.h" #ifdef __cplusplus extern "C" { #endif /* * Primitive operations. All other Unicode operations are implemented * in terms of these. * * Pass -1 for any length parameter to indicate "from start until end * of string". */ int Unicode_CompareRange(const char *str1, UnicodeIndex str1Start, UnicodeIndex str1Length, const char *str2, UnicodeIndex str2Start, UnicodeIndex str2Length, Bool ignoreCase); UnicodeIndex Unicode_FindSubstrInRange(const char *str, UnicodeIndex strStart, UnicodeIndex strLength, const char *strToFind, UnicodeIndex strToFindStart, UnicodeIndex strToFindLength); UnicodeIndex Unicode_FindLastSubstrInRange(const char *str, UnicodeIndex strStart, UnicodeIndex strLength, const char *strToFind, UnicodeIndex strToFindStart, UnicodeIndex strToFindLength); char *Unicode_Substr(const char *str, UnicodeIndex start, UnicodeIndex length); char *Unicode_ReplaceRange(const char *destination, UnicodeIndex destinationStart, UnicodeIndex destinationLength, const char *source, UnicodeIndex sourceStart, UnicodeIndex sourceLength); char *Unicode_Join(const char *first, ...); char *Unicode_Format(const char *fmt, ...); UnicodeIndex Unicode_LengthInCodePoints(const char *str); /* * Simple in-line functions that may be used below. */ /* *----------------------------------------------------------------------------- * * Unicode_IsIndexAtCodePointBoundary -- * * Check a string index (in bytes) for code point boundary. * * The index must be valid (>= 0 and <= string length). * The end of the string is considered a valid boundary. * * Results: * TRUE if index is at a code point boundary. * * Side effects: * Panic if index is not valid. * *----------------------------------------------------------------------------- */ static INLINE Bool Unicode_IsIndexAtCodePointBoundary(const char *str, // IN: UnicodeIndex index) // IN: { ASSERT(index >= 0 && index <= Unicode_LengthInCodeUnits(str)); return (str[index] & 0xc0) != 0x80; } /* * Other operations, each based upon calls to primitives. */ /* *----------------------------------------------------------------------------- * * Unicode_Append -- * * Allocates and returns a new string containing 'destination' * followed by 'source'. * * Results: * The newly-allocated string. Caller must free with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_Append(const char *destination, // IN const char *source) // IN { return Unicode_ReplaceRange(destination, -1, 0, source, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_AppendRange -- * * Allocates and returns a new string containing 'destination' * followed by the specified range of 'source'. * * Results: * The newly-allocated string. Caller must free with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_AppendRange(const char *dest, // IN: const char *src, // IN: UnicodeIndex srcStart, // IN: UnicodeIndex srcLength) // IN: { return Unicode_ReplaceRange(dest, Unicode_LengthInCodePoints(dest), 0, src, srcStart, srcLength); } /* *----------------------------------------------------------------------------- * * Unicode_Compare -- * * Compares two Unicode strings for canonical equivalence in code * point order. * * If the result is to be visible in a user interface, use * Unicode_CompareWithLocale to support language and * culture-specific comparison and sorting rules. * * Results: * -1 if str1 < str2, 0 if str1 == str2, 1 if str1 > str2. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE int Unicode_Compare(const char *str1, // IN const char *str2) // IN { return Unicode_CompareRange(str1, 0, -1, str2, 0, -1, FALSE); } /* *----------------------------------------------------------------------------- * * Unicode_CompareIgnoreCase -- * * Compares two Unicode strings for case-insensitive canonical * equivalence in code point order. * * If the result is to be visible in a user interface, use * Unicode_CompareWithLocale to support language and * culture-specific comparison and sorting rules. * * Results: * -1 if str1 < str2, 0 if str1 == str2, 1 if str1 > str2. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE int Unicode_CompareIgnoreCase(const char *str1, // IN const char *str2) // IN { return Unicode_CompareRange(str1, 0, -1, str2, 0, -1, TRUE); } /* *----------------------------------------------------------------------------- * * UnicodeEndsWith -- * Unicode_EndsWith -- * Unicode_EndsWithIgnoreCase -- * * Tests if 'str' ends with 'suffix'. * * Results: * TRUE if 'str' ends with 'suffix', FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool UnicodeEndsWith(const char *str, // IN: const char *suffix, // IN: Bool ignoreCase) // IN: { UnicodeIndex strLength = Unicode_LengthInCodePoints(str); UnicodeIndex suffixLength = Unicode_LengthInCodePoints(suffix); UnicodeIndex offset = strLength - suffixLength; if (suffixLength > strLength) { return FALSE; } return Unicode_CompareRange(str, offset, suffixLength, suffix, 0, suffixLength, ignoreCase) == 0; } static INLINE Bool Unicode_EndsWith(const char *str, // IN const char *suffix) // IN { return UnicodeEndsWith(str, suffix, FALSE); } static INLINE Bool Unicode_EndsWithIgnoreCase(const char *str, // IN const char *suffix) // IN { return UnicodeEndsWith(str, suffix, TRUE); } /* *----------------------------------------------------------------------------- * * Unicode_Find -- * * Finds the first occurrence of 'strToFind' inside 'str'. * * Results: * If 'strToFind' exists inside 'str', returns the first starting * index of 'strToFind' in that range. * * Otherwise, returns UNICODE_INDEX_NOT_FOUND. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE UnicodeIndex Unicode_Find(const char *str, // IN const char *strToFind) // IN { return Unicode_FindSubstrInRange(str, 0, -1, strToFind, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_FindFromIndex -- * * Finds the first occurrence of 'strToFind' inside 'str' in the range * [fromIndex, lengthOfStr). * * Results: * If 'strToFind' exists inside 'str' in the specified range, * returns the first starting index of 'strToFind' in that range. * * Otherwise, returns UNICODE_INDEX_NOT_FOUND. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE UnicodeIndex Unicode_FindFromIndex(const char *str, // IN const char *strToFind, // IN UnicodeIndex fromIndex) // IN { return Unicode_FindSubstrInRange(str, fromIndex, -1, strToFind, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_FindInRange -- * * Finds the first occurrence of 'strToFind' inside 'str' in the range * [start, start+length). * * Results: * If 'strToFind' exists inside 'str' in the specified range, * returns the first starting index of 'strToFind' in that range. * * Otherwise, returns UNICODE_INDEX_NOT_FOUND. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE UnicodeIndex Unicode_FindInRange(const char *str, // IN const char *strToFind, // IN UnicodeIndex start, // IN UnicodeIndex length) // IN { return Unicode_FindSubstrInRange(str, start, length, strToFind, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_FindLast -- * * Finds the last occurrence of 'strToFind' inside 'str'. * * Results: * If 'strToFind' exists inside 'str', returns the last starting * index of 'strToFind' in that range. * * Otherwise, returns UNICODE_INDEX_NOT_FOUND. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE UnicodeIndex Unicode_FindLast(const char *str, // IN const char *strToFind) // IN { return Unicode_FindLastSubstrInRange(str, 0, -1, strToFind, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_FindLastFromIndex -- * * Finds the last occurrence of 'strToFind' inside 'str' in the range * [fromIndex, lengthOfStr). * * Results: * If 'strToFind' exists inside 'str' in the specified range, * returns the last starting index of 'strToFind' in that range. * * Otherwise, returns UNICODE_INDEX_NOT_FOUND. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE UnicodeIndex Unicode_FindLastFromIndex(const char *str, // IN const char *strToFind, // IN UnicodeIndex fromIndex) // IN { return Unicode_FindLastSubstrInRange(str, fromIndex, -1, strToFind, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_FindLastInRange -- * * Finds the last occurrence of 'strToFind' inside 'str' in the range * [start, start+length). * * Results: * If 'strToFind' exists inside 'str' in the specified range, * returns the last starting index of 'strToFind' in that range. * * Otherwise, returns UNICODE_INDEX_NOT_FOUND. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE UnicodeIndex Unicode_FindLastInRange(const char *str, // IN const char *strToFind, // IN UnicodeIndex start, // IN UnicodeIndex length) // IN { return Unicode_FindLastSubstrInRange(str, start, length, strToFind, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_Insert -- * * Allocates and returns a new copy of 'destination', with the * string 'source' inserted at the index 'destinationStart'. * * Results: * The newly-allocated string. Caller must free with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_Insert(const char *destination, // IN UnicodeIndex destinationStart, // IN const char *source) // IN { return Unicode_ReplaceRange(destination, destinationStart, 0, source, 0, -1); } /* *----------------------------------------------------------------------------- * * Unicode_InsertRange -- * * Allocates and returns a new copy of 'destination', with the * specified range of the string 'source' inserted at the index * 'destinationStart'. * * Results: * The newly-allocated string. Caller must free with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_InsertRange(const char *destination, UnicodeIndex destinationStart, const char *source, UnicodeIndex sourceStart, UnicodeIndex sourceLength) { return Unicode_ReplaceRange(destination, destinationStart, 0, source, sourceStart, sourceLength); } /* *----------------------------------------------------------------------------- * * Unicode_IsEqual -- * * Tests two strings for canonical equivalence. * * Results: * TRUE if the two strings are canonically equivalent, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool Unicode_IsEqual(const char *str1, // IN const char *str2) // IN { return Unicode_CompareRange(str1, 0, -1, str2, 0, -1, FALSE) == 0; } /* *----------------------------------------------------------------------------- * * Unicode_RemoveRange -- * * Allocates and returns a new string that contains a copy of * 'destination' with the code units in the range [start, start + length) * removed. * * Results: * The newly-allocated string. Caller must free with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_RemoveRange(const char *destination, UnicodeIndex start, UnicodeIndex length) { return Unicode_ReplaceRange(destination, start, length, "", 0, 0); } /* *----------------------------------------------------------------------------- * * Unicode_Replace -- * * Allocates and returns a new string that contains a copy of * 'destination' with the code units in the range * [destinationStart, destinarionStart + destinationLength) replaced * with 'source'. * * Results: * The newly-allocated string. Caller must free with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_Replace(const char *destination, UnicodeIndex destinationStart, UnicodeIndex destinationLength, const char *source) { return Unicode_ReplaceRange(destination, destinationStart, destinationLength, source, 0, -1); } /* *----------------------------------------------------------------------------- * * UnicodeStartsWith -- * Unicode_StartsWith -- * Unicode_StartsWithIgnoreCase -- * * Tests if 'str' starts with 'prefix'. * * Results: * TRUE if 'str' starts with 'prefix', FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool UnicodeStartsWith(const char *str, // IN: const char *prefix, // IN: Bool ignoreCase) // IN: { UnicodeIndex strLength = Unicode_LengthInCodePoints(str); UnicodeIndex prefixLength = Unicode_LengthInCodePoints(prefix); if (prefixLength > strLength) { return FALSE; } return Unicode_CompareRange(str, 0, prefixLength, prefix, 0, prefixLength, ignoreCase) == 0; } static INLINE Bool Unicode_StartsWith(const char *str, // IN const char *prefix) // IN { return UnicodeStartsWith(str, prefix, FALSE); } static INLINE Bool Unicode_StartsWithIgnoreCase(const char *str, // IN const char *prefix) // IN { return UnicodeStartsWith(str, prefix, TRUE); } /* *----------------------------------------------------------------------------- * * Unicode_Truncate -- * * Allocates and returns a new copy of 'str' truncated to the * specified length in code units. * * Results: * The newly-allocated truncated copy of 'str'. Caller must free * with free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_Truncate(const char *str, // IN UnicodeIndex length) // IN { return Unicode_Substr(str, 0, length); } #ifdef __cplusplus } #endif #endif // _UNICODE_OPERATIONS_H_ open-vm-tools-10.0.7-3227872/lib/include/dynbuf.h0000644000000000000000000001154212660700526017510 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * dynbuf.h -- * * Dynamic buffers */ #ifndef __DYNBUF_H__ # define __DYNBUF_H__ #include #include "vm_basic_types.h" #include "vm_assert.h" typedef struct DynBuf { char *data; size_t size; size_t allocated; } DynBuf; void DynBuf_Init(DynBuf *b); // OUT void DynBuf_Destroy(DynBuf *b); // IN void * DynBuf_AllocGet(DynBuf const *b); // IN void DynBuf_Attach(DynBuf *b, // IN size_t size, // IN void *data); // IN void * DynBuf_Detach(DynBuf *b); // IN/OUT Bool DynBuf_Enlarge(DynBuf *b, // IN/OUT size_t min_size); // IN Bool DynBuf_Append(DynBuf *b, // IN/OUT void const *data, // IN size_t size); // IN Bool DynBuf_Trim(DynBuf *b); // IN/OUT Bool DynBuf_Copy(DynBuf *src, // IN DynBuf *dest); // OUT void DynBuf_SafeInternalAppend(DynBuf *b, // IN/OUT void const *data, // IN size_t size, // IN char const *file, // IN unsigned int lineno); // IN #define DynBuf_SafeAppend(_buf, _data, _size) \ DynBuf_SafeInternalAppend(_buf, _data, _size, __FILE__, __LINE__) /* *----------------------------------------------------------------------------- * * DynBuf_Get -- * * Retrieve a pointer to the data contained in a dynamic buffer --hpreg * * Results: * The pointer to the data * * Side effects: * None * *----------------------------------------------------------------------------- */ #if defined(SWIG) static void * #else static INLINE void * #endif DynBuf_Get(DynBuf const *b) // IN { ASSERT(b); return b->data; } /* *----------------------------------------------------------------------------- * * DynBuf_GetSize -- * * Returns the current size of the dynamic buffer --hpreg * * Results: * The current size of the dynamic buffer * * Side effects: * None * *----------------------------------------------------------------------------- */ #if defined(SWIG) static size_t #else static INLINE size_t #endif DynBuf_GetSize(DynBuf const *b) // IN { ASSERT(b); return b->size; } /* *----------------------------------------------------------------------------- * * DynBuf_SetSize -- * * Set the current size of a dynamic buffer --hpreg * * Results: * None * * Side effects: * None * *----------------------------------------------------------------------------- */ #if defined(SWIG) static void #else static INLINE void #endif DynBuf_SetSize(DynBuf *b, // IN/OUT: size_t size) // IN { ASSERT(b); ASSERT(size <= b->allocated); b->size = size; } /* *----------------------------------------------------------------------------- * * DynBuf_GetAllocatedSize -- * * Returns the current allocated size of the dynamic buffer --hpreg * * Results: * The current allocated size of the dynamic buffer * * Side effects: * None * *----------------------------------------------------------------------------- */ #if defined(SWIG) static size_t #else static INLINE size_t #endif DynBuf_GetAllocatedSize(DynBuf const *b) // IN { ASSERT(b); return b->allocated; } /* *---------------------------------------------------------------------------- * * DynBuf_AppendString -- * * Append the string to the specified DynBuf object. Basically a * fancy strcat(). * * Results: * TRUE on success * FALSE on failure (not enough memory) * * * Side effects: * DynBuf may change its size or allocate additional memory. * *---------------------------------------------------------------------------- */ #if defined(SWIG) static Bool #else static INLINE Bool #endif DynBuf_AppendString(DynBuf *buf, // IN/OUT const char *string) // IN { /* * Make sure to copy the NULL. */ return DynBuf_Append(buf, string, strlen(string) + 1); } #endif /* __DYNBUF_H__ */ open-vm-tools-10.0.7-3227872/lib/include/rpcvmx.h0000644000000000000000000000523112660700526017536 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * rpcvmx.h -- * * Simple utility library (usable by guest drivers as well as userlevel * Tools code) that provides some useful VMX interaction capability, e.g. * logging to the VM's VMX log, querying config variables, etc. * * NB: This library is *NOT* threadsafe, so if you want to avoid * corrupting your log statements or other screwups, add your own * locking around calls to RpcVMX_Log. */ #ifndef _RPCVMX_H_ #define _RPCVMX_H_ #include #include "vm_basic_types.h" #define RPCVMX_MAX_LOG_LEN (2048) /* 2kb max - make it dynamic? */ /* * Set a prefix to prepend to any future log statements. */ void RpcVMX_LogSetPrefix(const char *prefix); /* * Get the currently set prefix (returns empty string if no prefix set) */ const char *RpcVMX_LogGetPrefix(const char *prefix); /* * Format the provided string with the provided arguments, and post it to the * VMX logfile via RPC. */ void RpcVMX_Log(const char *fmt, ...) PRINTF_DECL(1, 2); /* * Save as RpcVMX_Log but takes a va_list instead of inline arguments. */ void RpcVMX_LogV(const char *fmt, va_list args); /* * Get the value of "guestinfo.$key" in the host VMX dictionary and return it. * Returns the default if the key is not set. */ char *RpcVMX_ConfigGetString(const char *defval, const char *key); /* * Same as _ConfigGetString, but convert the value to a 32-bit quantity. * XXX Returns 0, *NOT* the default, if the key was set but the value could * not be converted to an int32. */ int32 RpcVMX_ConfigGetLong(int32 defval, const char *key); /* * Same as _ConfigGetString, but convert the value to a Bool. Returns the * default value if the key was set but could not be converted. */ Bool RpcVMX_ConfigGetBool(Bool defval, const char *key); #endif /* _VMXRPC_H_ */ open-vm-tools-10.0.7-3227872/lib/include/hgfsServerPolicy.h0000644000000000000000000001234712660700526021523 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _HGFS_SERVER_POLICY_H_ #define _HGFS_SERVER_POLICY_H_ #include "vm_basic_types.h" #include "hgfs.h" #include "dbllnklst.h" #include "cpName.h" #include "hgfsServer.h" /* * Name of share that corresponds to the root of the server's * filesystem. */ #define HGFS_SERVER_POLICY_ROOT_SHARE_NAME "root" typedef uint32 HgfsShareOptions; /* * Structure representing one shared folder. We maintain a list of * these to check accesses against. */ typedef struct HgfsSharedFolder { DblLnkLst_Links links; const char *name; /* Name of share */ const char *path; /* * Path of share in server's filesystem. Should * not include final path separator. */ const char *shareTags;/* Tags associated with this share (comma delimited). */ size_t shareTagsLen; /* Length of shareTag string */ size_t nameLen; /* Length of name string */ size_t pathLen; /* Length of path string */ Bool readAccess; /* Read permission for this share */ Bool writeAccess; /* Write permission for this share */ HgfsShareOptions configOptions; /* User-config options. */ HgfsSharedFolderHandle handle; /* Handle assigned by HGFS server * when the folder was registered with it. * Policy package keeps the context and returns * it along with other shared folder properties. * Keeping it here ensures consistent lookup all * properties of the shared folder which takes into * account such details like case sensitive/case * insensitive name lookup. */ } HgfsSharedFolder; /* Per share user configurable options. */ #define HGFS_SHARE_HOST_DEFAULT_CASE (1 << 0) #define HGFS_SHARE_FOLLOW_SYMLINKS (1 << 1) typedef struct HgfsServerPolicy_ShareList { size_t count; char **shareNames; } HgfsServerPolicy_ShareList; Bool HgfsServerPolicy_Init(HgfsInvalidateObjectsFunc invalidateObjects, HgfsRegisterSharedFolderFunc registerFolder, HgfsServerResEnumCallbacks *enumResources); Bool HgfsServerPolicy_Cleanup(void); HgfsNameStatus HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: size_t nameInLen, // IN: HgfsOpenMode mode, // IN: size_t *sharePathLen, // OUT: char const **sharePath); // OUT: HgfsNameStatus HgfsServerPolicy_GetShareMode(char const *nameIn, // IN: Share name to retrieve size_t nameInLen, // IN: Length of Share name HgfsOpenMode *mode); // OUT: Share's access mode HgfsNameStatus HgfsServerPolicy_GetShareOptions(char const *nameIn, // IN: Share name size_t nameInLen, // IN: Share name length HgfsShareOptions *configOptions); // OUT: Share config options Bool HgfsServerPolicy_IsShareOptionSet(HgfsShareOptions shareOptions, // IN: Config options uint32 option); // IN: Option to check HgfsNameStatus HgfsServerPolicy_ProcessCPName(char const *nameIn, // IN: name in CPName form size_t nameInLen, // IN: length of the name Bool *readAccess, // OUT: Read permissions Bool *writeAccess, // OUT: Write permissions HgfsSharedFolderHandle *handle,// OUT: folder handle char const **shareBaseDir); // OUT: Shared directory void HgfsServerPolicy_FreeShareList(HgfsServerPolicy_ShareList *shareList); // IN: list to free HgfsServerPolicy_ShareList * HgfsServerPolicy_GetSharesWithTag(const char *tag); // IN: tag to search for Bool HgfsServerPolicy_CheckMode(HgfsOpenMode mode, // IN: mode to check Bool writePermissions, // IN: callers write permissions Bool readPermissions); // IN: callers read permissions #endif // _HGFS_SERVER_POLICY_H_ open-vm-tools-10.0.7-3227872/lib/include/hostinfo.h0000644000000000000000000001562512660700526020060 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hostinfo.h -- * * Interface to host-specific information functions * */ #if !defined(_HOSTINFO_H_) #define _HOSTINFO_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_basic_defs.h" #include "x86cpuid.h" #include "unicodeTypes.h" typedef enum { HOSTINFO_PROCESS_QUERY_DEAD, // Procss is dead (does not exist) HOSTINFO_PROCESS_QUERY_ALIVE, // Process is alive (does exist) HOSTINFO_PROCESS_QUERY_UNKNOWN // Process existence cannot be determined } HostinfoProcessQuery; HostinfoProcessQuery Hostinfo_QueryProcessExistence(int pid); char *Hostinfo_NameGet(void); /* don't free result */ char *Hostinfo_HostName(void); /* free result */ void Hostinfo_MachineID(uint32 *hostNameHash, uint64 *hostHardwareID); Bool Hostinfo_GetMemoryInfoInPages(unsigned int *minSize, unsigned int *maxSize, unsigned int *currentSize); #ifdef __linux__ Bool Hostinfo_GetSwapInfoInPages(unsigned int *totalSwap, unsigned int *freeSwap); #endif Bool Hostinfo_GetRatedCpuMhz(int32 cpuNumber, uint32 *mHz); char *Hostinfo_GetCpuDescription(uint32 cpuNumber); void Hostinfo_GetTimeOfDay(VmTimeType *time); VmTimeType Hostinfo_SystemUpTime(void); VmTimeType Hostinfo_SystemTimerNS(void); static INLINE VmTimeType Hostinfo_SystemTimerUS(void) { return Hostinfo_SystemTimerNS() / 1000ULL; } static INLINE VmTimeType Hostinfo_SystemTimerMS(void) { return Hostinfo_SystemTimerNS() / 1000000ULL; } int Hostinfo_OSVersion(unsigned int i); int Hostinfo_GetSystemBitness(void); const char *Hostinfo_OSVersionString(void); char *Hostinfo_GetOSName(void); char *Hostinfo_GetOSGuestString(void); Bool Hostinfo_OSIsSMP(void); #if defined(_WIN32) Bool Hostinfo_OSIsWinNT(void); Bool Hostinfo_OSIsWow64(void); Bool Hostinfo_TSCInvariant(void); DWORD Hostinfo_OpenProcessBits(void); DWORD Hostinfo_OpenThreadBits(void); #else void Hostinfo_ResetProcessState(const int *keepFds, size_t numKeepFds); int Hostinfo_Execute(const char *path, char * const *args, Bool wait, const int *keepFds, size_t numKeepFds); typedef enum HostinfoDaemonizeFlags { HOSTINFO_DAEMONIZE_DEFAULT = 0, HOSTINFO_DAEMONIZE_NOCHDIR = (1 << 0), HOSTINFO_DAEMONIZE_NOCLOSE = (1 << 1), HOSTINFO_DAEMONIZE_EXIT = (1 << 2), HOSTINFO_DAEMONIZE_LOCKPID = (1 << 3), } HostinfoDaemonizeFlags; Bool Hostinfo_Daemonize(const char *path, char * const *args, HostinfoDaemonizeFlags flags, const char *pidPath, const int *keepFds, size_t numKeepFds); #endif Bool Hostinfo_NestingSupported(void); Bool Hostinfo_VCPUInfoBackdoor(unsigned bit); Bool Hostinfo_SLC64Supported(void); Bool Hostinfo_SynchronizedVTSCs(void); Bool Hostinfo_NestedHVReplaySupported(void); Bool Hostinfo_TouchBackDoor(void); Bool Hostinfo_TouchVirtualPC(void); Bool Hostinfo_TouchXen(void); char *Hostinfo_HypervisorCPUIDSig(void); #define HGMP_PRIVILEGE 0 #define HGMP_NO_PRIVILEGE 1 char *Hostinfo_GetModulePath(uint32 priv); char *Hostinfo_GetLibraryPath(void *addr); char *Hostinfo_GetUser(void); void Hostinfo_LogMemUsage(void); /* * HostInfoCpuIdInfo -- * * Contains cpuid information for a CPU. */ typedef struct { CpuidVendor vendor; uint32 version; uint8 family; uint8 model; uint8 stepping; uint8 type; uint32 features; uint32 extfeatures; } HostinfoCpuIdInfo; uint32 Hostinfo_NumCPUs(void); char *Hostinfo_GetCpuidStr(void); Bool Hostinfo_GetCpuid(HostinfoCpuIdInfo *info); #if !defined(VMX86_SERVER) Bool Hostinfo_CPUCounts(uint32 *logical, uint32 *cores, uint32 *pkgs); #endif #if defined(_WIN32) typedef enum { OS_WIN95 = 1, OS_WIN98 = 2, OS_WINME = 3, OS_WINNT = 4, OS_WIN2K = 5, OS_WINXP = 6, OS_WIN2K3 = 7, OS_VISTA = 8, OS_WINSEVEN = 9, OS_WIN8 = 10, OS_WIN10 = 11, OS_UNKNOWN = 99999 // last, highest value } OS_TYPE; typedef enum { OS_DETAIL_WIN95 = 1, OS_DETAIL_WIN98 = 2, OS_DETAIL_WINME = 3, OS_DETAIL_WINNT = 4, OS_DETAIL_WIN2K = 5, OS_DETAIL_WIN2K_PRO = 6, OS_DETAIL_WIN2K_SERV = 7, OS_DETAIL_WIN2K_ADV_SERV = 8, OS_DETAIL_WINXP = 9, OS_DETAIL_WINXP_HOME = 10, OS_DETAIL_WINXP_PRO = 11, OS_DETAIL_WINXP_X64_PRO = 12, OS_DETAIL_WIN2K3 = 13, OS_DETAIL_WIN2K3_WEB = 14, OS_DETAIL_WIN2K3_ST = 15, OS_DETAIL_WIN2K3_EN = 16, OS_DETAIL_WIN2K3_BUS = 17, OS_DETAIL_VISTA = 18, OS_DETAIL_WIN2K8 = 19, OS_DETAIL_WINSEVEN = 20, OS_DETAIL_WIN2K8R2 = 21, OS_DETAIL_WIN8 = 22, OS_DETAIL_WIN8SERVER = 23, OS_DETAIL_WIN10 = 24, OS_DETAIL_WIN10SERVER = 25, OS_DETAIL_UNKNOWN = 99999 // last, highest value } OS_DETAIL_TYPE; /* generic names (to protect the future) but Windows specific for now */ OS_TYPE Hostinfo_GetOSType(void); OS_DETAIL_TYPE Hostinfo_GetOSDetailType(void); Bool Hostinfo_GetPCFrequency(uint64 *pcHz); Bool Hostinfo_GetMhzOfProcessor(int32 processorNumber, uint32 *currentMhz, uint32 *maxMhz); uint64 Hostinfo_SystemIdleTime(void); Bool Hostinfo_GetAllCpuid(CPUIDQuery *query); static INLINE Bool Hostinfo_AtLeastVista(void) { return (Hostinfo_GetOSType() >= OS_VISTA); } #endif void Hostinfo_LogLoadAverage(void); Bool Hostinfo_GetLoadAverage(uint32 *l); #ifdef __APPLE__ size_t Hostinfo_GetKernelZoneElemSize(char const *name); char *Hostinfo_GetHardwareModel(void); #endif #endif /* ifndef _HOSTINFO_H_ */ open-vm-tools-10.0.7-3227872/lib/include/unicodeBase.h0000644000000000000000000002326212660700526020444 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * unicodeBase.h -- * * Basic Unicode string creation and encoding conversion. */ #ifndef _UNICODE_BASE_H_ #define _UNICODE_BASE_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #ifdef __cplusplus extern "C" { #endif #include #include #include "util.h" #include "unicodeTypes.h" #define UNICODE_SUBSTITUTION_CHAR "\xEF\xBF\xBD" /* * Unescapes \\uABCD in string literals to Unicode code point * U+ABCD, and \\U001FABCD to Unicode code point U+1FABCD. * * The resulting string is never freed, so this is not to be used for * general runtime Unicode string creation. * * Use to replace: * * const char *utf8Copyright = "Copyright \302\251 COMPANY_NAME"; * * with: * * const char *copyright = U_UNESCAPE("Copyright \\u00A9 COMPANY_NAME"); */ #define U_UNESCAPE(x) Unicode_GetStatic(x, TRUE) /* * In contexts where an errno makes sense, use this * to report conversion failure. */ #ifndef _WIN32 #define UNICODE_CONVERSION_ERRNO EINVAL #endif /* * Allocates a Unicode string given a buffer of the specified length * (not necessarily NUL-terminated) in the specified encoding. * * Returns NULL if the buffer was invalid or memory could not be * allocated. */ char *Unicode_AllocWithLength(const void *buffer, ssize_t lengthInBytes, StringEncoding encoding); /* *----------------------------------------------------------------------------- * * Unicode_Alloc -- * * Allocates a new Unicode string given a NUL-terminated buffer * of bytes in the specified string encoding. * * If buffer is NULL, then NULL is returned. * * Note that regardless of the encoding of the buffer passed to this * function, the returned string can hold any Unicode characters. * * Results: * An allocated Unicode string containing the decoded characters * in buffer, or NULL if input is NULL. Caller must pass to * free to free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_Alloc(const void *buffer, // IN StringEncoding encoding) // IN { return Unicode_AllocWithLength(buffer, -1, encoding); } /* *----------------------------------------------------------------------------- * * Unicode_AllocWithUTF8 -- * * Allocates a new Unicode string given a NUL-terminated UTF-8 string. * * If utf8String is NULL, then NULL is returned. * * Results: * An allocated Unicode string containing the characters in * utf8String, or NULL if utf8String is NULL. Caller must pass to * free to free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_AllocWithUTF8(const char *utf8String) // IN { return Unicode_AllocWithLength(utf8String, -1, STRING_ENCODING_UTF8); } /* *----------------------------------------------------------------------------- * * Unicode_AllocWithUTF16 -- * * Allocates a new Unicode string given a NUL-terminated UTF-16 * string in host-endian order. * * If utf16String is NULL, then NULL is returned. * * Results: * An allocated Unicode string containing the characters in * utf16String, or NULL if utf16String is NULL. Caller must pass to * free to free. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * Unicode_AllocWithUTF16(const utf16_t *utf16String) // IN { return Unicode_AllocWithLength(utf16String, -1, STRING_ENCODING_UTF16); } char *Unicode_Duplicate(const char *str); char **Unicode_AllocList(char **srcList, ssize_t length, StringEncoding encoding); char **Unicode_GetAllocList(char *const srcList[], ssize_t length, StringEncoding encoding); /* *----------------------------------------------------------------------------- * * Unicode_AllocListWithUTF16 -- * * Allocates a list (actually a vector) of Unicode strings from a list * (vector) of UTF-16 strings. The input list has a specified length or * can be an argv-style NULL-terminated list (if length is negative). * * Results: * An allocated list (vector) of Unicode strings. * The result must be freed with Util_FreeStringList. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char ** Unicode_AllocListWithUTF16(utf16_t **utf16list, // IN: ssize_t length) // IN: { return Unicode_AllocList((char **) utf16list, length, STRING_ENCODING_UTF16); } /* * Compute the number of bytes in a string. */ ssize_t Unicode_LengthInBytes(const void *buffer, StringEncoding encoding); /* * Gets the number of UTF-16 code units in the NUL-terminated UTF-16 array. */ ssize_t Unicode_UTF16Strlen(const utf16_t *utf16); /* * Duplicates a UTF-16 string. */ utf16_t *Unicode_UTF16Strdup(const utf16_t *utf16); /* * Tests if the buffer's bytes are valid in the specified encoding. */ Bool Unicode_IsBufferValid(const void *buffer, ssize_t lengthInBytes, StringEncoding encoding); /* * Tests if the buffer's unicode contents can be converted to the * specified encoding. */ Bool Unicode_CanGetBytesWithEncoding(const char *ustr, StringEncoding encoding); /* * Escape non-printable bytes of the buffer with \xAB, where 0xAB * is the non-printable byte value. */ char *Unicode_EscapeBuffer(const void *buffer, ssize_t lengthInBytes, StringEncoding encoding); /* * Returns the length in number of native code units (UTF-8 bytes or * UTF-16 words) of the string. */ UnicodeIndex Unicode_LengthInCodeUnits(const char *str); /* *----------------------------------------------------------------------------- * * Unicode_IsEmpty -- * * Test if the Unicode string is empty. * * Results: * TRUE if the string has length 0, FALSE otherwise. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool Unicode_IsEmpty(const char *str) // IN: { ASSERT(str != NULL); return str[0] == '\0'; } /* * Efficiently returns the upper bound on the number of bytes required * to encode the Unicode string in the specified encoding, including * NUL termination. */ size_t Unicode_BytesRequired(const char *str, StringEncoding encoding); /* * Extracts the contents of the Unicode string into a NUL-terminated * buffer using the specified encoding. Copies at most * maxLengthInBytes including NUL termination. Returns FALSE if * truncation occurred, TRUE otherwise. If retLength is not NULL, * *retLength holds the number of bytes actually copied, not including * the NUL termination, upon return. */ Bool Unicode_CopyBytes(void *destBuffer, const char *srcBuffer, size_t maxLengthInBytes, size_t *retLength, StringEncoding encoding); void *Unicode_GetAllocBytes(const char *str, StringEncoding encoding); void *Unicode_GetAllocBytesWithLength(const char *str, StringEncoding encoding, ssize_t lengthInBytes); /* *----------------------------------------------------------------------------- * * Unicode_GetAllocUTF16 -- * * Allocates and returns a NUL terminated buffer into which the contents * of the unicode string are extracted using the (host native) UTF-16 * encoding. (Note that UTF-16 NUL is two bytes: "\0\0".) * * NULL is returned for NULL argument. * * Results: * Pointer to the dynamically allocated memory, * or NULL on NULL argument. * * Caller is responsible to free the memory allocated by this routine. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE utf16_t * Unicode_GetAllocUTF16(const char *str) // IN: { /* Cast for compatibility with C++ compilers. */ return (utf16_t *) Unicode_GetAllocBytes(str, STRING_ENCODING_UTF16); } /* * Helper function for Unicode string literal macros. */ const char *Unicode_GetStatic(const char *asciiBytes, Bool unescape); /* * Helper macros for Win32 Unicode string transition. */ #if defined(_WIN32) #define UNICODE_GET_UTF16(s) Unicode_GetAllocUTF16(s) #define UNICODE_RELEASE_UTF16(s) free((utf16_t *)s) #endif #ifdef __cplusplus } #endif #endif // _UNICODE_BASE_H_ open-vm-tools-10.0.7-3227872/lib/include/timeutil.h0000644000000000000000000000770612660700526020064 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * timeutil.h -- * * Miscellaneous time related utility functions. * */ #ifndef _TIMEUTIL_H_ #define _TIMEUTIL_H_ #include #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_basic_defs.h" #include "vm_assert.h" #define MAX_DAYSLEFT 4096 struct timeval; #ifdef _WIN32 struct timespec { time_t tv_sec; long tv_nsec; }; #endif /* Similar to a struct tm but with slightly less weird semantics. */ typedef struct TimeUtil_Date { unsigned int year; /* e.g. 1970 */ unsigned int month; /* [1, 12] */ unsigned int day; /* [1, 31] */ unsigned int hour; /* [0, 23] */ unsigned int minute; /* [0, 59] */ unsigned int second; /* [0, 61] (for leap seconds) */ } TimeUtil_Date; typedef struct TimeUtil_TimeOfDay { unsigned long seconds; unsigned long useconds; } TimeUtil_TimeOfDay; typedef struct TimeUtil_Expiration { /* * Does it expire? */ Bool expires; /* * When does it expire? (valid only if 'expires' == TRUE) * * Note: TimeUtil_Expiration only uses the 'year', 'month' * and 'day' fields of 'when'. */ TimeUtil_Date when; /* * Compute this once for all, to avoid problems when the current day changes * (valid only if 'expires' == TRUE). */ unsigned int daysLeft; } TimeUtil_Expiration; time_t TimeUtil_MakeTime(const TimeUtil_Date *d); // IN Bool TimeUtil_StringToDate(TimeUtil_Date *d, // IN/OUT char const *date); // IN: 'YYYYMMDD' or 'YYYY/MM/DD' or 'YYYY-MM-DD' Bool TimeUtil_DaysSubtract(TimeUtil_Date *d, // IN/OUT unsigned int nr); // IN int TimeUtil_DeltaDays(TimeUtil_Date const *left, // IN TimeUtil_Date const *right); // IN void TimeUtil_DaysAdd(TimeUtil_Date *d, // IN/OUT unsigned int nr); // IN void TimeUtil_PopulateWithCurrent(Bool local, // IN TimeUtil_Date *d); // OUT void TimeUtil_GetTimeOfDay(TimeUtil_TimeOfDay *d); // OUT unsigned int TimeUtil_DaysLeft(TimeUtil_Date const *d); // IN Bool TimeUtil_ExpirationLowerThan(TimeUtil_Expiration const *left, // IN TimeUtil_Expiration const *right); // IN Bool TimeUtil_DateLowerThan(TimeUtil_Date const *left, // IN TimeUtil_Date const *right); // IN void TimeUtil_ProductExpiration(TimeUtil_Expiration *e); // OUT char * TimeUtil_GetTimeFormat(int64 utcTime, // IN Bool showDate, // IN Bool showTime); // IN int TimeUtil_NtTimeToUnixTime(struct timespec *unixTime, // OUT VmTimeType ntTime); // IN VmTimeType TimeUtil_UnixTimeToNtTime(struct timespec unixTime); // IN #ifdef _WIN32 Bool TimeUtil_UTCTimeToSystemTime(const __time64_t utcTime, // IN SYSTEMTIME *systemTime); // OUT #endif int TimeUtil_GetLocalWindowsTimeZoneIndexAndName(char **ptzName); time_t TimeUtil_SecondsSinceEpoch(TimeUtil_Date *d); // IN #endif // _TIMEUTIL_H_ open-vm-tools-10.0.7-3227872/lib/include/err.h0000644000000000000000000000554312660700526017015 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * err.h -- * * General error handling library */ #ifndef _ERR_H_ #define _ERR_H_ #if !defined(_WIN32) #include #endif #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #if defined(__cplusplus) extern "C" { #endif #if defined(_WIN32) typedef DWORD Err_Number; #else typedef int Err_Number; #endif #define ERR_INVALID ((Err_Number) -1) const char *Err_ErrString(void); const char *Err_Errno2String(Err_Number errorNumber); Err_Number Err_String2Errno(const char *string); #ifdef VMX86_DEBUG Err_Number Err_String2ErrnoDebug(const char *string); #endif #if defined(_WIN32) char *Err_SanitizeMessage(const char *msg); #endif /* *---------------------------------------------------------------------- * * Err_Errno -- * * Gets last error in a platform independent way. * * Results: * Last error. * * Side effects: * None. * *---------------------------------------------------------------------- */ #if defined(_WIN32) #define Err_Errno() GetLastError() #else #define Err_Errno() errno #endif /* *---------------------------------------------------------------------- * * Err_SetErrno -- * * Set the last error in a platform independent way. * * Results: * None. * * Side effects: * Yes. * *---------------------------------------------------------------------- */ #if defined(_WIN32) #define Err_SetErrno(e) SetLastError(e) #else #define Err_SetErrno(e) (errno = (e)) #endif /* *---------------------------------------------------------------------- * * WITH_ERRNO -- * * Execute "body" with "e" bound to the last error number * and preserving the last error in surrounding code. * * Results: * None. * * Side effects: * Yes. * *---------------------------------------------------------------------- */ #define WITH_ERRNO(e, body) do { \ Err_Number e = Err_Errno(); \ body; \ Err_SetErrno(e); \ } while (FALSE) #ifdef __cplusplus } #endif #endif open-vm-tools-10.0.7-3227872/lib/include/loglevel_user.h0000644000000000000000000002137512660700526021075 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _LOGLEVEL_USER_H_ #define _LOGLEVEL_USER_H_ #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #define LOGLEVEL_EXTENSION user #include "loglevel_defs.h" #define LOGLEVEL_USER(LOGLEVEL_VAR) \ /* user/main*/ \ /* main has to be first. */ \ LOGLEVEL_VAR(main), \ LOGLEVEL_VAR(aio), \ LOGLEVEL_VAR(passthrough), \ LOGLEVEL_VAR(tools), \ LOGLEVEL_VAR(license), \ LOGLEVEL_VAR(vui), \ LOGLEVEL_VAR(stats), \ LOGLEVEL_VAR(cpucount), \ LOGLEVEL_VAR(ovhdmem), \ LOGLEVEL_VAR(vigor), \ \ /* user/io */ \ LOGLEVEL_VAR(disk), \ LOGLEVEL_VAR(keyboard), \ LOGLEVEL_VAR(vmmouse), \ LOGLEVEL_VAR(timer), \ LOGLEVEL_VAR(vga), \ LOGLEVEL_VAR(svga), \ LOGLEVEL_VAR(svga_rect), \ LOGLEVEL_VAR(enableDetTimer), \ LOGLEVEL_VAR(dma), \ LOGLEVEL_VAR(floppy), \ LOGLEVEL_VAR(cmos), \ LOGLEVEL_VAR(vlance), \ LOGLEVEL_VAR(e1000), \ LOGLEVEL_VAR(serial), \ LOGLEVEL_VAR(parallel), \ LOGLEVEL_VAR(chipset), \ LOGLEVEL_VAR(smram), \ LOGLEVEL_VAR(smc), \ LOGLEVEL_VAR(ich7m), \ LOGLEVEL_VAR(hpet), \ LOGLEVEL_VAR(extcfgdevice), \ LOGLEVEL_VAR(flashram), \ LOGLEVEL_VAR(efinv), \ LOGLEVEL_VAR(pvnvram), \ LOGLEVEL_VAR(pci), \ LOGLEVEL_VAR(pci_vide), \ LOGLEVEL_VAR(pci_uhci), \ LOGLEVEL_VAR(uhci), \ LOGLEVEL_VAR(pci_ehci), \ LOGLEVEL_VAR(ehci), \ LOGLEVEL_VAR(pci_xhci), \ LOGLEVEL_VAR(usb_xhci), \ LOGLEVEL_VAR(usb), \ LOGLEVEL_VAR(vusbmouse), \ LOGLEVEL_VAR(vusbkeyboard), \ LOGLEVEL_VAR(vusbhid), \ LOGLEVEL_VAR(vusbtablet), \ LOGLEVEL_VAR(vusbaudio), \ LOGLEVEL_VAR(vusbvideo),\ LOGLEVEL_VAR(hidQueue), \ LOGLEVEL_VAR(pci_vlance), \ LOGLEVEL_VAR(pci_svga), \ LOGLEVEL_VAR(pci_e1000), \ LOGLEVEL_VAR(pci_hyper), \ LOGLEVEL_VAR(pcibridge), \ LOGLEVEL_VAR(vide), \ LOGLEVEL_VAR(atapiCdrom), \ LOGLEVEL_VAR(hostonly), \ LOGLEVEL_VAR(oprom), \ LOGLEVEL_VAR(http), \ LOGLEVEL_VAR(vmci), \ LOGLEVEL_VAR(pci_vmci), \ LOGLEVEL_VAR(vmxnet3), \ LOGLEVEL_VAR(pci_vmxnet3), \ LOGLEVEL_VAR(vcpuhotplug), \ LOGLEVEL_VAR(vcpuNUMA), \ LOGLEVEL_VAR(heci), \ LOGLEVEL_VAR(pciplugin), \ LOGLEVEL_VAR(vsock), \ LOGLEVEL_VAR(vrdma), \ LOGLEVEL_VAR(nvdimm), \ \ /* user/disk */ \ LOGLEVEL_VAR(aioMgr), \ LOGLEVEL_VAR(aioWin32), \ LOGLEVEL_VAR(aioWin32Completion), \ LOGLEVEL_VAR(aioLinux), \ LOGLEVEL_VAR(aioHttp), \ LOGLEVEL_VAR(aioGeneric), \ LOGLEVEL_VAR(cdrom), \ LOGLEVEL_VAR(checksum), \ \ /* user/checkpoint */ \ LOGLEVEL_VAR(checkpoint), \ LOGLEVEL_VAR(dumper), \ LOGLEVEL_VAR(migrate), \ LOGLEVEL_VAR(fsresx), \ \ /* user/gui */ \ LOGLEVEL_VAR(gui), \ LOGLEVEL_VAR(guiWin32), \ LOGLEVEL_VAR(mks), \ LOGLEVEL_VAR(mksInput), \ LOGLEVEL_VAR(mksSWB), \ LOGLEVEL_VAR(mksClient), \ LOGLEVEL_VAR(mksServer), \ LOGLEVEL_VAR(mksKeyboard), \ LOGLEVEL_VAR(keymap), \ LOGLEVEL_VAR(mksMouse), \ LOGLEVEL_VAR(mksHostCursor), \ LOGLEVEL_VAR(mksCursorPosition), \ LOGLEVEL_VAR(mksBasicOps), \ LOGLEVEL_VAR(mksRenderOps), \ LOGLEVEL_VAR(mksGLBasic), \ LOGLEVEL_VAR(mksGLManager), \ LOGLEVEL_VAR(mksGLFBO), \ LOGLEVEL_VAR(mksGLShader), \ LOGLEVEL_VAR(mksGLState), \ LOGLEVEL_VAR(mksGLWindow), \ LOGLEVEL_VAR(mksGLContextMux), \ LOGLEVEL_VAR(mksGLDraw), \ LOGLEVEL_VAR(mksGLQuery), \ LOGLEVEL_VAR(mksGLTextureView), \ LOGLEVEL_VAR(mksWinBSOD), \ LOGLEVEL_VAR(mksDX11Renderer), \ LOGLEVEL_VAR(mksDX11ResourceView), \ LOGLEVEL_VAR(mksDX11ShimOps), \ LOGLEVEL_VAR(vdpPlugin), \ \ /* user/sound */ \ LOGLEVEL_VAR(sound), \ LOGLEVEL_VAR(hdaudio), \ LOGLEVEL_VAR(pci_hdaudio), \ LOGLEVEL_VAR(hdaudio_alsa), \ \ /* user video */ \ LOGLEVEL_VAR(AVCapture), \ \ /* user/disklib */ \ LOGLEVEL_VAR(disklib), \ LOGLEVEL_VAR(dmg), \ LOGLEVEL_VAR(sparseChecker), \ LOGLEVEL_VAR(dataCache), \ /* more */ \ LOGLEVEL_VAR(dict), \ LOGLEVEL_VAR(pci_scsi), \ LOGLEVEL_VAR(scsi), \ LOGLEVEL_VAR(grm), \ LOGLEVEL_VAR(vmxnet), \ LOGLEVEL_VAR(pciPassthru), \ LOGLEVEL_VAR(vnet), \ LOGLEVEL_VAR(netPkt), \ LOGLEVEL_VAR(macfilter), \ LOGLEVEL_VAR(macbw), \ LOGLEVEL_VAR(macfi), \ LOGLEVEL_VAR(vmkcfg), \ LOGLEVEL_VAR(policy), \ LOGLEVEL_VAR(poll), \ LOGLEVEL_VAR(barrier), \ LOGLEVEL_VAR(mstat), \ LOGLEVEL_VAR(vmLock), \ LOGLEVEL_VAR(buslogic), \ LOGLEVEL_VAR(lsilogic), \ LOGLEVEL_VAR(pvscsi), \ LOGLEVEL_VAR(ahci), \ LOGLEVEL_VAR(diskVmnix), \ LOGLEVEL_VAR(hbaCommon), \ LOGLEVEL_VAR(backdoor), \ LOGLEVEL_VAR(buslogicMdev), \ LOGLEVEL_VAR(hgfs), \ LOGLEVEL_VAR(memspace), \ LOGLEVEL_VAR(dnd), \ LOGLEVEL_VAR(appstate), \ LOGLEVEL_VAR(vthread), \ LOGLEVEL_VAR(vmhs), \ LOGLEVEL_VAR(undopoint), \ LOGLEVEL_VAR(ipc), \ LOGLEVEL_VAR(smbios), \ LOGLEVEL_VAR(acpi), \ LOGLEVEL_VAR(acpiGPE), \ LOGLEVEL_VAR(vmgenc), \ LOGLEVEL_VAR(xpmode), \ LOGLEVEL_VAR(snapshot), \ LOGLEVEL_VAR(asyncsocket), \ LOGLEVEL_VAR(mainMem), \ LOGLEVEL_VAR(mainMemReplayCheck), \ LOGLEVEL_VAR(memoryHotplug), \ LOGLEVEL_VAR(numa), \ LOGLEVEL_VAR(numaHost), \ LOGLEVEL_VAR(remoteDevice), \ LOGLEVEL_VAR(vncDecode), \ LOGLEVEL_VAR(vncEncode), \ LOGLEVEL_VAR(libconnect), \ LOGLEVEL_VAR(state3d), \ LOGLEVEL_VAR(vmGL), \ LOGLEVEL_VAR(guest_msg), \ LOGLEVEL_VAR(guest_rpc), \ LOGLEVEL_VAR(guestVars), \ LOGLEVEL_VAR(vmkEvent), \ LOGLEVEL_VAR(battery), \ LOGLEVEL_VAR(fakeDma), \ LOGLEVEL_VAR(shader), \ LOGLEVEL_VAR(machPoll), \ LOGLEVEL_VAR(replayVMX), \ LOGLEVEL_VAR(vmWindowController), \ LOGLEVEL_VAR(dui), \ LOGLEVEL_VAR(duiMKS), \ LOGLEVEL_VAR(worker), \ LOGLEVEL_VAR(duiDevices), \ LOGLEVEL_VAR(duiLocalization), \ LOGLEVEL_VAR(duiProxyApps), \ LOGLEVEL_VAR(docker), \ LOGLEVEL_VAR(vmIPC), \ LOGLEVEL_VAR(uwt), /* lib/unityWindowTracker */ \ LOGLEVEL_VAR(cui), \ LOGLEVEL_VAR(automation), \ LOGLEVEL_VAR(oemDevice), \ LOGLEVEL_VAR(cptOps), \ LOGLEVEL_VAR(vprobe), \ LOGLEVEL_VAR(VProbeClient), \ LOGLEVEL_VAR(device), \ LOGLEVEL_VAR(devicePowerOn), \ LOGLEVEL_VAR(vmxvmdbCallbacks), \ LOGLEVEL_VAR(guestInstall), \ LOGLEVEL_VAR(migrateVM), \ LOGLEVEL_VAR(vmUpsellController), \ LOGLEVEL_VAR(objc), /* lib/objc */ \ LOGLEVEL_VAR(blit), /* lib/blit */ \ LOGLEVEL_VAR(vmnetBridge), \ LOGLEVEL_VAR(wifi), /* macWireless and wpa_supplicant */ \ LOGLEVEL_VAR(pvfslib), \ LOGLEVEL_VAR(brtalk), \ LOGLEVEL_VAR(button), \ LOGLEVEL_VAR(util), \ LOGLEVEL_VAR(vmcf), \ LOGLEVEL_VAR(win32util), \ LOGLEVEL_VAR(largepage), \ LOGLEVEL_VAR(guestAppMonitor), \ LOGLEVEL_VAR(syncWaitQ), \ LOGLEVEL_VAR(sg), /* lib/sg */ \ LOGLEVEL_VAR(ftcpt), \ LOGLEVEL_VAR(wrapLib), \ LOGLEVEL_VAR(digestlib), \ LOGLEVEL_VAR(inputdevtap), \ LOGLEVEL_VAR(objlib), \ LOGLEVEL_VAR(vsanobj), \ LOGLEVEL_VAR(vvolbe), \ LOGLEVEL_VAR(svgadevtap), \ LOGLEVEL_VAR(masReceipt), /* lib/masReceipt */ \ LOGLEVEL_VAR(serviceImpl), /* lib/serviceImpl */ \ LOGLEVEL_VAR(serviceUser), /* lib/serviceUser */ \ LOGLEVEL_VAR(ssl), \ LOGLEVEL_VAR(namespaceDb), \ LOGLEVEL_VAR(namespaceMgr), \ LOGLEVEL_VAR(grainTrack), \ LOGLEVEL_VAR(shim3D), \ LOGLEVEL_VAR(crc32), \ LOGLEVEL_VAR(vmkmgmtlib), \ LOGLEVEL_VAR(vflash), \ LOGLEVEL_VAR(vva), /* apps/rde/vva */ \ LOGLEVEL_VAR(ftConfig), /*lib/ftConfig */ \ LOGLEVEL_VAR(vmname), /* lib/vmname */ \ LOGLEVEL_VAR(gpumgmt), \ LOGLEVEL_VAR(unityMsg), /* mks/remote/vdpUnityVmdb */ \ LOGLEVEL_VAR(sharedFolderMgr), /* mks/remote/vdpFolderSharedMgrVmdb */ \ LOGLEVEL_VAR(crtbora), /* apps/crtbora */ \ LOGLEVEL_VAR(mirror), \ LOGLEVEL_VAR(filtlib), \ LOGLEVEL_VAR(epd), \ LOGLEVEL_VAR(ddecomd), \ LOGLEVEL_VAR(hostctl), \ LOGLEVEL_VAR(pmemobj), \ /* end of list */ LOGLEVEL_EXTENSION_DECLARE(LOGLEVEL_USER); #endif /* _LOGLEVEL_USER_H_ */ open-vm-tools-10.0.7-3227872/lib/include/clamped.h0000644000000000000000000001713312660700526017630 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * clamped.h -- * * Clamped arithmetic. This header file provides inline * arithmetic operations that don't overflow. Instead, they * saturate at the data type's max or min value. */ #ifndef _CLAMPED_H_ #define _CLAMPED_H_ #include "vm_basic_types.h" #include "vm_assert.h" /* *----------------------------------------------------------------------------- * * Clamped_U64To32 -- * * Convert unsigned 64-bit to 32-bit, clamping instead of truncating. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_UINT32, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_U64To32(uint32 *out, // OUT uint64 a) // IN { uint32 clamped = (uint32)a; if (UNLIKELY(a != clamped)) { *out = MAX_UINT32; return FALSE; } *out = clamped; return TRUE; } /* *----------------------------------------------------------------------------- * * Clamped_S64To32 -- * * Convert signed 64-bit to 32-bit, clamping instead of truncating. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_INT32 or MIN_INT32, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_S64To32(int32 *out, // OUT int64 a) // IN { int32 clamped = (int32)a; if (UNLIKELY(a != clamped)) { *out = a < 0 ? MIN_INT32 : MAX_INT32; return FALSE; } *out = clamped; return TRUE; } /* *---------------------------------------------------------------------- * * Clamped_SAdd32 -- * * Signed 32-bit addition. * * Add two integers, clamping the result to MAX_INT32 or * MIN_INT32 if it would have overflowed. * * Results: * On success, returns TRUE. * If the result would have overflowed and we clamped it, returns FALSE. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE Bool Clamped_SAdd32(int32 *out, // OUT int32 a, // IN int32 b) // IN { return Clamped_S64To32(out, (int64)a + b); } /* *----------------------------------------------------------------------------- * * Clamped_UMul32 -- * * Unsigned 32-bit multiplication. * * We're abusing the fact that 32x32-bit multiplication always * returns a 64-bit result on x86 anyway, and that the compiler * should be smart enough to optimize the code here into a * 32x32-bit multiply. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_UINT32, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_UMul32(uint32 *out, // OUT uint32 a, // IN uint32 b) // IN { return Clamped_U64To32(out, (uint64)a * b); } /* *----------------------------------------------------------------------------- * * Clamped_SMul32 -- * * Signed 32-bit multiplication. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_INT32 or MIN_INT32, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_SMul32(int32 *out, // OUT int32 a, // IN int32 b) // IN { return Clamped_S64To32(out, (int64)a * b); } /* *----------------------------------------------------------------------------- * * Clamped_UAdd32 -- * * Unsigned 32-bit addition. * * This is a utility function for 32-bit unsigned addition, * in which the result is clamped to MAX_UINT32 on overflow. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_UINT32, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_UAdd32(uint32 *out, // OUT uint32 a, // IN uint32 b) // IN { uint32 c = a + b; if (UNLIKELY(c < a || c < b)) { *out = MAX_UINT32; return FALSE; } *out = c; return TRUE; } /* *----------------------------------------------------------------------------- * * Clamped_UAdd64 -- * * Unsigned 64-bit addition. * * This is a utility function for 64-bit unsigned addition, * in which the result is clamped to MAX_UINT64 on overflow. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_UINT64, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_UAdd64(uint64 *out, // OUT uint64 a, // IN uint64 b) // IN { uint64 c = a + b; if(UNLIKELY(c < a || c < b)) { *out = MAX_UINT64; return FALSE; } *out = c; return TRUE; } /* *----------------------------------------------------------------------------- * * Clamped_URoundUpBits32 -- * * Round up an unsigned 32-bit number by the specified number * of bits. Clamp to MAX_UINT32 on overflow. * * Results: * On success, returns TRUE. If the result would have overflowed * and we clamped it to MAX_UINT32, returns FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool Clamped_URoundUpBits32(uint32 *out, // OUT uint32 x, // IN uint32 bits) // IN { uint32 mask = (1 << bits) - 1; uint32 c = (x + mask) & ~mask; ASSERT(bits < sizeof(uint32) * 8); if (UNLIKELY(x + mask < x)) { *out = MAX_UINT32; return FALSE; } *out = c; return TRUE; } #endif // ifndef _CLAMPED_H_ open-vm-tools-10.0.7-3227872/lib/include/x86cpuid_asm.h0000644000000000000000000002313312660700526020532 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * x86cpuid_asm.h * * CPUID-related assembly functions. */ #ifndef _X86CPUID_ASM_H_ #define _X86CPUID_ASM_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_asm.h" #include "x86cpuid.h" /* * x86-64 windows doesn't support inline asm so we have to use these * intrinsic functions defined in the compiler. Not all of these are well * documented. There is an array in the compiler dll (c1.dll) which has * an array of the names of all the intrinsics minus the leading * underscore. Searching around in the ntddk.h file can also be helpful. * * The declarations for the intrinsic functions were taken from the DDK. * Our declarations must match the ddk's otherwise the 64-bit c++ compiler * will complain about second linkage of the intrinsic functions. * We define the intrinsic using the basic types corresponding to the * Windows typedefs. This avoids having to include windows header files * to get to the windows types. */ #ifdef _MSC_VER #ifdef __cplusplus extern "C" { #endif #ifdef VM_X86_64 /* * intrinsic functions only supported by x86-64 windows as of 2k3sp1 */ void __cpuid(int regs[4], int eax); #pragma intrinsic(__cpuid) #endif /* VM_X86_64 */ #ifdef __cplusplus } #endif #endif /* _MSC_VER */ #ifdef __GNUC__ // { /* * Checked against the Intel manual and GCC --hpreg * * Need __volatile__ and "memory" since CPUID has a synchronizing effect. * The CPUID may also change at runtime (APIC flag, etc). * */ /* * %ebx is reserved on i386 PIC. Apple's gcc-5493 (gcc 4.0) compiling * for x86_64 incorrectly errors out saying %ebx is reserved. This is * Apple bug 7304232. */ #if vm_x86_64 ? (defined __APPLE_CC__ && __APPLE_CC__ == 5493) : defined __PIC__ #if vm_x86_64 /* * Note that this generates movq %rbx,%rbx; cpuid; xchgq %rbx,%rbx ... * Unfortunately Apple's assembler does not have .ifnes, and I cannot * figure out how to do that with .if. If we ever enable this code * on other 64bit systems, both movq & xchgq should be surrounded by * .ifnes \"%%rbx\", \"%q1\" & .endif */ #define VM_CPUID_BLOCK "movq %%rbx, %q1\n\t" \ "cpuid\n\t" \ "xchgq %%rbx, %q1\n\t" #define VM_EBX_OUT(reg) "=&r"(reg) #else #define VM_CPUID_BLOCK "movl %%ebx, %1\n\t" \ "cpuid\n\t" \ "xchgl %%ebx, %1\n\t" #define VM_EBX_OUT(reg) "=&rm"(reg) #endif #else #define VM_CPUID_BLOCK "cpuid" #define VM_EBX_OUT(reg) "=b"(reg) #endif static INLINE void __GET_CPUID(int eax, // IN CPUIDRegs *regs) // OUT { __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (regs->eax), VM_EBX_OUT(regs->ebx), "=c" (regs->ecx), "=d" (regs->edx) : "a" (eax) : "memory" ); } static INLINE void __GET_CPUID2(int eax, // IN int ecx, // IN CPUIDRegs *regs) // OUT { __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (regs->eax), VM_EBX_OUT(regs->ebx), "=c" (regs->ecx), "=d" (regs->edx) : "a" (eax), "c" (ecx) : "memory" ); } static INLINE uint32 __GET_EAX_FROM_CPUID(int eax) // IN { uint32 ebx; __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (eax), VM_EBX_OUT(ebx) : "a" (eax) : "memory", "%ecx", "%edx" ); return eax; } static INLINE uint32 __GET_EBX_FROM_CPUID(int eax) // IN { uint32 ebx; __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (eax), VM_EBX_OUT(ebx) : "a" (eax) : "memory", "%ecx", "%edx" ); return ebx; } static INLINE uint32 __GET_ECX_FROM_CPUID(int eax) // IN { uint32 ecx; uint32 ebx; __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (eax), VM_EBX_OUT(ebx), "=c" (ecx) : "a" (eax) : "memory", "%edx" ); return ecx; } static INLINE uint32 __GET_EDX_FROM_CPUID(int eax) // IN { uint32 edx; uint32 ebx; __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (eax), VM_EBX_OUT(ebx), "=d" (edx) : "a" (eax) : "memory", "%ecx" ); return edx; } static INLINE uint32 __GET_EAX_FROM_CPUID4(int ecx) // IN { uint32 eax; uint32 ebx; __asm__ __volatile__( VM_CPUID_BLOCK : "=a" (eax), VM_EBX_OUT(ebx), "=c" (ecx) : "a" (4), "c" (ecx) : "memory", "%edx" ); return eax; } #undef VM_CPUID_BLOCK #undef VM_EBX_OUT #elif defined(_MSC_VER) // } { static INLINE void __GET_CPUID(int input, CPUIDRegs *regs) { #ifdef VM_X86_64 __cpuid((int *)regs, input); #else __asm push esi __asm push ebx __asm push ecx __asm push edx __asm mov eax, input __asm mov esi, regs __asm _emit 0x0f __asm _emit 0xa2 __asm mov 0x0[esi], eax __asm mov 0x4[esi], ebx __asm mov 0x8[esi], ecx __asm mov 0xC[esi], edx __asm pop edx __asm pop ecx __asm pop ebx __asm pop esi #endif } #ifdef VM_X86_64 /* * No inline assembly in Win64. Implemented in bora/lib/misc in * cpuidMasm64.asm. */ extern void __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs); #else // VM_X86_64 static INLINE void __GET_CPUID2(int inputEax, int inputEcx, CPUIDRegs *regs) { __asm push esi __asm push ebx __asm push ecx __asm push edx __asm mov eax, inputEax __asm mov ecx, inputEcx __asm mov esi, regs __asm _emit 0x0f __asm _emit 0xa2 __asm mov 0x0[esi], eax __asm mov 0x4[esi], ebx __asm mov 0x8[esi], ecx __asm mov 0xC[esi], edx __asm pop edx __asm pop ecx __asm pop ebx __asm pop esi } #endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) { #ifdef VM_X86_64 CPUIDRegs regs; __cpuid((int *)®s, input); return regs.eax; #else uint32 output; //NOT_TESTED(); __asm push ebx __asm push ecx __asm push edx __asm mov eax, input __asm _emit 0x0f __asm _emit 0xa2 __asm mov output, eax __asm pop edx __asm pop ecx __asm pop ebx return output; #endif } static INLINE uint32 __GET_EBX_FROM_CPUID(int input) { #ifdef VM_X86_64 CPUIDRegs regs; __cpuid((int *)®s, input); return regs.ebx; #else uint32 output; //NOT_TESTED(); __asm push ebx __asm push ecx __asm push edx __asm mov eax, input __asm _emit 0x0f __asm _emit 0xa2 __asm mov output, ebx __asm pop edx __asm pop ecx __asm pop ebx return output; #endif } static INLINE uint32 __GET_ECX_FROM_CPUID(int input) { #ifdef VM_X86_64 CPUIDRegs regs; __cpuid((int *)®s, input); return regs.ecx; #else uint32 output; //NOT_TESTED(); __asm push ebx __asm push ecx __asm push edx __asm mov eax, input __asm _emit 0x0f __asm _emit 0xa2 __asm mov output, ecx __asm pop edx __asm pop ecx __asm pop ebx return output; #endif } static INLINE uint32 __GET_EDX_FROM_CPUID(int input) { #ifdef VM_X86_64 CPUIDRegs regs; __cpuid((int *)®s, input); return regs.edx; #else uint32 output; //NOT_TESTED(); __asm push ebx __asm push ecx __asm push edx __asm mov eax, input __asm _emit 0x0f __asm _emit 0xa2 __asm mov output, edx __asm pop edx __asm pop ecx __asm pop ebx return output; #endif } #ifdef VM_X86_64 /* * No inline assembly in Win64. Implemented in bora/lib/misc in * cpuidMasm64.asm. */ extern uint32 __GET_EAX_FROM_CPUID4(int inputEcx); #else // VM_X86_64 static INLINE uint32 __GET_EAX_FROM_CPUID4(int inputEcx) { uint32 output; //NOT_TESTED(); __asm push ebx __asm push ecx __asm push edx __asm mov eax, 4 __asm mov ecx, inputEcx __asm _emit 0x0f __asm _emit 0xa2 __asm mov output, eax __asm pop edx __asm pop ecx __asm pop ebx return output; } #endif // VM_X86_64 #else // } #error #endif #define CPUID_FOR_SIDE_EFFECTS() ((void)__GET_EAX_FROM_CPUID(0)) /* The first parameter is used as an rvalue and then as an lvalue. */ #define GET_CPUID(_ax, _bx, _cx, _dx) { \ CPUIDRegs regs; \ __GET_CPUID(_ax, ®s); \ _ax = regs.eax; \ _bx = regs.ebx; \ _cx = regs.ecx; \ _dx = regs.edx; \ } #endif open-vm-tools-10.0.7-3227872/lib/include/deployPkg/0000755000000000000000000000000012660700526020003 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/include/deployPkg/linuxDeployment.h0000644000000000000000000000365112660700526023361 0ustar rootroot/********************************************************* * Copyright (C) 2009 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * linuxDeployment.h : C interface to package deployment */ #ifndef LINUX_DEPLOYMENT_H #define LINUX_DEPLOYMENT_H #include "vm_basic_types.h" #include "imgcust-common/log.h" #include "imgcust-common/imgcust-api.h" /** * Give the deploy package an application specific logger. * * @param logger [in] logger to be used for deploy operation */ IMGCUST_API void DeployPkg_SetLogger(LogFunction log); /** * C-style wrapper to decode a package from a file, extract its payload, * expand the payload into a temporary directory, and then execute * the command specified in the package. * * @param file IN: the package file * @return 0 on success */ IMGCUST_API int DeployPkg_DeployPackageFromFile(const char* file); /** * C-style wrapper to extract a package from a file using libmspack. * * @param[in] cabFileName the Cabinet file's path * @param[in] destDir a destination directory where to uncab * * @return TRUE on success, otherwise - FALSE. */ IMGCUST_API Bool ExtractCabPackage(const char* cabFileName, const char* destDir); #endif // LINUX_DEPLOYMENT_H open-vm-tools-10.0.7-3227872/lib/include/su.h0000644000000000000000000000672412660700526016656 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * su.h -- * * Manage super-user priviledges * */ #ifndef USER_SU_H #define USER_SU_H #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_assert.h" #if defined(__APPLE__) #include #include int Id_SetGid(gid_t egid); int Id_SetREUid(uid_t ruid, uid_t euid); int Id_SetRESUid(uid_t ruid, uid_t euid, uid_t suid); #define Id_GetEUid() geteuid() void *Id_AuthGetLocal(); void *Id_AuthGetExternal(size_t *size); Bool Id_AuthSet(void const *buf, size_t size); Bool Id_AuthCheck(char const *right, char const *localizedDescription, Bool showDialogIfNeeded); #elif (defined(__linux__) || defined(sun) || defined(__FreeBSD__)) #include #include /* Our set of set*id functions which affect current thread only */ int Id_SetUid(uid_t euid); int Id_SetGid(gid_t egid); int Id_SetREUid(uid_t ruid, uid_t euid); int Id_SetREGid(gid_t rgid, gid_t egid); int Id_SetRESUid(uid_t ruid, uid_t euid, uid_t suid); int Id_SetRESGid(gid_t rgid, gid_t egid, gid_t sgid); /* For symmetry */ #define Id_GetEUid() geteuid() /* *---------------------------------------------------------------------------- * * Id_SetEUid -- * * Set specified effective uid for current thread. Does not affect * real uid or saved uid. * * Results: * 0 on success, -1 on failure, errno set * * Side effects: * errno may be modified on success * *---------------------------------------------------------------------------- */ static INLINE int Id_SetEUid(uid_t euid) { return Id_SetRESUid((uid_t)-1, euid, (uid_t)-1); } /* *---------------------------------------------------------------------------- * * Id_SetEGid -- * * Set specified effective gid for current thread. Does not affect * real gid or saved gid. * * Results: * 0 on success, -1 on failure, errno set * * Side effects: * errno may be modified on success * *---------------------------------------------------------------------------- */ static INLINE int Id_SetEGid(gid_t egid) { return Id_SetRESGid((gid_t)-1, egid, (gid_t)-1); } #endif /* linux */ #if defined(_WIN32) static INLINE int Id_BeginSuperUser(void) { return -1; } static INLINE void Id_EndSuperUser(int id) { } static INLINE Bool Id_IsSuperUser(void) { return TRUE; } static INLINE Bool Id_IsSetUGid(void) { return FALSE; } #else static INLINE Bool Id_IsSuperUser(void) { return 0 == geteuid(); } uid_t Id_BeginSuperUser(void); void Id_EndSuperUser(uid_t uid); Bool Id_IsSetUGid(void); #endif #endif /* USER_SU_H */ open-vm-tools-10.0.7-3227872/lib/include/compat/0000755000000000000000000000000012660700526017330 5ustar rootrootopen-vm-tools-10.0.7-3227872/lib/include/compat/compat_stdarg.h0000644000000000000000000000452212660700526022333 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * compat_stdarg.h -- * * Compatibility defines for systems that need the stdarg features. If your program * needs va_init, va_copy, va_end, etc. then include this file instead of including * stdarg.h directly. */ #ifndef _COMPAT_STDARG_H #define _COMPAT_STDARG_H 1 #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMKDRIVERS #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include #if !defined(va_copy) # if defined(__va_copy) # define va_copy __va_copy # elif defined(_WIN32) # define va_copy(ap1, ap2) (*(ap1) = *(ap2)) # elif defined(VA_LIST_IS_ARRAY) # define va_copy(ap1, ap2) memcpy(ap1, ap2, sizeof(va_list)) # else # define va_copy(ap1, ap2) ((ap1) = (ap2)) # endif #endif #endif /* _COMPAT_STDARG_H */ open-vm-tools-10.0.7-3227872/lib/include/asyncsocket.h0000644000000000000000000004236412660700525020554 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #ifndef __ASYNC_SOCKET_H__ #define __ASYNC_SOCKET_H__ /* * asyncsocket.h -- * * The AsyncSocket object is a fairly simple wrapper around a basic TCP * socket. It's potentially asynchronous for both read and write * operations. Reads are "requested" by registering a receive function * that is called once the requested amount of data has been read from * the socket. Similarly, writes are queued along with a send function * that is called once the data has been written. Errors are reported via * a separate callback. */ #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" /* * Error codes */ #define ASOCKERR_SUCCESS 0 #define ASOCKERR_GENERIC 1 #define ASOCKERR_TIMEOUT 2 #define ASOCKERR_NOTCONNECTED 3 #define ASOCKERR_REMOTE_DISCONNECT 4 #define ASOCKERR_INVAL 5 #define ASOCKERR_CONNECT 6 #define ASOCKERR_ACCEPT 7 #define ASOCKERR_POLL 8 #define ASOCKERR_CLOSED 9 #define ASOCKERR_BIND 10 #define ASOCKERR_BINDADDRINUSE 11 #define ASOCKERR_LISTEN 12 #define ASOCKERR_CONNECTSSL 13 /* * Websocket close status codes -- * * enum has numbers in names because RFC6455 refers to the numbers frequently. */ enum { WEB_SOCKET_CLOSE_STATUS_1000_NORMAL = 1000, WEB_SOCKET_CLOSE_STATUS_1001_GOING_AWAY = 1001, WEB_SOCKET_CLOSE_STATUS_1002_PROTOCOL_ERROR = 1002, WEB_SOCKET_CLOSE_STATUS_1003_INVALID_DATA = 1003, WEB_SOCKET_CLOSE_STATUS_1005_EMPTY = 1005, WEB_SOCKET_CLOSE_STATUS_1006_ABNORMAL = 1006, WEB_SOCKET_CLOSE_STATUS_1007_INCONSISTENT_DATA = 1007, WEB_SOCKET_CLOSE_STATUS_1008_POLICY_VIOLATION = 1008, WEB_SOCKET_CLOSE_STATUS_1009_MESSAGE_TOO_BIG = 1009, WEB_SOCKET_CLOSE_STATUS_1010_UNSUPPORTED_EXTENSIONS = 1010, WEB_SOCKET_CLOSE_STATUS_1015_TLS_HANDSHAKE_ERROR = 1015, }; /* * Flags passed into AsyncSocket_Connect*(). * Default value is '0'. * The first two flags allow explicitly selecting * an ESX network stack. They no longer make sense because the * COS is gone. The flags are left around just to ensure we don't have * any flag collisions from users of the library. * The 3rd is for code that uses inet_pton() to get an IP address. * inet_pton() returns address in network-byte-order, * instead of the expected host-byte-order. */ typedef enum { // ASOCKCONN_USE_ESX_SHADOW_STACK = 1<<0, // ASOCKCONN_USE_ESX_NATIVE_STACK = 1<<1, ASOCKCONN_ADDR_IN_NETWORK_BYTE_ORDER = 1<<2 } AsyncSocketConnectFlags; /* * SSL opaque type declarations (so we don't have to include ssl.h) */ struct SSLSockStruct; struct _SSLVerifyParam; /* * AsyncSocket type is opaque */ typedef struct AsyncSocket AsyncSocket; /* * AsyncSocket registers poll callbacks, so give client the opportunity * to control how this is done. * * All the AsyncSocket constructors (Listen, Connect, Attach) take an * optional AsyncSocketPollParam* argument; if NULL the default behavior is * used (callback is registered in POLL_CS_MAIN and locked by the BULL). * Or the client can specify its favorite poll class and locking behavior. * Use of IVmdbPoll is only supported for regular sockets and for Attach. */ #include "poll.h" struct IVmdbPoll; typedef struct AsyncSocketPollParams { int flags; /* Default 0, only POLL_FLAG_NO_BULL is valid */ MXUserRecLock *lock; /* Default: none but BULL */ PollClassSet pollClass; /* Default is POLL_CS_MAIN */ struct IVmdbPoll *iPoll; /* Default NULL: use Poll_Callback */ } AsyncSocketPollParams; /* * Initialize platform libraries */ int AsyncSocket_Init(void); /* * Check the current state of the socket */ typedef enum AsyncSocketState { AsyncSocketListening, AsyncSocketConnecting, AsyncSocketConnected, AsyncSocketCBCancelled, AsyncSocketClosed, } AsyncSocketState; AsyncSocketState AsyncSocket_GetState(AsyncSocket *sock); const char * AsyncSocket_Err2String(int err); const char * AsyncSocket_MsgError(int asyncSockErr); int AsyncSocket_GetGenericErrno(AsyncSocket *s); /* * Return a "unique" ID */ int AsyncSocket_GetID(AsyncSocket *asock); /* * Return the fd corresponding to the socket. */ int AsyncSocket_GetFd(AsyncSocket *asock); /* * Return the remote IP address associated with this socket if applicable */ int AsyncSocket_GetRemoteIPStr(AsyncSocket *asock, const char **ipStr); int AsyncSocket_GetLocalVMCIAddress(AsyncSocket *asock, uint32 *cid, uint32 *port); int AsyncSocket_GetRemoteVMCIAddress(AsyncSocket *asock, uint32 *cid, uint32 *port); int AsyncSocket_GetINETIPStr(AsyncSocket *asock, int socketFamily, char **ipRetStr); unsigned int AsyncSocket_GetPort(AsyncSocket *asock); /* * Recv callback fires once previously requested data has been received */ typedef void (*AsyncSocketRecvFn) (void *buf, int len, AsyncSocket *asock, void *clientData); /* * Send callback fires once previously queued data has been sent */ typedef void (*AsyncSocketSendFn) (void *buf, int len, AsyncSocket *asock, void *clientData); /* * Error callback fires on I/O errors during read/write operations */ typedef void (*AsyncSocketErrorFn) (int error, AsyncSocket *asock, void *clientData); typedef void (*AsyncSocketConnectFn) (AsyncSocket *asock, void *clientData); typedef void (*AsyncSocketSslAcceptFn) (Bool status, AsyncSocket *asock, void *clientData); /* * Listen on port and fire callback with new asock */ AsyncSocket *AsyncSocket_Listen(const char *addrStr, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, int *outError); AsyncSocket *AsyncSocket_ListenLoopback(unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, int *outError); AsyncSocket *AsyncSocket_ListenVMCI(unsigned int cid, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, int *outError); #ifndef VMX86_TOOLS AsyncSocket *AsyncSocket_ListenWebSocket(const char *addrStr, unsigned int port, Bool useSSL, const char *protocols[], AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, int *outError); #ifndef _WIN32 AsyncSocket *AsyncSocket_ListenWebSocketUDS(const char *pipeName, Bool useSSL, const char *protocols[], AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketPollParams *pollParams, int *outError); #endif #endif /* * Connect to address:port and fire callback with new asock */ AsyncSocket *AsyncSocket_Connect(const char *hostname, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *error); AsyncSocket *AsyncSocket_ConnectVMCI(unsigned int cid, unsigned int port, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *error); #ifndef _WIN32 AsyncSocket *AsyncSocket_ConnectUnixDomain(const char *path, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *error); #else AsyncSocket * AsyncSocket_ConnectNamedPipe(char *pipeName, AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *outError); #endif #ifndef VMX86_TOOLS AsyncSocket * AsyncSocket_ConnectWebSocket(const char *url, struct _SSLVerifyParam *sslVerifyParam, const char *cookies, const char *protocols[], AsyncSocketConnectFn connectFn, void *clientData, AsyncSocketConnectFlags flags, AsyncSocketPollParams *pollParams, int *error); #endif #ifndef USE_SSL_DIRECT /* * Initiate SSL connection on existing asock, with optional cert verification */ Bool AsyncSocket_ConnectSSL(AsyncSocket *asock, struct _SSLVerifyParam *verifyParam, void *sslContext); Bool AsyncSocket_AcceptSSL(AsyncSocket *asock); #endif void AsyncSocket_StartSslAccept(AsyncSocket *asock, void *sslCtx, AsyncSocketSslAcceptFn sslAcceptFn, void *clientData); /* * Create a new AsyncSocket from an existing socket */ AsyncSocket *AsyncSocket_AttachToFd(int fd, AsyncSocketPollParams *pollParams, int *error); AsyncSocket *AsyncSocket_AttachToSSLSock(struct SSLSockStruct *sslSock, AsyncSocketPollParams *pollParams, int *error); /* * Enable or disable TCP_NODELAY on this AsyncSocket. */ int AsyncSocket_UseNodelay(AsyncSocket *asock, Bool nodelay); /* * Set TCP timeout values on this AsyncSocket. */ #ifdef VMX86_SERVER int AsyncSocket_SetTCPTimeouts(AsyncSocket *asock, int keepIdle, int keepIntvl, int keepCnt); #endif /* * Waits until at least one packet is received or times out. */ int AsyncSocket_DoOneMsg(AsyncSocket *s, Bool read, int timeoutMS); /* * Waits until at least one connect() is accept()ed or times out. */ int AsyncSocket_WaitForConnection(AsyncSocket *s, int timeoutMS); /* * Send all pending packets onto the wire or give up after timeoutMS msecs. */ int AsyncSocket_Flush(AsyncSocket *asock, int timeoutMS); /* * Specify the exact amount of data to receive and the receive function to call. */ int AsyncSocket_Recv(AsyncSocket *asock, void *buf, int len, void *cb, void *cbData); /* * Specify the maximum amount of data to receive and the receive function to call. */ int AsyncSocket_RecvPartial(AsyncSocket *asock, void *buf, int len, void *cb, void *cbData); /* * Specify the amount of data to receive and the receive function to call. */ int AsyncSocket_RecvPassedFd(AsyncSocket *asock, void *buf, int len, void *cb, void *cbData); /* * Retrieve socket received via RecvPassedFd. */ int AsyncSocket_GetReceivedFd(AsyncSocket *asock); /* * Specify the amount of data to send/receive and how long to wait before giving * up. */ int AsyncSocket_RecvBlocking(AsyncSocket *asock, void *buf, int len, int *received, int timeoutMS); int AsyncSocket_RecvPartialBlocking(AsyncSocket *asock, void *buf, int len, int *received, int timeoutMS); int AsyncSocket_SendBlocking(AsyncSocket *asock, void *buf, int len, int *sent, int timeoutMS); /* * Specify the amount of data to send and the send function to call */ int AsyncSocket_Send(AsyncSocket *asock, void *buf, int len, AsyncSocketSendFn sendFn, void *clientData); int AsyncSocket_IsSendBufferFull(AsyncSocket *asock); int AsyncSocket_CancelRecv(AsyncSocket *asock, int *partialRecvd, void **recvBuf, void **recvFn); int AsyncSocket_CancelRecvEx(AsyncSocket *asock, int *partialRecvd, void **recvBuf, void **recvFn, Bool cancelOnSend); /* * Unregister asynchronous send and recv from poll */ void AsyncSocket_CancelCbForClose(AsyncSocket *asock); /* * Set the error handler to invoke on I/O errors (default is to close the * socket) */ int AsyncSocket_SetErrorFn(AsyncSocket *asock, AsyncSocketErrorFn errorFn, void *clientData); /* * Set socket level recv/send buffer sizes if they are less than given sizes. */ Bool AsyncSocket_SetBufferSizes(AsyncSocket *asock, // IN int sendSz, // IN int recvSz); // IN /* * Close the connection and destroy the asock. */ int AsyncSocket_Close(AsyncSocket *asock); #ifndef VMX86_TOOLS /* * Retrieve the URI Supplied for a websocket connection */ char *AsyncSocket_GetWebSocketURI(AsyncSocket *asock); /* * Retrieve the Cookie Supplied for a websocket connection */ char *AsyncSocket_GetWebSocketCookie(AsyncSocket *asock); #endif /* * Retrieve the close status, if received, for a websocket connection */ uint16 AsyncSocket_GetWebSocketCloseStatus(const AsyncSocket *asock); /* * Set low-latency mode for sends: */ void AsyncSocket_SetSendLowLatencyMode(AsyncSocket *asock, Bool enable); /* * Get negotiated websocket protocol */ const char *AsyncSocket_GetWebSocketProtocol(AsyncSocket *asock); const char * stristr(const char *s, const char *find); /* * Some logging macros for convenience */ #define ASOCKPREFIX "SOCKET " #define ASOCKWARN(_asock, _warnargs) \ do { \ Warning(ASOCKPREFIX "%d (%d) ", \ AsyncSocket_GetID(_asock), AsyncSocket_GetFd(_asock)); \ Warning _warnargs; \ } while (0) #define ASOCKLG0(_asock, _logargs) \ do { \ Log(ASOCKPREFIX "%d (%d) ", \ AsyncSocket_GetID(_asock), AsyncSocket_GetFd(_asock)); \ Log _logargs; \ } while (0) #define ASOCKLOG(_level, _asock, _logargs) \ do { \ if (((_level) == 0) || DOLOG_BYNAME(asyncsocket, (_level))) { \ Log(ASOCKPREFIX "%d (%d) ", \ AsyncSocket_GetID((_asock)), AsyncSocket_GetFd(_asock)); \ Log _logargs; \ } \ } while(0) #endif // __ASYNC_SOCKET_H__ open-vm-tools-10.0.7-3227872/lib/include/unicodeTypes.h0000644000000000000000000003303312660700526020673 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * unicodeTypes.h -- * * Types used throughout the Unicode library. */ #ifndef _UNICODE_TYPES_H_ #define _UNICODE_TYPES_H_ #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #ifdef __cplusplus extern "C" { #endif #include "vm_basic_types.h" #include "vm_assert.h" typedef ssize_t UnicodeIndex; /* * Special UnicodeIndex value returned when a string is not found. */ enum { UNICODE_INDEX_NOT_FOUND = -1 }; /* * Encodings passed to convert encoded byte strings to and from * Unicode. * * Keep this enum synchronized with ICU_ENCODING_LIST in unicodeICU.cc! */ typedef enum { STRING_ENCODING_FIRST, /* * Byte string encodings that support all characters in Unicode. * * If you don't know what to use for bytes in a new system, use * STRING_ENCODING_UTF8. */ STRING_ENCODING_UTF8 = STRING_ENCODING_FIRST, STRING_ENCODING_UTF16_LE, // Little-endian UTF-16. STRING_ENCODING_UTF16_BE, // Big-endian UTF-16. STRING_ENCODING_UTF16_XE, // UTF-16 with BOM. STRING_ENCODING_UTF32_LE, // Little-endian UTF-32. STRING_ENCODING_UTF32_BE, // Big-endian UTF-32. STRING_ENCODING_UTF32_XE, // UTF-32 with BOM. /* * Legacy byte string encodings that only support a subset of Unicode. */ /* * Latin encodings */ STRING_ENCODING_US_ASCII, STRING_ENCODING_ISO_8859_1, STRING_ENCODING_ISO_8859_2, STRING_ENCODING_ISO_8859_3, STRING_ENCODING_ISO_8859_4, STRING_ENCODING_ISO_8859_5, STRING_ENCODING_ISO_8859_6, STRING_ENCODING_ISO_8859_7, STRING_ENCODING_ISO_8859_8, STRING_ENCODING_ISO_8859_9, STRING_ENCODING_ISO_8859_10, // ISO-8859-11 is unused. // Oddly, there is no ISO-8859-12. STRING_ENCODING_ISO_8859_13, STRING_ENCODING_ISO_8859_14, STRING_ENCODING_ISO_8859_15, /* * Chinese encodings */ STRING_ENCODING_GB_18030, STRING_ENCODING_BIG_5, STRING_ENCODING_BIG_5_HK, STRING_ENCODING_GBK, STRING_ENCODING_GB_2312, STRING_ENCODING_ISO_2022_CN, /* * Japanese encodings */ STRING_ENCODING_SHIFT_JIS, STRING_ENCODING_EUC_JP, STRING_ENCODING_ISO_2022_JP, STRING_ENCODING_ISO_2022_JP_1, STRING_ENCODING_ISO_2022_JP_2, /* * Korean encodings */ STRING_ENCODING_ISO_2022_KR, /* * Windows encodings */ STRING_ENCODING_WINDOWS_1250, STRING_ENCODING_WINDOWS_1251, STRING_ENCODING_WINDOWS_1252, STRING_ENCODING_WINDOWS_1253, STRING_ENCODING_WINDOWS_1254, STRING_ENCODING_WINDOWS_1255, STRING_ENCODING_WINDOWS_1256, STRING_ENCODING_WINDOWS_1257, STRING_ENCODING_WINDOWS_1258, STRING_ENCODING_ISO_6937_2_ADD, STRING_ENCODING_JIS_X0201, STRING_ENCODING_JIS_ENCODING, STRING_ENCODING_EXTENDED_UNIX_CODE_FIXED_WIDTH_FOR_JAPANESE, STRING_ENCODING_BS_4730, STRING_ENCODING_SEN_850200_C, STRING_ENCODING_IT, STRING_ENCODING_ES, STRING_ENCODING_DIN_66003, STRING_ENCODING_NS_4551_1, STRING_ENCODING_NF_Z_62_010, STRING_ENCODING_ISO_10646_UTF_1, STRING_ENCODING_ISO_646_BASIC_1983, STRING_ENCODING_INVARIANT, STRING_ENCODING_ISO_646_IRV_1983, STRING_ENCODING_NATS_SEFI, STRING_ENCODING_NATS_SEFI_ADD, STRING_ENCODING_NATS_DANO, STRING_ENCODING_NATS_DANO_ADD, STRING_ENCODING_SEN_850200_B, STRING_ENCODING_KS_C_5601_1987, STRING_ENCODING_JIS_C6220_1969_JP, STRING_ENCODING_JIS_C6220_1969_RO, STRING_ENCODING_PT, STRING_ENCODING_GREEK7_OLD, STRING_ENCODING_LATIN_GREEK, STRING_ENCODING_NF_Z_62_010__1973_, STRING_ENCODING_LATIN_GREEK_1, STRING_ENCODING_ISO_5427, STRING_ENCODING_JIS_C6226_1978, STRING_ENCODING_BS_VIEWDATA, STRING_ENCODING_INIS, STRING_ENCODING_INIS_8, STRING_ENCODING_INIS_CYRILLIC, STRING_ENCODING_ISO_5427_1981, STRING_ENCODING_ISO_5428_1980, STRING_ENCODING_GB_1988_80, STRING_ENCODING_GB_2312_80, STRING_ENCODING_NS_4551_2, STRING_ENCODING_VIDEOTEX_SUPPL, STRING_ENCODING_PT2, STRING_ENCODING_ES2, STRING_ENCODING_MSZ_7795_3, STRING_ENCODING_JIS_C6226_1983, STRING_ENCODING_GREEK7, STRING_ENCODING_ASMO_449, STRING_ENCODING_ISO_IR_90, STRING_ENCODING_JIS_C6229_1984_A, STRING_ENCODING_JIS_C6229_1984_B, STRING_ENCODING_JIS_C6229_1984_B_ADD, STRING_ENCODING_JIS_C6229_1984_HAND, STRING_ENCODING_JIS_C6229_1984_HAND_ADD, STRING_ENCODING_JIS_C6229_1984_KANA, STRING_ENCODING_ISO_2033_1983, STRING_ENCODING_ANSI_X3_110_1983, STRING_ENCODING_T_61_7BIT, STRING_ENCODING_T_61_8BIT, STRING_ENCODING_ECMA_CYRILLIC, STRING_ENCODING_CSA_Z243_4_1985_1, STRING_ENCODING_CSA_Z243_4_1985_2, STRING_ENCODING_CSA_Z243_4_1985_GR, STRING_ENCODING_ISO_8859_6_E, STRING_ENCODING_ISO_8859_6_I, STRING_ENCODING_T_101_G2, STRING_ENCODING_ISO_8859_8_E, STRING_ENCODING_ISO_8859_8_I, STRING_ENCODING_CSN_369103, STRING_ENCODING_JUS_I_B1_002, STRING_ENCODING_IEC_P27_1, STRING_ENCODING_JUS_I_B1_003_SERB, STRING_ENCODING_JUS_I_B1_003_MAC, STRING_ENCODING_GREEK_CCITT, STRING_ENCODING_NC_NC00_10_81, STRING_ENCODING_ISO_6937_2_25, STRING_ENCODING_GOST_19768_74, STRING_ENCODING_ISO_8859_SUPP, STRING_ENCODING_ISO_10367_BOX, STRING_ENCODING_LATIN_LAP, STRING_ENCODING_JIS_X0212_1990, STRING_ENCODING_DS_2089, STRING_ENCODING_US_DK, STRING_ENCODING_DK_US, STRING_ENCODING_KSC5636, STRING_ENCODING_UNICODE_1_1_UTF_7, STRING_ENCODING_ISO_2022_CN_EXT, STRING_ENCODING_ISO_8859_16, STRING_ENCODING_OSD_EBCDIC_DF04_15, STRING_ENCODING_OSD_EBCDIC_DF03_IRV, STRING_ENCODING_OSD_EBCDIC_DF04_1, STRING_ENCODING_ISO_11548_1, STRING_ENCODING_KZ_1048, STRING_ENCODING_ISO_10646_UCS_2, STRING_ENCODING_ISO_10646_UCS_4, STRING_ENCODING_ISO_10646_UCS_BASIC, STRING_ENCODING_ISO_10646_UNICODE_LATIN1, STRING_ENCODING_ISO_10646_J_1, STRING_ENCODING_ISO_UNICODE_IBM_1261, STRING_ENCODING_ISO_UNICODE_IBM_1268, STRING_ENCODING_ISO_UNICODE_IBM_1276, STRING_ENCODING_ISO_UNICODE_IBM_1264, STRING_ENCODING_ISO_UNICODE_IBM_1265, STRING_ENCODING_UNICODE_1_1, STRING_ENCODING_SCSU, STRING_ENCODING_UTF_7, STRING_ENCODING_CESU_8, STRING_ENCODING_BOCU_1, STRING_ENCODING_ISO_8859_1_WINDOWS_3_0_LATIN_1, STRING_ENCODING_ISO_8859_1_WINDOWS_3_1_LATIN_1, STRING_ENCODING_ISO_8859_2_WINDOWS_LATIN_2, STRING_ENCODING_ISO_8859_9_WINDOWS_LATIN_5, STRING_ENCODING_HP_ROMAN8, STRING_ENCODING_ADOBE_STANDARD_ENCODING, STRING_ENCODING_VENTURA_US, STRING_ENCODING_VENTURA_INTERNATIONAL, STRING_ENCODING_DEC_MCS, STRING_ENCODING_IBM_850, STRING_ENCODING_PC8_DANISH_NORWEGIAN, STRING_ENCODING_IBM_862, STRING_ENCODING_PC8_TURKISH, STRING_ENCODING_IBM_SYMBOLS, STRING_ENCODING_IBM_THAI, STRING_ENCODING_HP_LEGAL, STRING_ENCODING_HP_PI_FONT, STRING_ENCODING_HP_MATH8, STRING_ENCODING_ADOBE_SYMBOL_ENCODING, STRING_ENCODING_HP_DESKTOP, STRING_ENCODING_VENTURA_MATH, STRING_ENCODING_MICROSOFT_PUBLISHING, STRING_ENCODING_WINDOWS_31J, STRING_ENCODING_MACINTOSH, STRING_ENCODING_IBM_037, STRING_ENCODING_IBM_038, STRING_ENCODING_IBM_273, STRING_ENCODING_IBM_274, STRING_ENCODING_IBM_275, STRING_ENCODING_IBM_277, STRING_ENCODING_IBM_278, STRING_ENCODING_IBM_280, STRING_ENCODING_IBM_281, STRING_ENCODING_IBM_284, STRING_ENCODING_IBM_285, STRING_ENCODING_IBM_290, STRING_ENCODING_IBM_297, STRING_ENCODING_IBM_420, STRING_ENCODING_IBM_423, STRING_ENCODING_IBM_424, STRING_ENCODING_IBM_437, STRING_ENCODING_IBM_500, STRING_ENCODING_IBM_851, STRING_ENCODING_IBM_852, STRING_ENCODING_IBM_855, STRING_ENCODING_IBM_857, STRING_ENCODING_IBM_860, STRING_ENCODING_IBM_861, STRING_ENCODING_IBM_863, STRING_ENCODING_IBM_864, STRING_ENCODING_IBM_865, STRING_ENCODING_IBM_868, STRING_ENCODING_IBM_869, STRING_ENCODING_IBM_870, STRING_ENCODING_IBM_871, STRING_ENCODING_IBM_880, STRING_ENCODING_IBM_891, STRING_ENCODING_IBM_903, STRING_ENCODING_IBM_904, STRING_ENCODING_IBM_905, STRING_ENCODING_IBM_918, STRING_ENCODING_IBM_1026, STRING_ENCODING_EBCDIC_AT_DE, STRING_ENCODING_EBCDIC_AT_DE_A, STRING_ENCODING_EBCDIC_CA_FR, STRING_ENCODING_EBCDIC_DK_NO, STRING_ENCODING_EBCDIC_DK_NO_A, STRING_ENCODING_EBCDIC_FI_SE, STRING_ENCODING_EBCDIC_FI_SE_A, STRING_ENCODING_EBCDIC_FR, STRING_ENCODING_EBCDIC_IT, STRING_ENCODING_EBCDIC_PT, STRING_ENCODING_EBCDIC_ES, STRING_ENCODING_EBCDIC_ES_A, STRING_ENCODING_EBCDIC_ES_S, STRING_ENCODING_EBCDIC_UK, STRING_ENCODING_EBCDIC_US, STRING_ENCODING_UNKNOWN_8BIT, STRING_ENCODING_MNEMONIC, STRING_ENCODING_MNEM, STRING_ENCODING_VISCII, STRING_ENCODING_VIQR, STRING_ENCODING_KOI8_R, STRING_ENCODING_HZ_GB_2312, STRING_ENCODING_IBM_866, STRING_ENCODING_IBM_775, STRING_ENCODING_KOI8_U, STRING_ENCODING_IBM_00858, STRING_ENCODING_IBM_00924, STRING_ENCODING_IBM_01140, STRING_ENCODING_IBM_01141, STRING_ENCODING_IBM_01142, STRING_ENCODING_IBM_01143, STRING_ENCODING_IBM_01144, STRING_ENCODING_IBM_01145, STRING_ENCODING_IBM_01146, STRING_ENCODING_IBM_01147, STRING_ENCODING_IBM_01148, STRING_ENCODING_IBM_01149, STRING_ENCODING_IBM_1047, STRING_ENCODING_PTCP154, STRING_ENCODING_AMIGA_1251, STRING_ENCODING_KOI7_SWITCHED, STRING_ENCODING_BRF, STRING_ENCODING_TSCII, STRING_ENCODING_TIS_620, STRING_ENCODING_WINDOWS_709, STRING_ENCODING_WINDOWS_710, STRING_ENCODING_WINDOWS_720, STRING_ENCODING_WINDOWS_737, STRING_ENCODING_WINDOWS_875, STRING_ENCODING_WINDOWS_1361, STRING_ENCODING_WINDOWS_10000, STRING_ENCODING_WINDOWS_10001, STRING_ENCODING_WINDOWS_10002, STRING_ENCODING_WINDOWS_10003, STRING_ENCODING_WINDOWS_10004, STRING_ENCODING_WINDOWS_10005, STRING_ENCODING_WINDOWS_10006, STRING_ENCODING_WINDOWS_10007, STRING_ENCODING_WINDOWS_10008, STRING_ENCODING_WINDOWS_10010, STRING_ENCODING_WINDOWS_10017, STRING_ENCODING_WINDOWS_10021, STRING_ENCODING_WINDOWS_10029, STRING_ENCODING_WINDOWS_10079, STRING_ENCODING_WINDOWS_10081, STRING_ENCODING_WINDOWS_10082, STRING_ENCODING_WINDOWS_20000, STRING_ENCODING_WINDOWS_20001, STRING_ENCODING_WINDOWS_20002, STRING_ENCODING_WINDOWS_20003, STRING_ENCODING_WINDOWS_20004, STRING_ENCODING_WINDOWS_20005, STRING_ENCODING_WINDOWS_20105, STRING_ENCODING_WINDOWS_20106, STRING_ENCODING_WINDOWS_20107, STRING_ENCODING_WINDOWS_20108, STRING_ENCODING_WINDOWS_20269, STRING_ENCODING_WINDOWS_20833, STRING_ENCODING_WINDOWS_20949, STRING_ENCODING_WINDOWS_21025, STRING_ENCODING_WINDOWS_21027, STRING_ENCODING_WINDOWS_29001, STRING_ENCODING_WINDOWS_38598, STRING_ENCODING_WINDOWS_50221, STRING_ENCODING_WINDOWS_50222, STRING_ENCODING_WINDOWS_50229, STRING_ENCODING_WINDOWS_50930, STRING_ENCODING_WINDOWS_50931, STRING_ENCODING_WINDOWS_50933, STRING_ENCODING_WINDOWS_50935, STRING_ENCODING_WINDOWS_50936, STRING_ENCODING_WINDOWS_50937, STRING_ENCODING_WINDOWS_50939, STRING_ENCODING_WINDOWS_51936, STRING_ENCODING_WINDOWS_51950, STRING_ENCODING_WINDOWS_57002, STRING_ENCODING_WINDOWS_57003, STRING_ENCODING_WINDOWS_57004, STRING_ENCODING_WINDOWS_57005, STRING_ENCODING_WINDOWS_57006, STRING_ENCODING_WINDOWS_57007, STRING_ENCODING_WINDOWS_57008, STRING_ENCODING_WINDOWS_57009, STRING_ENCODING_WINDOWS_57010, STRING_ENCODING_WINDOWS_57011, STRING_ENCODING_IBM_813, STRING_ENCODING_IBM_943_P130_1999, STRING_ENCODING_IBM_33722, STRING_ENCODING_WINDOWS_949, STRING_ENCODING_IBM_1363, STRING_ENCODING_IBM_1386, STRING_ENCODING_IBM_1373, STRING_ENCODING_IBM_5471, STRING_ENCODING_IBM_874, // Add more encodings here. // Sentinel value after the last explicitly specified encoding. STRING_ENCODING_MAX_SPECIFIED, /* * The environment-specified "default" encoding for this process. */ STRING_ENCODING_DEFAULT = -1, STRING_ENCODING_UNKNOWN = -2, /* * UTF-16 and UTF-32 in native byte order. */ STRING_ENCODING_UTF16 = STRING_ENCODING_UTF16_LE, STRING_ENCODING_UTF32 = STRING_ENCODING_UTF32_LE, } StringEncoding; const char *Unicode_EncodingEnumToName(StringEncoding encoding); StringEncoding Unicode_EncodingNameToEnum(const char *encodingName); Bool Unicode_IsEncodingValid(StringEncoding encoding); void Unicode_Init(int argc, char ***argv, char ***envp); void Unicode_InitEx(int argc, char ***argv, char ***envp, const char *icuDataDir); #if defined (_WIN32) void Unicode_InitW(int argc, utf16_t **wargv, utf16_t **wenvp, char ***argv, char ***envp); #endif StringEncoding Unicode_GetCurrentEncoding(void); StringEncoding Unicode_ResolveEncoding(StringEncoding encoding); #ifdef __cplusplus } #endif #endif // _UNICODE_TYPES_H_ open-vm-tools-10.0.7-3227872/lib/include/mul64.h0000644000000000000000000001020212660700526017160 0ustar rootroot/********************************************************* * Copyright (C) 2003-2014 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * mul64.h * * Integer by fixed point multiplication, with rounding. * * These routines are implemented in assembly language for most * supported platforms. This file has plain C fallback versions. */ #ifndef _MUL64_H_ #define _MUL64_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_asm.h" #ifdef MUL64_NO_ASM /* *----------------------------------------------------------------------------- * * Mul64x3264 -- * * Unsigned integer by fixed point multiplication, with rounding: * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) * * Unsigned 64-bit integer multiplicand. * Unsigned 32-bit fixed point multiplier, represented as * (multiplier, shift), where shift < 64. * * Result: * Unsigned 64-bit integer product. * *----------------------------------------------------------------------------- */ static INLINE uint64 Mul64x3264(uint64 multiplicand, uint32 multiplier, uint32 shift) { uint64 lo, hi, lo2, hi2; unsigned carry; // ASSERT(shift >= 0 && shift < 64); lo = (multiplicand & 0xffffffff) * multiplier; hi = (multiplicand >> 32) * multiplier; lo2 = lo + (hi << 32); carry = lo2 < lo; hi2 = (hi >> 32) + carry; if (shift == 0) { return lo2; } else { return (lo2 >> shift) + (hi2 << (64 - shift)) + ((lo2 >> (shift - 1)) & 1); } } /* *----------------------------------------------------------------------------- * * Muls64x32s64 -- * * Signed integer by fixed point multiplication, with rounding: * result = floor(multiplicand * multiplier * 2**(-shift) + 0.5) * * Signed 64-bit integer multiplicand. * Unsigned 32-bit fixed point multiplier, represented as * (multiplier, shift), where shift < 64. * * Result: * Signed 64-bit integer product. * *----------------------------------------------------------------------------- */ static INLINE int64 Muls64x32s64(int64 multiplicand, uint32 multiplier, uint32 shift) { uint64 lo, hi, lo2, hi2; unsigned carry; // ASSERT(shift >= 0 && shift < 64); hi = ((uint64)multiplicand >> 32) * multiplier; if (multiplicand < 0) { hi -= (uint64)multiplier << 32; } lo = ((uint64)multiplicand & 0xffffffff) * multiplier; lo2 = lo + (hi << 32); carry = lo2 < lo; hi2 = (((int64)hi >> 32) + carry); if (shift == 0) { return lo2; } else { return (lo2 >> shift) + (hi2 << (64 - shift)) + ((lo2 >> (shift - 1)) & 1); } } #endif #endif // _MUL64_NOASM_H_ open-vm-tools-10.0.7-3227872/lib/include/message.h0000644000000000000000000000475312660700526017653 0ustar rootroot/********************************************************* * Copyright (C) 1999-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * message.h -- * * Second layer of the internal communication channel between guest * applications and vmware */ #ifndef __MESSAGE_H__ # define __MESSAGE_H__ #ifdef __cplusplus extern "C" { #endif #include "vm_basic_types.h" /* The channel object */ typedef struct Message_Channel { /* Identifier */ uint16 id; /* Reception buffer */ /* Data */ unsigned char *in; /* Allocated size */ size_t inAlloc; Bool inPreallocated; /* The cookie */ uint32 cookieHigh; uint32 cookieLow; } Message_Channel; Bool Message_OpenAllocated(uint32 proto, Message_Channel *chan, char *receiveBuffer, size_t receiveBufferSize); Message_Channel* Message_Open(uint32 proto); Bool Message_Send(Message_Channel *chan, const unsigned char *buf, size_t bufSize); Bool Message_Receive(Message_Channel *chan, unsigned char **buf, size_t *bufSize); Bool Message_CloseAllocated(Message_Channel *chan); Bool Message_Close(Message_Channel *chan); #ifdef __cplusplus } #endif #endif /* __MESSAGE_H__ */ open-vm-tools-10.0.7-3227872/lib/include/hgfsDevLinux.h0000644000000000000000000001174112660700526020630 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * hgfsDev.h -- * * Header for code shared between the hgfs linux kernel module driver * and the pserver. */ #ifndef _HGFS_DEV_H_ #define _HGFS_DEV_H_ #include "vm_basic_types.h" #include "hgfs.h" #define HGFS_NAME "vmhgfs" // Name of FS (e.g. "mount -t vmhgfs") #define HGFS_FUSENAME "vmhgfs-fuse" // Name of FS (e.g. "-o subtype=vmhgfs-fuse") #define HGFS_FUSETYPE "fuse." HGFS_FUSENAME // Type of FS (e.g. "fuse.vmhgfs-fuse") #define HGFS_MOUNT_POINT "/mnt/hgfs" // Type of FS (e.g. vmhgfs-fuse ) #define HGFS_DEVICE_NAME "dev" // Name of our device under /proc/fs/HGFS_NAME/ #define HGFS_SUPER_MAGIC 0xbacbacbc // Superblock magic number #define HGFS_PROTOCOL_VERSION 2 // Version 2 has size and flags field added #define HGFS_PROTOCOL_VERSION_1 1 // Version 1 #define HGFS_DEFAULT_TTL 1 // Default TTL for dentries /* * The mount info flags. * These specify flags from options parsed on the mount command line. */ #define HGFS_MNTINFO_SERVER_INO (1 << 0) /* Use server inode numbers? */ /* * Mount information, passed from pserver process to kernel * at mount time. * * XXX: I'm hijacking this struct. In the future, when the Solaris HGFS driver * loses its pserver, the struct will be used by /sbin/mount.vmhgfs solely. * As is, it is also used by the Solaris pserver. */ typedef struct HgfsMountInfo { uint32 magicNumber; // hgfs magic number uint32 infoSize; // HgfsMountInfo object size uint32 version; // protocol version uint32 fd; // file descriptor of client file uint32 flags; // hgfs specific mount flags #ifndef sun uid_t uid; // desired owner of files Bool uidSet; // is the owner actually set? gid_t gid; // desired group of files Bool gidSet; // is the group actually set? unsigned short fmask; // desired file mask unsigned short dmask; // desired directory mask uint32 ttl; // number of seconds before revalidating dentries #if defined __APPLE__ char shareNameHost[MAXPATHLEN]; // must be ".host" char shareNameDir[MAXPATHLEN]; // desired share name for mounting #else const char *shareNameHost; // must be ".host" const char *shareNameDir; // desired share name for mounting #endif #endif } #if __GNUC__ __attribute__((__packed__)) #else # error Compiler packing... #endif HgfsMountInfo; /* * Version 1 of the MountInfo object. * This is used so that newer kernel clients can allow mounts using * older versions of the mounter application for backwards compatibility. */ typedef struct HgfsMountInfoV1 { uint32 magicNumber; // hgfs magic number uint32 version; // protocol version uint32 fd; // file descriptor of client file #ifndef sun uid_t uid; // desired owner of files Bool uidSet; // is the owner actually set? gid_t gid; // desired group of files Bool gidSet; // is the group actually set? unsigned short fmask; // desired file mask unsigned short dmask; // desired directory mask uint32 ttl; // number of seconds before revalidating dentries #if defined __APPLE__ char shareNameHost[MAXPATHLEN]; // must be ".host" char shareNameDir[MAXPATHLEN]; // desired share name for mounting #else const char *shareNameHost; // must be ".host" const char *shareNameDir; // desired share name for mounting #endif #endif } HgfsMountInfoV1; #endif //ifndef _HGFS_DEV_H_ open-vm-tools-10.0.7-3227872/lib/include/vmware_pack_init.h0000644000000000000000000000476412660700526021553 0ustar rootroot/********************************************************* * Copyright (C) 2002-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #ifndef __VMWARE_PACK_INIT_H__ # define __VMWARE_PACK_INIT_H__ /* * vmware_pack_init.h -- * * Platform-independent code to make the compiler pack (i.e. have them * occupy the smallest possible space) structure definitions. The following * constructs are known to work --hpreg * * #include "vmware_pack_begin.h" * struct foo { * ... * } * #include "vmware_pack_end.h" * ; * * typedef * #include "vmware_pack_begin.h" * struct foo { * ... * } * #include "vmware_pack_end.h" * foo; */ #ifdef _MSC_VER /* * MSVC 6.0 emits warning 4103 when the pack push and pop pragma pairing is * not balanced within 1 included file. That is annoying because our scheme * is based on the pairing being balanced between 2 included files. * * So we disable this warning, but this is safe because the compiler will also * emit warning 4161 when there is more pops than pushes within 1 main * file --hpreg */ # pragma warning(disable:4103) #elif __GNUC__ #else # error Compiler packing... #endif #endif /* __VMWARE_PACK_INIT_H__ */ open-vm-tools-10.0.7-3227872/lib/include/bsdfmt.h0000644000000000000000000001331512660700526017500 0ustar rootroot/* ********************************************************** * Copyright 2008-2014 VMware, Inc. All rights reserved. -- VMware Confidential * **********************************************************/ /* * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Chris Torek. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ /* * bsdfmt.h -- * * BSD-derived formatter (sprintf, etc.) support. * * Most of this code came from bsd_vsnprintf.c and bsd_output_int.h, * which in turn came from vfprintf.c in the FreeBSD distribution. * See bsd_vsnprintf.c for more details. */ #ifndef _BSDFMT_H_ #define _BSDFMT_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #ifdef _WIN32 // { #pragma warning(disable : 4018 4047 4101 4102 4146 4244 4267) #define INTMAX_MAX MAX_INT64 typedef unsigned int u_int; typedef unsigned long u_long; typedef unsigned short u_short; typedef unsigned char u_char; typedef __int64 intmax_t; typedef unsigned __int64 uintmax_t; typedef intptr_t ptrdiff_t; #else // } { /* For u_int and u_long, and other types we might want. */ #include #include #include #include #if defined(__FreeBSD__) && __FreeBSD_version < 500029 #define INTMAX_MAX 9223372036854775807LL #define UINTMAX_MAX 18446744073709551615ULL typedef int64 intmax_t; typedef uint64 uintmax_t; typedef int32 wint_t; #endif #endif // } /* * I/O descriptors for BSDFmt_sfvwrite(). */ typedef struct BSDFmt_IOV { void *iov_base; size_t iov_len; } BSDFmt_IOV; typedef struct BSDFmt_UIO { BSDFmt_IOV *uio_iov; int uio_iovcnt; int uio_resid; } BSDFmt_UIO; #define BSDFMT_NIOV 8 typedef struct BSDFmt_StrBuf { Bool alloc; Bool error; char *buf; size_t size; size_t index; } BSDFmt_StrBuf; int BSDFmt_SFVWrite(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio); int BSDFmt_SPrint(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio); /* * Conversion functions */ char *BSDFmt_WCharToUTF8(wchar_t *, int); char *BSDFmt_UJToA(uintmax_t, char *, int, int, const char *, int, char, const char *); /* * Don't use typedef for mbstate_t because it's actually defined * in VS2003/VC7/include/wchar.h -- edward */ #ifdef _WIN32 #define mbstate_t int #endif /* * Macros for converting digits to letters and vice versa */ #define to_digit(c) ((c) - '0') #define is_digit(c) ((unsigned)to_digit(c) <= 9) #define to_char(n) ((n) + '0') /* * Floating point */ #ifndef NO_FLOATING_POINT // { #include #include #define MAXEXPDIG 6 #define DEFPREC 6 int BSDFmt_Exponent(char *, int, int); extern char *dtoa(double d, int mode, int prec, int *expOut, int *sign, char **strEnd); extern char *ldtoa(long double *ld, int mode, int prec, int *expOut, int *sign, char **strEnd); extern void freedtoa(void *mem); #endif // } /* * The size of the buffer we use as scratch space for integer * conversions, among other things. Technically, we would need the * most space for base 10 conversions with thousands' grouping * characters between each pair of digits. 100 bytes is a * conservative overestimate even for a 128-bit uintmax_t. */ #define INT_CONV_BUF 100 #define STATIC_ARG_TBL_SIZE 8 /* Size of static argument table. */ /* * Flags used during conversion. */ #define ALT 0x001 /* alternate form */ #define LADJUST 0x004 /* left adjustment */ #define LONGINT 0x010 /* long integer */ #define LLONGINT 0x020 /* long long integer */ #define SHORTINT 0x040 /* short integer */ #define ZEROPAD 0x080 /* zero (as opposed to blank) pad */ #define FPT 0x100 /* Floating point number */ #define GROUPING 0x200 /* use grouping ("'" flag) */ /* C99 additional size modifiers: */ #define SIZET 0x400 /* size_t */ #define PTRDIFFT 0x800 /* ptrdiff_t */ #define INTMAXT 0x1000 /* intmax_t */ #define CHARINT 0x2000 /* print char using int format */ #define INTMAX_SIZE (INTMAXT|SIZET|PTRDIFFT|LLONGINT) /* * Choose PADSIZE to trade efficiency vs. size. If larger printf * fields occur frequently, increase PADSIZE and make the initialisers * below longer. */ #define PADSIZE 16 /* pad chunk size */ extern char blanks[PADSIZE]; extern char zeroes[PADSIZE]; extern const char xdigs_lower[17]; extern const char xdigs_upper[17]; #endif // ifndef _BSDFMT_H_ open-vm-tools-10.0.7-3227872/lib/include/hgfsVirtualDir.h0000644000000000000000000000347412660700526021163 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * hgfsVirtualDir.h -- * * Defines for virtual directory names in hgfs. */ #ifndef _HGFSVIRTUALDIR_H_ # define _HGFSVIRTUALDIR_H_ /* * These are the names of the virtual directories for accessing UNC * names and drives on the host machine. */ # define HGFS_DRIVE_DIR_NAME "drive" # define HGFS_UNC_DIR_NAME "unc" #define HGFS_STR_LEN(str) (sizeof str - 1) #endif /* _HGFSVIRTUALDIR_H_ */ open-vm-tools-10.0.7-3227872/lib/include/xdg.h0000644000000000000000000000215112660700526016777 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * xdg.h -- * * vmware-xdg-* script wrapper library. */ #ifndef _VMWARE_XDG_H_ #define _VMWARE_XDG_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" extern const char *Xdg_DetectDesktopEnv(void); #endif // ifndef _VMWARE_XDG_H_ open-vm-tools-10.0.7-3227872/lib/include/vm_compilation_options.h0000644000000000000000000000315712660700526023017 0ustar rootroot/********************************************************* * Copyright (C) 2012-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef VM_COMPILATION_OPTION_H #define VM_COMPILATION_OPTION_H #ifdef VMX86_DEVEL # ifdef VMX86_DEBUG # define COMPILATION_OPTION "DEBUG" # else # define COMPILATION_OPTION "OPT" # endif #else # ifdef VMX86_ALPHA # define COMPILATION_OPTION "ALPHA" # elif defined(VMX86_BETA) # ifdef VMX86_EXPERIMENTAL # define COMPILATION_OPTION "BETA-EXPERIMENTAL" # else # define COMPILATION_OPTION "BETA" # endif # elif defined(VMX86_RELEASE) # define COMPILATION_OPTION "Release" # elif defined(VMX86_OPT) # define COMPILATION_OPTION "OPT" # elif defined(VMX86_DEBUG) # define COMPILATION_OPTION "DEBUG" # elif defined(VMX86_STATS) # define COMPILATION_OPTION "STATS" # endif #endif #endif open-vm-tools-10.0.7-3227872/lib/include/conf.h0000644000000000000000000001125312660700526017145 0ustar rootroot/********************************************************* * Copyright (C) 2002-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * conf.h -- * * Manage the tools configuration file. * */ #ifndef __CONF_H__ #define __CONF_H__ #include "guestApp.h" #define CONF_FILE "tools.conf" #if ! defined(_WIN32) # define CONFVAL_POWERONSCRIPT_DEFAULT "poweron-vm-default" # define CONFVAL_POWEROFFSCRIPT_DEFAULT "poweroff-vm-default" # define CONFVAL_RESUMESCRIPT_DEFAULT "resume-vm-default" # define CONFVAL_SUSPENDSCRIPT_DEFAULT "suspend-vm-default" #else # define CONFVAL_POWERONSCRIPT_DEFAULT "poweron-vm-default.bat" # define CONFVAL_POWEROFFSCRIPT_DEFAULT "poweroff-vm-default.bat" # define CONFVAL_RESUMESCRIPT_DEFAULT "resume-vm-default.bat" # define CONFVAL_SUSPENDSCRIPT_DEFAULT "suspend-vm-default.bat" #endif #define CONFNAME_POWERONSCRIPT "poweron-script" #define CONFNAME_POWEROFFSCRIPT "poweroff-script" #define CONFNAME_RESUMESCRIPT "resume-script" #define CONFNAME_SUSPENDSCRIPT "suspend-script" #define CONFNAME_LOG "log" #define CONFNAME_LOGFILE "log.file" #define CONFNAME_LOGLEVEL "log.level" #define CONFNAME_DISABLETOOLSVERSION "disable-tools-version" #define CONFNAME_DISABLEPMTIMERWARNING "disable-pmtimerwarning" /* ****************************************************************************** * BEGIN GuestInfo goodies. */ /** * Defines the string used for the GuestInfo config file group. */ #define CONFGROUPNAME_GUESTINFO "guestinfo" /** * Lets users disable just the perf monitor. */ #define CONFNAME_GUESTINFO_DISABLEPERFMON "disable-perf-mon" /** * Lets users disable just DiskInfo. * * If thinking of deprecating this, please read bug 535343 first. */ #define CONFNAME_GUESTINFO_DISABLEQUERYDISKINFO "disable-query-diskinfo" /** * Define a custom GuestInfo poll interval (in seconds). * * @note Illegal values result in a @c g_warning and fallback to the default * poll interval. * * @param int User-defined poll interval. Set to 0 to disable polling. */ #define CONFNAME_GUESTINFO_POLLINTERVAL "poll-interval" /** * Define a custom GuestStats poll interval (in seconds). * * @note Illegal values result in a @c g_warning and fallback to the default * stats interval. * * @param int User-defined poll interval for stats. Set to 0 to disable polling. */ #define CONFNAME_GUESTINFO_STATSINTERVAL "stats-interval" /** * Indicates whether stat results should be written to the log. */ #define CONFNAME_GUESTINFO_ENABLESTATLOGGING "enable-stat-logging" /* * END GuestInfo goodies. ****************************************************************************** */ /* ****************************************************************************** * BEGIN Unity goodies. */ /** * Defines the string used for the Unity config file group. */ #define CONFGROUPNAME_UNITY "unity" /** * Lets users override system decisions about whether unity should be available. */ #define CONFNAME_UNITY_FORCEENABLE "forceEnable" /** * Lets users override the desktop background color when in Unity mode. */ #define CONFNAME_UNITY_BACKGROUNDCOLOR "desktop.backgroundColor" /** * Lets users enable (or disable) the Protocol Buffer enabled service */ #define CONFNAME_UNITY_ENABLEPBRPC "pbrpc.enable" /** * Lets users configure the socket type for the PBRPC Services */ #define CONFNAME_UNITY_PBRPCSOCKETTYPE "pbrpc.socketType" #define CONFNAME_UNITY_PBRPCSOCKETTYPE_IPSOCKET "ipsocket" #define CONFNAME_UNITY_PBRPCSOCKETTYPE_VSOCKET "vsocket" /* * END Unity goodies. ****************************************************************************** */ /** Where to find Tools data in the Win32 registry. */ #define CONF_VMWARE_TOOLS_REGKEY "Software\\VMware, Inc.\\VMware Tools" /* Wait 5 seconds between polls to see if the conf file has changed */ #define CONF_POLL_TIME 5 #endif /* __CONF_H__ */ open-vm-tools-10.0.7-3227872/lib/include/vm_vmx_type.h0000644000000000000000000000352512660700526020600 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef VM_VMX_TYPE_H #define VM_VMX_TYPE_H #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMKDRIVERS #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" /* * This allows UIs and guest binaries to know what kind of VMX they * are dealing with. Don't change those values (only add new ones if * needed) because they rely on them --hpreg */ typedef enum { VMX_TYPE_UNSET, VMX_TYPE_EXPRESS, /* This deprecated type was used for VMware Express */ VMX_TYPE_SCALABLE_SERVER, VMX_TYPE_WGS, /* This deprecated type was used for VMware Server */ VMX_TYPE_WORKSTATION, VMX_TYPE_WORKSTATION_ENTERPRISE /* This deprecated type was used for ACE 1.x */ } VMX_Type; /* * This allows UIs and guest binaries to know what platform the VMX is * running. */ typedef enum { VMX_PLATFORM_UNSET, VMX_PLATFORM_LINUX, VMX_PLATFORM_WIN32, VMX_PLATFORM_MACOS, } VMX_Platform; #endif open-vm-tools-10.0.7-3227872/lib/include/vm_product.h0000644000000000000000000004675012660700526020414 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef VM_PRODUCT_H #define VM_PRODUCT_H #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" /**** **** **** PLEASE use the various PRODUCT_* and *_NAME defines as though **** they were variables -- do not embed them in format strings, **** since they could contain a "%" sign or actually be a variable **** someday. **** ****/ /* * This name should be used when referring to the company */ #define COMPANY_NAME "VMware, Inc." /* * This generic name should be used when referring to any product of the * VMware product line, like VMware Workstation, VMware Server, and so * on... */ #define PRODUCT_GENERIC_NAME "VMware" #define PRODUCT_GENERIC_NAME_UPPER "VMWARE" #define PRODUCT_GENERIC_NAME_LOWER "vmware" /* * Brief names are used when the VMware prefix is not wanted. */ #define PRODUCT_SCALABLE_SERVER_BRIEF_NAME "ESX" #define PRODUCT_ESXI_BRIEF_NAME "ESXi" #define PRODUCT_WORKSTATION_BRIEF_NAME "Workstation" #define PRODUCT_WORKSTATION_ENTERPRISE_BRIEF_NAME \ PRODUCT_WORKSTATION_BRIEF_NAME " " "ACE Edition" #define PRODUCT_WORKSTATION_SERVER_BRIEF_NAME "Workstation Server" #define PRODUCT_PLAYER_BRIEF_NAME "Player" #define PRODUCT_ACE_PLAYER_BRIEF_NAME "ACE " PRODUCT_PLAYER_BRIEF_NAME #define PRODUCT_MAC_DESKTOP_BRIEF_NAME "Fusion" #define PRODUCT_ACE_MANAGEMENT_SERVER_BRIEF_NAME "ACE Management Server" #define PRODUCT_VMRC_BRIEF_NAME "Remote Console" #define PRODUCT_GANTRY_BRIEF_NAME "Gantry" /* * Product names include the formal VMware prefix. */ #define MAKE_NAME(_brief) PRODUCT_GENERIC_NAME " " _brief /* * This name should be used when referring to VMware Tools */ #define VMWARE_TOOLS_SHORT_NAME MAKE_NAME("Tools") #define PRODUCT_SCALABLE_SERVER_NAME MAKE_NAME(PRODUCT_SCALABLE_SERVER_BRIEF_NAME) #define PRODUCT_ESX_SMP_NAME MAKE_NAME("Virtual SMP for ESX Server") #define PRODUCT_WORKSTATION_NAME MAKE_NAME(PRODUCT_WORKSTATION_BRIEF_NAME) #define PRODUCT_WORKSTATION_ENTERPRISE_NAME MAKE_NAME(PRODUCT_WORKSTATION_ENTERPRISE_BRIEF_NAME) #define PRODUCT_WORKSTATION_SERVER_NAME MAKE_NAME(PRODUCT_WORKSTATION_SERVER_BRIEF_NAME) #define PRODUCT_MUI_NAME MAKE_NAME("Management Interface") #define PRODUCT_CONSOLE_NAME MAKE_NAME("Server Console") #define PRODUCT_PLAYER_NAME MAKE_NAME(PRODUCT_PLAYER_BRIEF_NAME) #define PRODUCT_PLAYER_NAME_FOR_LICENSE PRODUCT_PLAYER_NAME #define PRODUCT_ACE_PLAYER_NAME MAKE_NAME(PRODUCT_ACE_PLAYER_BRIEF_NAME) #define PRODUCT_ACE_MANAGEMENT_SERVER_NAME MAKE_NAME(PRODUCT_ACE_MANAGEMENT_SERVER_BRIEF_NAME) #define PRODUCT_MAC_DESKTOP_NAME_FOR_LICENSE "VMware Fusion for Mac OS" #define PRODUCT_VMRC_NAME MAKE_NAME(PRODUCT_VMRC_BRIEF_NAME) #define PRODUCT_VMRC_NAME_FOR_LICENSE PRODUCT_VMRC_NAME #define PRODUCT_GANTRY_NAME MAKE_NAME(PRODUCT_GANTRY_BRIEF_NAME) #define PRODUCT_GANTRY_NAME_FOR_LICENSE PRODUCT_GANTRY_NAME #define PRODUCT_VMLS_SHORT_NAME "VMLS" #define PRODUCT_VMLS_NAME MAKE_NAME("License Server") #define PRODUCT_VLICENSE_SHORT_NAME "VLICENSE" #define PRODUCT_VLICENSE_NAME MAKE_NAME("License Infrastructure") #define PRODUCT_P2V_SHORT_NAME "P2V" #define PRODUCT_P2V_NAME MAKE_NAME("P2V Assistant") #define PRODUCT_V2V_SHORT_NAME "V2V" #define PRODUCT_V2V_NAME MAKE_NAME("Virtual Machine Importer") #define PRODUCT_SYSIMAGE_SHORT_NAME "SysImage" #define PRODUCT_SYSIMAGE_NAME MAKE_NAME("System Image Framework") #define PRODUCT_VCB_SHORT_NAME "VCB" #define PRODUCT_VCB_NAME MAKE_NAME("Consolidated Backup") #define PRODUCT_VPX_NAME MAKE_NAME("VirtualCenter") #define PRODUCT_VPXA_NAME PRODUCT_VPX_NAME " Agent" #define PRODUCT_FDM_NAME MAKE_NAME("Fault Domain Manager") #define PRODUCT_HA_NAME MAKE_NAME("High Availability Extension") #define PRODUCT_WBC_NAME MAKE_NAME("WebCenter") #define PRODUCT_SDK_NAME MAKE_NAME("SDK") #define PRODUCT_DDK_NAME MAKE_NAME("ESX DDK") #define PRODUCT_NGCINSTALLER_NAME MAKE_NAME("vSphere Web Client") #define PRODUCT_SSOINSTALLER_NAME MAKE_NAME("Single Sign On") #define PRODUCT_SSOREGMM_NAME MAKE_NAME("vCenter Registration Tool") // XXX I think these are dead and can be removed -clayton // #define PRODUCT_VDM_SHORT_NAME "VDM" // #define PRODUCT_VDM_NAME MAKE_NAME("Virtual Desktop Manager") #define PRODUCT_VDDK_SHORT_NAME "VDDK" #define PRODUCT_VDDK_NAME MAKE_NAME("Virtual Disk Development Kit") #define PRODUCT_VDM_CLIENT_NAME MAKE_NAME("Horizon Client") #define PRODUCT_VDM_CLIENT_NAME_FOR_LICENSE PRODUCT_VDM_CLIENT_NAME #define PRODUCT_XVP_SHORT_NAME "XVP" #define PRODUCT_XVP_NAME MAKE_NAME("vCenter XVP Manager") #define PRODUCT_RMKSCONTAINER_NAME MAKE_NAME("Remote MKS Container") #define PRODUCT_BOOMERANG_NAME MAKE_NAME("Boomerang") #define PRODUCT_HBR_SERVER_NAME MAKE_NAME("vSphere Replication Server") #define PRODUCT_VIEW_SHORT_NAME "Horizon View" #define PRODUCT_VIEW_NAME MAKE_NAME("Horizon View") #define PRODUCT_VIEW_NAME_FOR_LICENSE PRODUCT_VIEW_NAME #define PRODUCT_FLEX_GENERIC_SHORT_NAME "Horizon FLEX" #define PRODUCT_FLEX_GENERIC_NAME MAKE_NAME(PRODUCT_FLEX_GENERIC_SHORT_NAME) #define PRODUCT_FLEX_SERVER_SHORT_NAME PRODUCT_FLEX_GENERIC_SHORT_NAME " Server" #define PRODUCT_FLEX_SERVER_NAME MAKE_NAME(PRODUCT_FLEX_SERVER_SHORT_NAME) #define PRODUCT_VMCF_NAME MAKE_NAME("VMCF") // XXX VMvisor is the underlying technology for possibly several products, // XXX not the product. Fix when names are decided. // #define PRODUCT_VMVISOR_NAME MAKE_NAME("VMvisor") // XXX Only one product for now so just hardcode it. #define PRODUCT_VMVISOR_NAME MAKE_NAME(PRODUCT_SCALABLE_SERVER_BRIEF_NAME "i") #if defined(__linux__) || defined(__FreeBSD__) #define PRODUCT_NETDUMP_NAME PRODUCT_GENERIC_NAME_LOWER "-netdumper" #else #define PRODUCT_NETDUMP_NAME PRODUCT_VMVISOR_NAME " dump collector" #endif /* * VMware USB Arbitration Service version definitions */ #define PRODUCT_USB_ARBITRATOR_SHORT_NAME "vmware-usbarbitrator" #define PRODUCT_USB_ARBITRATOR_NAME MAKE_NAME("USB Arbitration Service") #ifdef _WIN32 #define PRODUCT_USB_ARBITRATOR_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-usbarbitrator.exe" #else #define PRODUCT_USB_ARBITRATOR_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-usbarbitrator" #endif // VMware Remote Console (VMRC) #define PRODUCT_VMRC_UPPER "VMRC" #define PRODUCT_VMRC_LOWER "vmrc" /* * TODO: This properly lives in productState, but we need it here to * define DEFAULT_LIBDIRECTORY. If that can be moved to productState, * it's no longer needed here. */ #define PRODUCT_MAC_DESKTOP_NAME MAKE_NAME(PRODUCT_MAC_DESKTOP_BRIEF_NAME) #if !( defined(VMX86_SERVER) \ || defined(VMX86_DESKTOP) \ || defined(VMX86_ENTERPRISE_DESKTOP) \ || defined(VMX86_HORIZON_VIEW) \ || defined(VMX86_MUI) \ || defined(VMX86_VPX) \ || defined(VMX86_WBC) \ || defined(VMX86_SDK) \ || defined(VMX86_TOOLS) \ || defined(VMX86_V2V) \ || defined(VMX86_SYSIMAGE) \ || defined(VMX86_VCB) \ || defined(VMX86_VMLS) \ || defined(VMX86_VLICENSE) \ || defined(VMX86_P2V) \ || defined(VMX86_DDK) \ || defined(VMX86_VDDK) \ || defined(VMX86_NETDUMP) \ || defined(VMX86_BOOMERANG) \ || defined(VMX86_HBR_SERVER) \ || defined(VMX86_VMCF) \ || defined(VMX86_GANTRY) \ || defined(VMX86_VMRC)) # if defined(_WIN32) || defined(__APPLE__) /* * XXX Make the product be Workstation by default if none of the defines * XXX above are not defined in defs-globaldefs.mk -- Edward A. Waugh */ # define VMX86_DESKTOP # else # error Unknown product # endif #endif #if defined(VMVISOR) # define PRODUCT_SHORT_NAME PRODUCT_VMVISOR_NAME #elif defined(VMX86_SERVER) # define PRODUCT_SHORT_NAME PRODUCT_SCALABLE_SERVER_NAME #elif defined(VMX86_CONSOLE) # define PRODUCT_SHORT_NAME PRODUCT_CONSOLE_NAME #elif defined(VMX86_MUI) # define PRODUCT_SHORT_NAME PRODUCT_MUI_NAME #elif defined(VMX86_VMRC) /* check VMX86_VMRC before VMX86_DESKTOP */ # define PRODUCT_SHORT_NAME PRODUCT_VMRC_NAME #elif defined(VMX86_GANTRY) # define PRODUCT_SHORT_NAME PRODUCT_GANTRY_NAME #elif defined(VMX86_ENTERPRISE_DESKTOP) # define PRODUCT_SHORT_NAME PRODUCT_WORKSTATION_ENTERPRISE_NAME #elif defined(VMX86_DESKTOP) # if defined(__APPLE__) # define PRODUCT_SHORT_NAME PRODUCT_MAC_DESKTOP_NAME # else # define PRODUCT_SHORT_NAME PRODUCT_WORKSTATION_NAME # endif #elif defined(VMX86_TOOLS) # define PRODUCT_SHORT_NAME VMWARE_TOOLS_SHORT_NAME #elif defined(VMX86_VPX) # if defined(CSI_HA) # define PRODUCT_SHORT_NAME PRODUCT_HA_NAME # elif defined(CSI_FDM) # define PRODUCT_SHORT_NAME PRODUCT_FDM_NAME # elif defined(VPXA) # define PRODUCT_SHORT_NAME PRODUCT_VPXA_NAME # elif defined(XVP) # define PRODUCT_SHORT_NAME PRODUCT_XVP_NAME # elif defined(INSTALL_NGC) # define PRODUCT_SHORT_NAME PRODUCT_NGCINSTALLER_NAME # elif defined(INSTALL_SSO) # define PRODUCT_SHORT_NAME PRODUCT_SSOINSTALLER_NAME # elif defined(INSTALL_SSOREGMM) # define PRODUCT_SHORT_NAME PRODUCT_SSOREGMM_NAME # else # define PRODUCT_SHORT_NAME PRODUCT_VPX_NAME # endif #elif defined(VMX86_WBC) # define PRODUCT_SHORT_NAME PRODUCT_WBC_NAME #elif defined(VMX86_SDK) # define PRODUCT_SHORT_NAME PRODUCT_SDK_NAME #elif defined(VMX86_P2V) # define PRODUCT_SHORT_NAME PRODUCT_P2V_NAME #elif defined(VMX86_V2V) # define PRODUCT_SHORT_NAME PRODUCT_V2V_NAME #elif defined(VMX86_SYSIMAGE) # define PRODUCT_SHORT_NAME PRODUCT_SYSIMAGE_NAME #elif defined(VMX86_VCB) # define PRODUCT_SHORT_NAME PRODUCT_VCB_NAME #elif defined(VMX86_VMLS) # define PRODUCT_SHORT_NAME PRODUCT_VMLS_NAME #elif defined(VMX86_VLICENSE) # define PRODUCT_SHORT_NAME PRODUCT_VLICENSE_NAME #elif defined(VMX86_DDK) # define PRODUCT_SHORT_NAME PRODUCT_DDK_NAME #elif defined(VMX86_VDDK) # define PRODUCT_SHORT_NAME PRODUCT_VDDK_NAME #elif defined(VMX86_NETDUMP) # define PRODUCT_SHORT_NAME PRODUCT_NETDUMP_NAME #elif defined(VMX86_BOOMERANG) # define PRODUCT_SHORT_NAME PRODUCT_BOOMERANG_NAME #elif defined(VMX86_HBR_SERVER) # define PRODUCT_SHORT_NAME PRODUCT_HBR_SERVER_NAME #elif defined(VMX86_HORIZON_VIEW) # define PRODUCT_SHORT_NAME PRODUCT_VIEW_NAME #elif defined(VMX86_VMCF) # define PRODUCT_SHORT_NAME PRODUCT_VMCF_NAME #endif /* * Names of programs */ #if defined(VMX86_CONSOLE) #if defined(__linux__) || defined(__FreeBSD__) #define VMWARE_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-console" #else #define VMWARE_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "Console.exe" #endif #else #define VMWARE_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER #endif #define VMWARE_VMX_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-vmx" #define CCAGENT_DISPLAY_NAME PRODUCT_VPX_NAME " Agent" #if defined(__linux__) || defined(__FreeBSD__) # define VMAUTHD_EXECUTABLE PRODUCT_GENERIC_NAME_LOWER "-authd" #else # define VMAUTHD_DISPLAY_NAME "VMware Authorization Service" # define VMSERVERD_DISPLAY_NAME "VMware Registration Service" # define VMNAT_DISPLAY_NAME "VMware NAT Service" # define TOOLS_SERVICE_DISPLAY_NAME "VMware Tools Service" # define TOOLS_SERVICE_NAME "VMTools" # define VMAUTHD_SERVICE_NAME "VMAuthdService" #endif /* * Configuration paths */ #ifndef _WIN32 # define PRODUCT_NAME PRODUCT_SHORT_NAME /* * Checked against the ProductID field of licenses. This ensures that * a license intended for one flavor of the product will not allow * another flavor of the product to run. */ # if defined(__APPLE__) # define PRODUCT_OS "Mac OS" # else # define PRODUCT_OS "Linux" # endif /* * Note: changing PRODUCT_NAME_FOR_LICENSE and PRODUCT_LICENSE_VERSION * or macros it cleverly depends on (such as PRODUCT_NAME) requires a * coordinated dormant license file change. Otherwise licensing for * that product may break because the Licensecheck API is being passed * a parameter that no longer match the content of the dormant license * file. */ # if defined(VMX86_SERVER) # define PRODUCT_NAME_FOR_LICENSE "VMware ESX Server" # define PRODUCT_SMP_NAME_FOR_LICENSE PRODUCT_ESX_SMP_NAME # elif defined(VMX86_VMRC) /* check VMX86_VMRC before VMX86_DESKTOP */ # define PRODUCT_NAME_FOR_LICENSE PRODUCT_VMRC_NAME_FOR_LICENSE # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_GANTRY) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_GANTRY_NAME_FOR_LICENSE # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_DESKTOP) # if defined(__APPLE__) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_MAC_DESKTOP_NAME_FOR_LICENSE # else # define PRODUCT_NAME_FOR_LICENSE "VMware Workstation" # endif # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_VPX) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_NAME " Server" # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_SYSIMAGE) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_NAME # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_NETDUMP) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_NETDUMP_NAME # define PRODUCT_SMP_NAME_FOR_LICENSE "" //None # else /* It is a product that doesn't use a license */ # define PRODUCT_NAME_FOR_LICENSE PRODUCT_NAME # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # endif /* * VMWARE_HOST_DIRECTORY is for host-specific configuration files. * DEFAULT_LIBDIRECTORY is the default for the 'libdir' config variable. * * The remote console checks at run time, and the MUI is not really a separate * product. */ # if defined(__APPLE__) # if defined VMX86_DESKTOP # define VMWARE_HOST_DIRECTORY_PREFIX \ "/Library/Preferences/" PRODUCT_SHORT_NAME # else # define VMWARE_HOST_DIRECTORY_PREFIX \ "/Library/Application Support/" PRODUCT_SHORT_NAME # endif # endif # if defined (VMX86_CONSOLE) # if defined(__APPLE__) # define VMWARE_HOST_DIRECTORY VMWARE_HOST_DIRECTORY_PREFIX " Console" # else # define VMWARE_HOST_DIRECTORY "/etc/" PRODUCT_GENERIC_NAME_LOWER "-console" # define DEFAULT_LIBDIRECTORY "/usr/lib/" PRODUCT_GENERIC_NAME_LOWER "-console" # endif # else # if defined(__APPLE__) # define VMWARE_HOST_DIRECTORY VMWARE_HOST_DIRECTORY_PREFIX # else # define VMWARE_HOST_DIRECTORY "/etc/" PRODUCT_GENERIC_NAME_LOWER # define DEFAULT_LIBDIRECTORY "/usr/lib/" PRODUCT_GENERIC_NAME_LOWER # endif # endif # if defined(__APPLE__) # if defined VMX86_DESKTOP /* On Mac OS, use Location_Get() instead of DEFAULT_LIBDIRECTORY. */ # define DEFAULT_LIBDIRECTORY \ "/dev/null/Non-existing DEFAULT_LIBDIRECTORY" # else # define DEFAULT_LIBDIRECTORY VMWARE_HOST_DIRECTORY # endif # endif /* For user-specific files. */ # if defined(__APPLE__) # define VMWARE_USER_DIRECTORY "~/Library/Preferences/" PRODUCT_SHORT_NAME # else # define VMWARE_USER_DIRECTORY "~/." PRODUCT_GENERIC_NAME_LOWER # endif # define VMWARE_MODULE_NAME "/dev/vmmon" # define VMWARE_CONFIG PRODUCT_GENERIC_NAME_LOWER "-config.pl" # define VMWARE_CONNECT_SOCKET_DIRECTORY "/var/run/" PRODUCT_GENERIC_NAME_LOWER #else /* PRODUCT_SHORT_NAME and PRODUCT_FULL_NAME are used to display the name depending on how much space we have */ # define PRODUCT_FULL_NAME PRODUCT_SHORT_NAME # define PRODUCT_NAME PRODUCT_FULL_NAME /* Directory name in the registry */ #define PRODUCT_REG_NAME PRODUCT_NAME /* * Checked against the ProductID field of licenses. This ensures that * a license intended for one flavor of the product will not allow * another flavor of the product to run. */ # if defined(VMX86_VMRC) /* check VMX86_VMRC before VMX86_DESKTOP */ # define PRODUCT_NAME_FOR_LICENSE PRODUCT_VMRC_NAME # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_DESKTOP) # if defined(__APPLE__) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_MAC_DESKTOP_NAME_FOR_LICENSE # else # define PRODUCT_NAME_FOR_LICENSE "VMware Workstation" # endif # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # elif defined(VMX86_VPX) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_NAME " Server" # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # else # define PRODUCT_NAME_FOR_LICENSE PRODUCT_REG_NAME # define PRODUCT_SMP_NAME_FOR_LICENSE "" // None # endif #define PRIVATE_REG_KEY "Private" #endif /* * Used when referring to an unspecified member of the VMware product line * ex. "This file was created by an incompatible version of PRODUCT_LINE_NAME" */ #define PRODUCT_LINE_NAME PRODUCT_GENERIC_NAME " software" #define PRODUCT_REG_PATH "SOFTWARE\\" COMPANY_NAME "\\" PRODUCT_REG_NAME #define PRIVATE_REG_PATH PRODUCT_REG_PATH "\\" PRIVATE_REG_KEY /* * Defines used primarily in Tools, but perhaps useful elsewhere. Only error * on unrecognized platform during Tools builds. Note that NetWare must come * before linux below since it uses the Linux gcc which automatically defines * linux; the other platforms don't have this issue. */ #ifdef N_PLAT_NLM # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for NetWare" #elif defined(linux) # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Linux" #elif defined(_WIN32) # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Windows" #elif defined(__FreeBSD__) # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for FreeBSD" #elif defined(sun) # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Solaris" #elif defined(__APPLE__) # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Mac OS X" #elif defined __ANDROID__ # define PRODUCT_NAME_PLATFORM PRODUCT_NAME " for Android" #else # ifdef VMX86_TOOLS # error "Define a product string for this platform." # endif #endif /* * This is for ACE Management Server * Since there is no separate product defined for Ace Mgmt Server * (i.e. PRODUCT=xxx when running makefile), we can not used the * generic PRODUCT_NAME_STRING_FOR_LICENSE definition. * As a result, the specific ACE_MGMT_SERVER_PRODUCT_NAME_FOR_LICENSE * is used instead. * A similar reason is used also for the PRODUCT_VERSION_STRING_FOR_LICENSE * definition in the vm_version.h */ #define ACE_MGMT_SERVER_PRODUCT_NAME_FOR_LICENSE "VMware ACE Management Server" /* * For Host Agent (hostd) */ #define HOST_AGENT_PRODUCT_NAME PRODUCT_NAME " Host Agent" /* Used by bora/vim/lib/vmgina module. * @todo Use this also in /bora/install/msi/InstUtil/desktop/vmInstUtil.cpp * to guarantee that the service is installed with exactly this name. */ #define HOST_AGENT_SERVICE_NAME "VMwareHostd" // Name of the environment variable that controls which proxy server to use // while opening connections to vCenter and vSphere servers. Currently vCloud // VMRC uses it. #define VMWARE_HTTPSPROXY "VMWARE_HTTPSPROXY" #endif /* VM_PRODUCT_H */ open-vm-tools-10.0.7-3227872/lib/include/vmware_pack_begin.h0000644000000000000000000000356412660700526021671 0ustar rootroot/********************************************************* * Copyright (C) 2002-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * vmware_pack_begin.h -- * * Begin of structure packing. See vmware_pack_init.h for details. * * Note that we do not use the following construct in this include file, * because we want to emit the code every time the file is included --hpreg * * #ifndef foo * # define foo * ... * #endif * */ #include "vmware_pack_init.h" #ifdef _MSC_VER # pragma pack(push, 1) #elif __GNUC__ #else # error Compiler packing... #endif open-vm-tools-10.0.7-3227872/lib/include/netutil.h0000644000000000000000000000734212660700526017710 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * netutil.h -- * * Utility network functions. * */ #ifndef __NETUTIL_H__ #define __NETUTIL_H__ #ifdef _WIN32 # include # include # include "vmware/iphlpapi_packed.h" # include # include #else # include #endif #include "vm_basic_types.h" #include "guestInfo.h" /* * Interface types as assigned by IANA. * See http://www.iana.org/assignments/ianaiftype-mib for more details. */ typedef enum { IANA_IFTYPE_OTHER = 1, IANA_IFTYPE_ETHERNETCSMACD = 6, } IanaIfType; /* * Modified from iptypes.h... */ char *NetUtil_GetPrimaryIP(void); GuestNic *NetUtil_GetPrimaryNic(void); #ifdef _WIN32 /* * Brute-force this. Trying to do it "properly" with * WINVER/NTDDI_VERSION checks/manips in a way that compiles for both * VC8 and VC9 didn't work. */ #ifndef FIXED_INFO typedef FIXED_INFO_W2KSP1 FIXED_INFO; typedef FIXED_INFO_W2KSP1 *PFIXED_INFO; #endif DWORD NetUtil_LoadIpHlpApiDll(void); DWORD NetUtil_FreeIpHlpApiDll(void); /* Wrappers for functions in iphlpapi.dll */ PFIXED_INFO NetUtil_GetNetworkParams(void); PIP_ADAPTER_INFO NetUtil_GetAdaptersInfo(void); ULONG NetUtil_GetAdaptersAddresses(ULONG Family, ULONG Flags, PVOID rsvd, PIP_ADAPTER_ADDRESSES adap_addresses, PULONG SizePointer); PMIB_IPFORWARDTABLE NetUtilWin32_GetIpForwardTable(void); PMIB_IPFORWARD_TABLE2 NetUtilWin32_GetIpForwardTable2(void); void NetUtilWin32_FreeMibTable(PMIB_IPFORWARD_TABLE2); #endif #ifdef WIN32 int NetUtil_InetPToN(int af, const char *src, void *dst); const char *NetUtil_InetNToP(int af, const void *src, char *dst, socklen_t size); #else // ifdef WIN32 # define NetUtil_InetPToN inet_pton # define NetUtil_InetNToP inet_ntop #endif #if defined(linux) # ifdef DUMMY_NETUTIL /* * Dummy interface table to enable other tools'/libraries' unit tests. */ typedef struct { int ifIndex; const char *ifName; } NetUtilIfTableEntry; /* * {-1, NULL}-terminated array of NetUtilIfTableEntry pointers. * * (Test) applications wishing to use the dummy NetUtil_GetIf{Index,Name} * functions must define this variable somewhere. It allows said apps * to work with a priori knowledge of interface name <=> index mappings * returned by said APIs. */ EXTERN NetUtilIfTableEntry netUtilIfTable[]; int NetUtil_GetIfIndex(const char *ifName); char *NetUtil_GetIfName(int ifIndex); # endif // ifdef DUMMY_NETUTIL #endif // if defined(linux) size_t NetUtil_GetHardwareAddress(int ifIndex, // IN char *hwAddr, // OUT size_t hwAddrSize, // IN IanaIfType *ifType); // OUT #endif // ifndef _NETUTIL_H_ open-vm-tools-10.0.7-3227872/lib/include/unicode.h0000644000000000000000000000302012660700526017637 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * unicode.h -- * * Unicode-aware string library. */ #ifndef _UNICODE_H_ #define _UNICODE_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" // Start here: string creation, destruction, and encoding conversion. #include "unicodeBase.h" // Basic string operations: length, append, find, insert, replace. #include "unicodeOperations.h" // Character transformations: upper/lower/title case, case folding, etc. #include "unicodeTransforms.h" #ifdef USE_ICU // Unicode functionality depending on the third-party ICU library. #include "unicodeICU.h" #endif // USE_ICU #endif // _UNICODE_H_ open-vm-tools-10.0.7-3227872/lib/include/vmfs.h0000644000000000000000000001102012660700526017163 0ustar rootroot /********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * vmfs.h -- * * assorted vmfs related helper functions needed by userlevel. */ #ifndef __VMFS_H__ #define __VMFS_H__ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #include "unicodeTypes.h" // Consolidate all path stuff here so it's consistent between user and kernel #define VMFS_ROOT_DIR_NAME "vmfs" #define VMFS_ROOT_DIR_PATH "/vmfs/" #define DEVFS_DIR_NAME "devices" #define VCFS_DIR_NAME "volumes" #define DELTADISK_DIR_NAME "deltadisks" #define CBT_DIR_NAME "cbt" #define MULTI_EXTENT_DIR_NAME "multiextent" #define FILE_DIR_NAME "file" #define RAMDISK_DIR_NAME "ramdisk" #define SVM_DIR_NAME "svm" #define VFLASH_DIR_NAME "vflash" #define VDFM_DIR_NAME "vdfm" #define DEVFS_MOUNT_POINT VMFS_ROOT_DIR_PATH DEVFS_DIR_NAME #define VCFS_MOUNT_POINT VMFS_ROOT_DIR_PATH VCFS_DIR_NAME #define DEVFS_MOUNT_PATH DEVFS_MOUNT_POINT "/" #define VCFS_MOUNT_PATH VCFS_MOUNT_POINT "/" #define DELTADISK_MOUNT_POINT DEVFS_MOUNT_PATH DELTADISK_DIR_NAME #define DELTADISK_MOUNT_PATH DELTADISK_MOUNT_POINT "/" #define CBT_MOUNT_POINT DEVFS_MOUNT_PATH CBT_DIR_NAME #define CBT_MOUNT_PATH CBT_MOUNT_POINT "/" #define FILE_MOUNT_POINT DEVFS_MOUNT_PATH FILE_DIR_NAME #define FILE_MOUNT_PATH FILE_MOUNT_POINT "/" #define RAMDISK_MOUNT_POINT DEVFS_MOUNT_PATH RAMDISK_DIR_NAME #define RAMDISK_MOUNT_PATH RAMDISK_MOUNT_POINT "/" #define SVM_MOUNT_POINT DEVFS_MOUNT_PATH SVM_DIR_NAME #define SVM_MOUNT_PATH SVM_MOUNT_POINT "/" #define VFLASH_MOUNT_POINT DEVFS_MOUNT_PATH VFLASH_DIR_NAME #define VFLASH_MOUNT_PATH VFLASH_MOUNT_POINT "/" #define VDFM_MOUNT_POINT DEVFS_MOUNT_PATH VDFM_DIR_NAME #define VDFM_MOUNT_PATH VDFM_MOUNT_POINT "/" #define CDROM_DRIVER_STRING "cdrom" #define SCSI_DISK_DRIVER_STRING "disks" #define SCSI_GENERIC_DRIVER_STRING "genscsi" #define OLD_SCSI_GENERIC_DRIVER_STRING "generic" #define COW_DRIVER_NAME "deltadisks" #define MULTI_EXTENT_DRIVER_NAME "multiextent" #define CDROM_MOUNT_POINT DEVFS_MOUNT_PATH CDROM_DRIVER_STRING #define DISKS_MOUNT_POINT DEVFS_MOUNT_PATH SCSI_DISK_DRIVER_STRING #define GENERIC_SCSI_MOUNT_POINT DEVFS_MOUNT_PATH SCSI_GENERIC_DRIVER_STRING #define MULTI_EXTENT_MOUNT_POINT DEVFS_MOUNT_PATH MULTI_EXTENT_DIR_NAME #define CDROM_MOUNT_PATH CDROM_MOUNT_POINT "/" #define DISKS_MOUNT_PATH DISKS_MOUNT_POINT "/" #define GENERIC_SCSI_MOUNT_PATH GENERIC_SCSI_MOUNT_POINT "/" #define MULTI_EXTENT_MOUNT_PATH MULTI_EXTENT_MOUNT_POINT "/" #define VISOR_DEVFS_MOUNT_PATH "/dev/" #define VISOR_CDROM_MOUNT_POINT VISOR_DEVFS_MOUNT_PATH CDROM_DRIVER_STRING #define VISOR_DISKS_MOUNT_POINT VISOR_DEVFS_MOUNT_PATH SCSI_DISK_DRIVER_STRING #define VISOR_GENERIC_SCSI_MOUNT_POINT VISOR_DEVFS_MOUNT_PATH SCSI_GENERIC_DRIVER_STRING #define VISOR_CDROM_MOUNT_PATH VISOR_CDROM_MOUNT_POINT "/" #define VISOR_DISKS_MOUNT_PATH VISOR_DISKS_MOUNT_POINT "/" #define VISOR_GENERIC_SCSI_MOUNT_PATH VISOR_GENERIC_SCSI_MOUNT_POINT "/" typedef enum { VMFS_SYMBOLIC, VMFS_SCSI_DEV, VMFS_COS_SYMBOLIC, VMFS_COS_SCSI_DEV, } Vmfs_VolNameType; #if defined(VMX86_SERVER) char *Vmfs_GetCOSFileName(const char *vmfsFile); #endif /* VM86_SERVER */ #endif /* __VMFS_H__ */ open-vm-tools-10.0.7-3227872/lib/include/vix.h0000644000000000000000000013246512660700526017037 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * This is the C interface to the VIX API. * This is platform-independent. */ #ifndef _VIX_H_ #define _VIX_H_ #ifdef __cplusplus extern "C" { #endif /* *----------------------------------------------------------------------------- * * Basic Types -- * *----------------------------------------------------------------------------- */ #include "vm_basic_types.h" typedef int VixHandle; enum { VIX_INVALID_HANDLE = 0, }; /* * These are the types of handles. */ typedef int VixHandleType; enum { VIX_HANDLETYPE_NONE = 0, VIX_HANDLETYPE_HOST = 2, VIX_HANDLETYPE_VM = 3, VIX_HANDLETYPE_NETWORK = 5, VIX_HANDLETYPE_JOB = 6, VIX_HANDLETYPE_SNAPSHOT = 7, VIX_HANDLETYPE_PROPERTY_LIST = 9, VIX_HANDLETYPE_METADATA_CONTAINER = 11 }; /* * The "//{{ Begin VIX_ERROR }}" and "//{{ End VIX_ERROR }}" lines are * to bracket the error code definitions that will be copied over * to vixDiskLib.h during build time. If you modify these two lines, please * make sure you also change bora/lib/distribute/vixDiskLib.h and * bora/support/scripts/replaceVixErrors.py */ // {{ Begin VIX_ERROR }} /* * An error is a 64-bit value. If there is no error, then the value is * set to VIX_OK. If there is an error, then the least significant bits * will be set to one of the integer error codes defined below. The more * significant bits may or may not be set to various values, depending on * the errors. */ typedef uint64 VixError; #define VIX_ERROR_CODE(err) ((err) & 0xFFFF) #define VIX_SUCCEEDED(err) (VIX_OK == (err)) #define VIX_FAILED(err) (VIX_OK != (err)) /* * The error codes are returned by all public VIX routines. */ enum { VIX_OK = 0, /* General errors */ VIX_E_FAIL = 1, VIX_E_OUT_OF_MEMORY = 2, VIX_E_INVALID_ARG = 3, VIX_E_FILE_NOT_FOUND = 4, VIX_E_OBJECT_IS_BUSY = 5, VIX_E_NOT_SUPPORTED = 6, VIX_E_FILE_ERROR = 7, VIX_E_DISK_FULL = 8, VIX_E_INCORRECT_FILE_TYPE = 9, VIX_E_CANCELLED = 10, VIX_E_FILE_READ_ONLY = 11, VIX_E_FILE_ALREADY_EXISTS = 12, VIX_E_FILE_ACCESS_ERROR = 13, VIX_E_REQUIRES_LARGE_FILES = 14, VIX_E_FILE_ALREADY_LOCKED = 15, VIX_E_VMDB = 16, VIX_E_NOT_SUPPORTED_ON_REMOTE_OBJECT = 20, VIX_E_FILE_TOO_BIG = 21, VIX_E_FILE_NAME_INVALID = 22, VIX_E_ALREADY_EXISTS = 23, VIX_E_BUFFER_TOOSMALL = 24, VIX_E_OBJECT_NOT_FOUND = 25, VIX_E_HOST_NOT_CONNECTED = 26, VIX_E_INVALID_UTF8_STRING = 27, VIX_E_OPERATION_ALREADY_IN_PROGRESS = 31, VIX_E_UNFINISHED_JOB = 29, VIX_E_NEED_KEY = 30, VIX_E_LICENSE = 32, VIX_E_VM_HOST_DISCONNECTED = 34, VIX_E_AUTHENTICATION_FAIL = 35, VIX_E_HOST_CONNECTION_LOST = 36, VIX_E_DUPLICATE_NAME = 41, VIX_E_ARGUMENT_TOO_BIG = 44, /* Handle Errors */ VIX_E_INVALID_HANDLE = 1000, VIX_E_NOT_SUPPORTED_ON_HANDLE_TYPE = 1001, VIX_E_TOO_MANY_HANDLES = 1002, /* XML errors */ VIX_E_NOT_FOUND = 2000, VIX_E_TYPE_MISMATCH = 2001, VIX_E_INVALID_XML = 2002, /* VM Control Errors */ VIX_E_TIMEOUT_WAITING_FOR_TOOLS = 3000, VIX_E_UNRECOGNIZED_COMMAND = 3001, VIX_E_OP_NOT_SUPPORTED_ON_GUEST = 3003, VIX_E_PROGRAM_NOT_STARTED = 3004, VIX_E_CANNOT_START_READ_ONLY_VM = 3005, VIX_E_VM_NOT_RUNNING = 3006, VIX_E_VM_IS_RUNNING = 3007, VIX_E_CANNOT_CONNECT_TO_VM = 3008, VIX_E_POWEROP_SCRIPTS_NOT_AVAILABLE = 3009, VIX_E_NO_GUEST_OS_INSTALLED = 3010, VIX_E_VM_INSUFFICIENT_HOST_MEMORY = 3011, VIX_E_SUSPEND_ERROR = 3012, VIX_E_VM_NOT_ENOUGH_CPUS = 3013, VIX_E_HOST_USER_PERMISSIONS = 3014, VIX_E_GUEST_USER_PERMISSIONS = 3015, VIX_E_TOOLS_NOT_RUNNING = 3016, VIX_E_GUEST_OPERATIONS_PROHIBITED = 3017, VIX_E_ANON_GUEST_OPERATIONS_PROHIBITED = 3018, VIX_E_ROOT_GUEST_OPERATIONS_PROHIBITED = 3019, VIX_E_MISSING_ANON_GUEST_ACCOUNT = 3023, VIX_E_CANNOT_AUTHENTICATE_WITH_GUEST = 3024, VIX_E_UNRECOGNIZED_COMMAND_IN_GUEST = 3025, VIX_E_CONSOLE_GUEST_OPERATIONS_PROHIBITED = 3026, VIX_E_MUST_BE_CONSOLE_USER = 3027, VIX_E_VMX_MSG_DIALOG_AND_NO_UI = 3028, /* VIX_E_NOT_ALLOWED_DURING_VM_RECORDING = 3029, Removed in version 1.11 */ /* VIX_E_NOT_ALLOWED_DURING_VM_REPLAY = 3030, Removed in version 1.11 */ VIX_E_OPERATION_NOT_ALLOWED_FOR_LOGIN_TYPE = 3031, VIX_E_LOGIN_TYPE_NOT_SUPPORTED = 3032, VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST = 3033, VIX_E_INTERACTIVE_SESSION_NOT_PRESENT = 3034, VIX_E_INTERACTIVE_SESSION_USER_MISMATCH = 3035, /* VIX_E_UNABLE_TO_REPLAY_VM = 3039, Removed in version 1.11 */ VIX_E_CANNOT_POWER_ON_VM = 3041, VIX_E_NO_DISPLAY_SERVER = 3043, /* VIX_E_VM_NOT_RECORDING = 3044, Removed in version 1.11 */ /* VIX_E_VM_NOT_REPLAYING = 3045, Removed in version 1.11 */ VIX_E_TOO_MANY_LOGONS = 3046, VIX_E_INVALID_AUTHENTICATION_SESSION = 3047, /* VM Errors */ VIX_E_VM_NOT_FOUND = 4000, VIX_E_NOT_SUPPORTED_FOR_VM_VERSION = 4001, VIX_E_CANNOT_READ_VM_CONFIG = 4002, VIX_E_TEMPLATE_VM = 4003, VIX_E_VM_ALREADY_LOADED = 4004, VIX_E_VM_ALREADY_UP_TO_DATE = 4006, VIX_E_VM_UNSUPPORTED_GUEST = 4011, /* Property Errors */ VIX_E_UNRECOGNIZED_PROPERTY = 6000, VIX_E_INVALID_PROPERTY_VALUE = 6001, VIX_E_READ_ONLY_PROPERTY = 6002, VIX_E_MISSING_REQUIRED_PROPERTY = 6003, VIX_E_INVALID_SERIALIZED_DATA = 6004, VIX_E_PROPERTY_TYPE_MISMATCH = 6005, /* Completion Errors */ VIX_E_BAD_VM_INDEX = 8000, /* Message errors */ VIX_E_INVALID_MESSAGE_HEADER = 10000, VIX_E_INVALID_MESSAGE_BODY = 10001, /* Snapshot errors */ VIX_E_SNAPSHOT_INVAL = 13000, VIX_E_SNAPSHOT_DUMPER = 13001, VIX_E_SNAPSHOT_DISKLIB = 13002, VIX_E_SNAPSHOT_NOTFOUND = 13003, VIX_E_SNAPSHOT_EXISTS = 13004, VIX_E_SNAPSHOT_VERSION = 13005, VIX_E_SNAPSHOT_NOPERM = 13006, VIX_E_SNAPSHOT_CONFIG = 13007, VIX_E_SNAPSHOT_NOCHANGE = 13008, VIX_E_SNAPSHOT_CHECKPOINT = 13009, VIX_E_SNAPSHOT_LOCKED = 13010, VIX_E_SNAPSHOT_INCONSISTENT = 13011, VIX_E_SNAPSHOT_NAMETOOLONG = 13012, VIX_E_SNAPSHOT_VIXFILE = 13013, VIX_E_SNAPSHOT_DISKLOCKED = 13014, VIX_E_SNAPSHOT_DUPLICATEDDISK = 13015, VIX_E_SNAPSHOT_INDEPENDENTDISK = 13016, VIX_E_SNAPSHOT_NONUNIQUE_NAME = 13017, VIX_E_SNAPSHOT_MEMORY_ON_INDEPENDENT_DISK = 13018, VIX_E_SNAPSHOT_MAXSNAPSHOTS = 13019, VIX_E_SNAPSHOT_MIN_FREE_SPACE = 13020, VIX_E_SNAPSHOT_HIERARCHY_TOODEEP = 13021, // DEPRECRATED VIX_E_SNAPSHOT_RRSUSPEND = 13022, VIX_E_SNAPSHOT_NOT_REVERTABLE = 13024, /* Host Errors */ VIX_E_HOST_DISK_INVALID_VALUE = 14003, VIX_E_HOST_DISK_SECTORSIZE = 14004, VIX_E_HOST_FILE_ERROR_EOF = 14005, VIX_E_HOST_NETBLKDEV_HANDSHAKE = 14006, VIX_E_HOST_SOCKET_CREATION_ERROR = 14007, VIX_E_HOST_SERVER_NOT_FOUND = 14008, VIX_E_HOST_NETWORK_CONN_REFUSED = 14009, VIX_E_HOST_TCP_SOCKET_ERROR = 14010, VIX_E_HOST_TCP_CONN_LOST = 14011, VIX_E_HOST_NBD_HASHFILE_VOLUME = 14012, VIX_E_HOST_NBD_HASHFILE_INIT = 14013, /* Disklib errors */ VIX_E_DISK_INVAL = 16000, VIX_E_DISK_NOINIT = 16001, VIX_E_DISK_NOIO = 16002, VIX_E_DISK_PARTIALCHAIN = 16003, VIX_E_DISK_NEEDSREPAIR = 16006, VIX_E_DISK_OUTOFRANGE = 16007, VIX_E_DISK_CID_MISMATCH = 16008, VIX_E_DISK_CANTSHRINK = 16009, VIX_E_DISK_PARTMISMATCH = 16010, VIX_E_DISK_UNSUPPORTEDDISKVERSION = 16011, VIX_E_DISK_OPENPARENT = 16012, VIX_E_DISK_NOTSUPPORTED = 16013, VIX_E_DISK_NEEDKEY = 16014, VIX_E_DISK_NOKEYOVERRIDE = 16015, VIX_E_DISK_NOTENCRYPTED = 16016, VIX_E_DISK_NOKEY = 16017, VIX_E_DISK_INVALIDPARTITIONTABLE = 16018, VIX_E_DISK_NOTNORMAL = 16019, VIX_E_DISK_NOTENCDESC = 16020, VIX_E_DISK_NEEDVMFS = 16022, VIX_E_DISK_RAWTOOBIG = 16024, VIX_E_DISK_TOOMANYOPENFILES = 16027, VIX_E_DISK_TOOMANYREDO = 16028, VIX_E_DISK_RAWTOOSMALL = 16029, VIX_E_DISK_INVALIDCHAIN = 16030, VIX_E_DISK_KEY_NOTFOUND = 16052, // metadata key is not found VIX_E_DISK_SUBSYSTEM_INIT_FAIL = 16053, VIX_E_DISK_INVALID_CONNECTION = 16054, VIX_E_DISK_ENCODING = 16061, VIX_E_DISK_CANTREPAIR = 16062, VIX_E_DISK_INVALIDDISK = 16063, VIX_E_DISK_NOLICENSE = 16064, VIX_E_DISK_NODEVICE = 16065, VIX_E_DISK_UNSUPPORTEDDEVICE = 16066, VIX_E_DISK_CAPACITY_MISMATCH = 16067, VIX_E_DISK_PARENT_NOTALLOWED = 16068, VIX_E_DISK_ATTACH_ROOTLINK = 16069, /* Crypto Library Errors */ VIX_E_CRYPTO_UNKNOWN_ALGORITHM = 17000, VIX_E_CRYPTO_BAD_BUFFER_SIZE = 17001, VIX_E_CRYPTO_INVALID_OPERATION = 17002, VIX_E_CRYPTO_RANDOM_DEVICE = 17003, VIX_E_CRYPTO_NEED_PASSWORD = 17004, VIX_E_CRYPTO_BAD_PASSWORD = 17005, VIX_E_CRYPTO_NOT_IN_DICTIONARY = 17006, VIX_E_CRYPTO_NO_CRYPTO = 17007, VIX_E_CRYPTO_ERROR = 17008, VIX_E_CRYPTO_BAD_FORMAT = 17009, VIX_E_CRYPTO_LOCKED = 17010, VIX_E_CRYPTO_EMPTY = 17011, VIX_E_CRYPTO_KEYSAFE_LOCATOR = 17012, /* Remoting Errors. */ VIX_E_CANNOT_CONNECT_TO_HOST = 18000, VIX_E_NOT_FOR_REMOTE_HOST = 18001, VIX_E_INVALID_HOSTNAME_SPECIFICATION = 18002, /* Screen Capture Errors. */ VIX_E_SCREEN_CAPTURE_ERROR = 19000, VIX_E_SCREEN_CAPTURE_BAD_FORMAT = 19001, VIX_E_SCREEN_CAPTURE_COMPRESSION_FAIL = 19002, VIX_E_SCREEN_CAPTURE_LARGE_DATA = 19003, /* Guest Errors */ VIX_E_GUEST_VOLUMES_NOT_FROZEN = 20000, VIX_E_NOT_A_FILE = 20001, VIX_E_NOT_A_DIRECTORY = 20002, VIX_E_NO_SUCH_PROCESS = 20003, VIX_E_FILE_NAME_TOO_LONG = 20004, VIX_E_OPERATION_DISABLED = 20005, /* Tools install errors */ VIX_E_TOOLS_INSTALL_NO_IMAGE = 21000, VIX_E_TOOLS_INSTALL_IMAGE_INACCESIBLE = 21001, VIX_E_TOOLS_INSTALL_NO_DEVICE = 21002, VIX_E_TOOLS_INSTALL_DEVICE_NOT_CONNECTED = 21003, VIX_E_TOOLS_INSTALL_CANCELLED = 21004, VIX_E_TOOLS_INSTALL_INIT_FAILED = 21005, VIX_E_TOOLS_INSTALL_AUTO_NOT_SUPPORTED = 21006, VIX_E_TOOLS_INSTALL_GUEST_NOT_READY = 21007, /* VIX_E_TOOLS_INSTALL_SIG_CHECK_FAILED = 21008, Removed in version 1.15.0 */ VIX_E_TOOLS_INSTALL_ERROR = 21009, VIX_E_TOOLS_INSTALL_ALREADY_UP_TO_DATE = 21010, VIX_E_TOOLS_INSTALL_IN_PROGRESS = 21011, VIX_E_TOOLS_INSTALL_IMAGE_COPY_FAILED = 21012, /* Wrapper Errors */ VIX_E_WRAPPER_WORKSTATION_NOT_INSTALLED = 22001, VIX_E_WRAPPER_VERSION_NOT_FOUND = 22002, VIX_E_WRAPPER_SERVICEPROVIDER_NOT_FOUND = 22003, VIX_E_WRAPPER_PLAYER_NOT_INSTALLED = 22004, VIX_E_WRAPPER_RUNTIME_NOT_INSTALLED = 22005, VIX_E_WRAPPER_MULTIPLE_SERVICEPROVIDERS = 22006, /* FuseMnt errors*/ VIX_E_MNTAPI_MOUNTPT_NOT_FOUND = 24000, VIX_E_MNTAPI_MOUNTPT_IN_USE = 24001, VIX_E_MNTAPI_DISK_NOT_FOUND = 24002, VIX_E_MNTAPI_DISK_NOT_MOUNTED = 24003, VIX_E_MNTAPI_DISK_IS_MOUNTED = 24004, VIX_E_MNTAPI_DISK_NOT_SAFE = 24005, VIX_E_MNTAPI_DISK_CANT_OPEN = 24006, VIX_E_MNTAPI_CANT_READ_PARTS = 24007, VIX_E_MNTAPI_UMOUNT_APP_NOT_FOUND = 24008, VIX_E_MNTAPI_UMOUNT = 24009, VIX_E_MNTAPI_NO_MOUNTABLE_PARTITONS = 24010, VIX_E_MNTAPI_PARTITION_RANGE = 24011, VIX_E_MNTAPI_PERM = 24012, VIX_E_MNTAPI_DICT = 24013, VIX_E_MNTAPI_DICT_LOCKED = 24014, VIX_E_MNTAPI_OPEN_HANDLES = 24015, VIX_E_MNTAPI_CANT_MAKE_VAR_DIR = 24016, VIX_E_MNTAPI_NO_ROOT = 24017, VIX_E_MNTAPI_LOOP_FAILED = 24018, VIX_E_MNTAPI_DAEMON = 24019, VIX_E_MNTAPI_INTERNAL = 24020, VIX_E_MNTAPI_SYSTEM = 24021, VIX_E_MNTAPI_NO_CONNECTION_DETAILS = 24022, /* FuseMnt errors: Do not exceed 24299 */ /* VixMntapi errors*/ VIX_E_MNTAPI_INCOMPATIBLE_VERSION = 24300, VIX_E_MNTAPI_OS_ERROR = 24301, VIX_E_MNTAPI_DRIVE_LETTER_IN_USE = 24302, VIX_E_MNTAPI_DRIVE_LETTER_ALREADY_ASSIGNED = 24303, VIX_E_MNTAPI_VOLUME_NOT_MOUNTED = 24304, VIX_E_MNTAPI_VOLUME_ALREADY_MOUNTED = 24305, VIX_E_MNTAPI_FORMAT_FAILURE = 24306, VIX_E_MNTAPI_NO_DRIVER = 24307, VIX_E_MNTAPI_ALREADY_OPENED = 24308, VIX_E_MNTAPI_ITEM_NOT_FOUND = 24309, VIX_E_MNTAPI_UNSUPPROTED_BOOT_LOADER = 24310, VIX_E_MNTAPI_UNSUPPROTED_OS = 24311, VIX_E_MNTAPI_CODECONVERSION = 24312, VIX_E_MNTAPI_REGWRITE_ERROR = 24313, VIX_E_MNTAPI_UNSUPPORTED_FT_VOLUME = 24314, VIX_E_MNTAPI_PARTITION_NOT_FOUND = 24315, VIX_E_MNTAPI_PUTFILE_ERROR = 24316, VIX_E_MNTAPI_GETFILE_ERROR = 24317, VIX_E_MNTAPI_REG_NOT_OPENED = 24318, VIX_E_MNTAPI_REGDELKEY_ERROR = 24319, VIX_E_MNTAPI_CREATE_PARTITIONTABLE_ERROR = 24320, VIX_E_MNTAPI_OPEN_FAILURE = 24321, VIX_E_MNTAPI_VOLUME_NOT_WRITABLE = 24322, /* Success on operation that completes asynchronously */ VIX_ASYNC = 25000, /* Async errors */ VIX_E_ASYNC_MIXEDMODE_UNSUPPORTED = 26000, /* Network Errors */ VIX_E_NET_HTTP_UNSUPPORTED_PROTOCOL = 30001, VIX_E_NET_HTTP_URL_MALFORMAT = 30003, VIX_E_NET_HTTP_COULDNT_RESOLVE_PROXY = 30005, VIX_E_NET_HTTP_COULDNT_RESOLVE_HOST = 30006, VIX_E_NET_HTTP_COULDNT_CONNECT = 30007, VIX_E_NET_HTTP_HTTP_RETURNED_ERROR = 30022, VIX_E_NET_HTTP_OPERATION_TIMEDOUT = 30028, VIX_E_NET_HTTP_SSL_CONNECT_ERROR = 30035, VIX_E_NET_HTTP_TOO_MANY_REDIRECTS = 30047, VIX_E_NET_HTTP_TRANSFER = 30200, VIX_E_NET_HTTP_SSL_SECURITY = 30201, VIX_E_NET_HTTP_GENERIC = 30202, }; // {{ End VIX_ERROR }} const char *Vix_GetErrorText(VixError err, const char *locale); /* *----------------------------------------------------------------------------- * * VIX Handles -- * * These are common functions that apply to handles of several types. *----------------------------------------------------------------------------- */ /* * VIX Property Type */ typedef int VixPropertyType; enum { VIX_PROPERTYTYPE_ANY = 0, VIX_PROPERTYTYPE_INTEGER = 1, VIX_PROPERTYTYPE_STRING = 2, VIX_PROPERTYTYPE_BOOL = 3, VIX_PROPERTYTYPE_HANDLE = 4, VIX_PROPERTYTYPE_INT64 = 5, VIX_PROPERTYTYPE_BLOB = 6 }; /* * VIX Property ID's */ typedef int VixPropertyID; enum { VIX_PROPERTY_NONE = 0, /* Properties used by several handle types. */ VIX_PROPERTY_META_DATA_CONTAINER = 2, /* VIX_HANDLETYPE_HOST properties */ VIX_PROPERTY_HOST_HOSTTYPE = 50, VIX_PROPERTY_HOST_API_VERSION = 51, VIX_PROPERTY_HOST_SOFTWARE_VERSION = 52, /* VIX_HANDLETYPE_VM properties */ VIX_PROPERTY_VM_NUM_VCPUS = 101, VIX_PROPERTY_VM_VMX_PATHNAME = 103, VIX_PROPERTY_VM_VMTEAM_PATHNAME = 105, VIX_PROPERTY_VM_MEMORY_SIZE = 106, VIX_PROPERTY_VM_READ_ONLY = 107, VIX_PROPERTY_VM_NAME = 108, VIX_PROPERTY_VM_GUESTOS = 109, VIX_PROPERTY_VM_IN_VMTEAM = 128, VIX_PROPERTY_VM_POWER_STATE = 129, VIX_PROPERTY_VM_TOOLS_STATE = 152, VIX_PROPERTY_VM_IS_RUNNING = 196, VIX_PROPERTY_VM_SUPPORTED_FEATURES = 197, /* VIX_PROPERTY_VM_IS_RECORDING = 236, Removed in version 1.11 */ /* VIX_PROPERTY_VM_IS_REPLAYING = 237, Removed in version 1.11 */ VIX_PROPERTY_VM_SSL_ERROR = 293, /* Result properties; these are returned by various procedures */ VIX_PROPERTY_JOB_RESULT_ERROR_CODE = 3000, VIX_PROPERTY_JOB_RESULT_VM_IN_GROUP = 3001, VIX_PROPERTY_JOB_RESULT_USER_MESSAGE = 3002, VIX_PROPERTY_JOB_RESULT_EXIT_CODE = 3004, VIX_PROPERTY_JOB_RESULT_COMMAND_OUTPUT = 3005, VIX_PROPERTY_JOB_RESULT_HANDLE = 3010, VIX_PROPERTY_JOB_RESULT_GUEST_OBJECT_EXISTS = 3011, VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_ELAPSED_TIME = 3017, VIX_PROPERTY_JOB_RESULT_GUEST_PROGRAM_EXIT_CODE = 3018, VIX_PROPERTY_JOB_RESULT_ITEM_NAME = 3035, VIX_PROPERTY_JOB_RESULT_FOUND_ITEM_DESCRIPTION = 3036, VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_COUNT = 3046, VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_HOST = 3048, VIX_PROPERTY_JOB_RESULT_SHARED_FOLDER_FLAGS = 3049, VIX_PROPERTY_JOB_RESULT_PROCESS_ID = 3051, VIX_PROPERTY_JOB_RESULT_PROCESS_OWNER = 3052, VIX_PROPERTY_JOB_RESULT_PROCESS_COMMAND = 3053, VIX_PROPERTY_JOB_RESULT_FILE_FLAGS = 3054, VIX_PROPERTY_JOB_RESULT_PROCESS_START_TIME = 3055, VIX_PROPERTY_JOB_RESULT_VM_VARIABLE_STRING = 3056, VIX_PROPERTY_JOB_RESULT_PROCESS_BEING_DEBUGGED = 3057, VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_SIZE = 3058, VIX_PROPERTY_JOB_RESULT_SCREEN_IMAGE_DATA = 3059, VIX_PROPERTY_JOB_RESULT_FILE_SIZE = 3061, VIX_PROPERTY_JOB_RESULT_FILE_MOD_TIME = 3062, VIX_PROPERTY_JOB_RESULT_EXTRA_ERROR_INFO = 3084, /* Event properties; these are sent in the moreEventInfo for some events. */ VIX_PROPERTY_FOUND_ITEM_LOCATION = 4010, /* VIX_HANDLETYPE_SNAPSHOT properties */ VIX_PROPERTY_SNAPSHOT_DISPLAYNAME = 4200, VIX_PROPERTY_SNAPSHOT_DESCRIPTION = 4201, VIX_PROPERTY_SNAPSHOT_POWERSTATE = 4205, /* VIX_PROPERTY_SNAPSHOT_IS_REPLAYABLE = 4207, Removed in version 1.11 */ VIX_PROPERTY_GUEST_SHAREDFOLDERS_SHARES_PATH = 4525, /* Virtual machine encryption properties */ VIX_PROPERTY_VM_ENCRYPTION_PASSWORD = 7001, }; /* * These are events that may be signalled by calling a procedure * of type VixEventProc. */ typedef int VixEventType; enum { VIX_EVENTTYPE_JOB_COMPLETED = 2, VIX_EVENTTYPE_JOB_PROGRESS = 3, VIX_EVENTTYPE_FIND_ITEM = 8, VIX_EVENTTYPE_CALLBACK_SIGNALLED = 2, // Deprecated - Use VIX_EVENTTYPE_JOB_COMPLETED instead. }; /* * These are the property flags for each file. */ enum { VIX_FILE_ATTRIBUTES_DIRECTORY = 0x0001, VIX_FILE_ATTRIBUTES_SYMLINK = 0x0002, }; /* * Procedures of this type are called when an event happens on a handle. */ typedef void VixEventProc(VixHandle handle, VixEventType eventType, VixHandle moreEventInfo, void *clientData); /* * Handle Property functions */ void Vix_ReleaseHandle(VixHandle handle); void Vix_AddRefHandle(VixHandle handle); VixHandleType Vix_GetHandleType(VixHandle handle); VixError Vix_GetProperties(VixHandle handle, VixPropertyID firstPropertyID, ...); VixError Vix_GetPropertyType(VixHandle handle, VixPropertyID propertyID, VixPropertyType *propertyType); void Vix_FreeBuffer(void *p); /* *----------------------------------------------------------------------------- * * VIX Host -- * *----------------------------------------------------------------------------- */ typedef int VixHostOptions; enum { /* * The following option was removed in version 1.11. VIX_HOSTOPTION_USE_EVENT_PUMP = 0x0008, */ VIX_HOSTOPTION_VERIFY_SSL_CERT = 0x4000, }; typedef int VixServiceProvider; enum { VIX_SERVICEPROVIDER_DEFAULT = 1, VIX_SERVICEPROVIDER_VMWARE_SERVER = 2, VIX_SERVICEPROVIDER_VMWARE_WORKSTATION = 3, VIX_SERVICEPROVIDER_VMWARE_PLAYER = 4, VIX_SERVICEPROVIDER_VMWARE_VI_SERVER = 10, VIX_SERVICEPROVIDER_VMWARE_WORKSTATION_SHARED = 11, }; /* * VIX_API_VERSION tells VixHost_Connect to use the latest API version * that is available for the product specified in the VixServiceProvider * parameter. */ enum { VIX_API_VERSION = -1 }; VixHandle VixHost_Connect(int apiVersion, VixServiceProvider hostType, const char *hostName, int hostPort, const char *userName, const char *password, VixHostOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); void VixHost_Disconnect(VixHandle hostHandle); /* * VM Registration */ VixHandle VixHost_RegisterVM(VixHandle hostHandle, const char *vmxFilePath, VixEventProc *callbackProc, void *clientData); VixHandle VixHost_UnregisterVM(VixHandle hostHandle, const char *vmxFilePath, VixEventProc *callbackProc, void *clientData); /* * VM Search */ typedef int VixFindItemType; enum { VIX_FIND_RUNNING_VMS = 1, VIX_FIND_REGISTERED_VMS = 4, }; VixHandle VixHost_FindItems(VixHandle hostHandle, VixFindItemType searchType, VixHandle searchCriteria, int32 timeout, VixEventProc *callbackProc, void *clientData); /* * VixHost_OpenVM() supercedes VixVM_Open() since it allows for * the passing of option flags and extra data in the form of a * property list. * It is recommended to use VixHost_OpenVM() instead of VixVM_Open(). */ typedef int VixVMOpenOptions; enum { VIX_VMOPEN_NORMAL = 0x0, }; VixHandle VixHost_OpenVM(VixHandle hostHandle, const char *vmxFilePathName, VixVMOpenOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); /* * Following functions were removed in version 1.11. * typedef int VixPumpEventsOptions; enum { VIX_PUMPEVENTOPTION_NONE = 0, }; void Vix_PumpEvents(VixHandle hostHandle, VixPumpEventsOptions options); VixHandle VixVM_OpenUrlInGuest(VixHandle vmHandle, const char *url, int windowState, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); */ /* *----------------------------------------------------------------------------- * * PropertyList -- * *----------------------------------------------------------------------------- */ #ifndef VIX_HIDE_FROM_JAVA VixError VixPropertyList_AllocPropertyList(VixHandle hostHandle, VixHandle *resultHandle, int firstPropertyID, ...); #endif /* *----------------------------------------------------------------------------- * * VIX VM -- * * This describes the persistent configuration state of a single VM. The * VM may or may not be running. * *----------------------------------------------------------------------------- */ VixHandle VixVM_Open(VixHandle hostHandle, const char *vmxFilePathName, VixEventProc *callbackProc, void *clientData); typedef int VixVMPowerOpOptions; enum { VIX_VMPOWEROP_NORMAL = 0, VIX_VMPOWEROP_FROM_GUEST = 0x0004, VIX_VMPOWEROP_SUPPRESS_SNAPSHOT_POWERON = 0x0080, VIX_VMPOWEROP_LAUNCH_GUI = 0x0200, VIX_VMPOWEROP_START_VM_PAUSED = 0x1000, }; /* * Power operations */ VixHandle VixVM_PowerOn(VixHandle vmHandle, VixVMPowerOpOptions powerOnOptions, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_PowerOff(VixHandle vmHandle, VixVMPowerOpOptions powerOffOptions, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_Reset(VixHandle vmHandle, VixVMPowerOpOptions resetOptions, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_Suspend(VixHandle vmHandle, VixVMPowerOpOptions suspendOptions, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_Pause(VixHandle vmHandle, int options, VixHandle propertyList, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_Unpause(VixHandle vmHandle, int options, VixHandle propertyList, VixEventProc *callbackProc, void *clientData); typedef int VixVMDeleteOptions; enum { VIX_VMDELETE_DISK_FILES = 0x0002, }; VixHandle VixVM_Delete(VixHandle vmHandle, VixVMDeleteOptions deleteOptions, VixEventProc *callbackProc, void *clientData); /* * This is the state of an individual VM. These values are bitwise flags. * The actual value returned for may be a bitwise OR of one more of these * flags, along with other reserved values not documented here. */ typedef int VixPowerState; enum { VIX_POWERSTATE_POWERING_OFF = 0x0001, VIX_POWERSTATE_POWERED_OFF = 0x0002, VIX_POWERSTATE_POWERING_ON = 0x0004, VIX_POWERSTATE_POWERED_ON = 0x0008, VIX_POWERSTATE_SUSPENDING = 0x0010, VIX_POWERSTATE_SUSPENDED = 0x0020, VIX_POWERSTATE_TOOLS_RUNNING = 0x0040, VIX_POWERSTATE_RESETTING = 0x0080, VIX_POWERSTATE_BLOCKED_ON_MSG = 0x0100, VIX_POWERSTATE_PAUSED = 0x0200, VIX_POWERSTATE_RESUMING = 0x0800, }; typedef int VixToolsState; enum { VIX_TOOLSSTATE_UNKNOWN = 0x0001, VIX_TOOLSSTATE_RUNNING = 0x0002, VIX_TOOLSSTATE_NOT_INSTALLED = 0x0004, }; /* * These flags describe optional functions supported by different * types of VM. */ enum { VIX_VM_SUPPORT_SHARED_FOLDERS = 0x0001, VIX_VM_SUPPORT_MULTIPLE_SNAPSHOTS = 0x0002, VIX_VM_SUPPORT_TOOLS_INSTALL = 0x0004, VIX_VM_SUPPORT_HARDWARE_UPGRADE = 0x0008, }; /* * VIX_ADMINISTRATOR_USER_NAME and VIX_CONSOLE_USER_NAME are no longer * supported. If your code includes references to these constants please * update your code to use a valid guest username and password when calling * VixVM_LoginInGuest(). */ //#define VIX_ADMINISTRATOR_USER_NAME "__VMware_Vix_Guest_User_Admin__" //#define VIX_CONSOLE_USER_NAME "__VMware_Vix_Guest_Console_User__" /* * Guest operations */ VixHandle VixVM_WaitForToolsInGuest(VixHandle vmHandle, int timeoutInSeconds, VixEventProc *callbackProc, void *clientData); /* * VixVM_LoginInGuest option flags. */ enum { VIX_LOGIN_IN_GUEST_REQUIRE_INTERACTIVE_ENVIRONMENT = 0x08, }; VixHandle VixVM_LoginInGuest(VixHandle vmHandle, const char *userName, const char *password, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_LogoutFromGuest(VixHandle vmHandle, VixEventProc *callbackProc, void *clientData); /* * Guest Process functions */ typedef int VixRunProgramOptions; enum { VIX_RUNPROGRAM_RETURN_IMMEDIATELY = 0x0001, VIX_RUNPROGRAM_ACTIVATE_WINDOW = 0x0002, }; VixHandle VixVM_RunProgramInGuest(VixHandle vmHandle, const char *guestProgramName, const char *commandLineArgs, VixRunProgramOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_ListProcessesInGuest(VixHandle vmHandle, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_KillProcessInGuest(VixHandle vmHandle, uint64 pid, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_RunScriptInGuest(VixHandle vmHandle, const char *interpreter, const char *scriptText, VixRunProgramOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); /* * Guest File functions */ VixHandle VixVM_CopyFileFromHostToGuest(VixHandle vmHandle, const char *hostPathName, const char *guestPathName, int options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_CopyFileFromGuestToHost(VixHandle vmHandle, const char *guestPathName, const char *hostPathName, int options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_DeleteFileInGuest(VixHandle vmHandle, const char *guestPathName, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_FileExistsInGuest(VixHandle vmHandle, const char *guestPathName, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_RenameFileInGuest(VixHandle vmHandle, const char *oldName, const char *newName, int options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_CreateTempFileInGuest(VixHandle vmHandle, int options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_GetFileInfoInGuest(VixHandle vmHandle, const char *pathName, VixEventProc *callbackProc, void *clientData); /* * Guest Directory functions */ VixHandle VixVM_ListDirectoryInGuest(VixHandle vmHandle, const char *pathName, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_CreateDirectoryInGuest(VixHandle vmHandle, const char *pathName, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_DeleteDirectoryInGuest(VixHandle vmHandle, const char *pathName, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_DirectoryExistsInGuest(VixHandle vmHandle, const char *pathName, VixEventProc *callbackProc, void *clientData); /* * Guest Variable Functions */ enum { VIX_VM_GUEST_VARIABLE = 1, VIX_VM_CONFIG_RUNTIME_ONLY = 2, VIX_GUEST_ENVIRONMENT_VARIABLE = 3, }; VixHandle VixVM_ReadVariable(VixHandle vmHandle, int variableType, const char *name, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_WriteVariable(VixHandle vmHandle, int variableType, const char *valueName, const char *value, int options, VixEventProc *callbackProc, void *clientData); /* * Snapshot functions that operate on a VM */ VixError VixVM_GetNumRootSnapshots(VixHandle vmHandle, int *result); VixError VixVM_GetRootSnapshot(VixHandle vmHandle, int index, VixHandle *snapshotHandle); VixError VixVM_GetCurrentSnapshot(VixHandle vmHandle, VixHandle *snapshotHandle); VixError VixVM_GetNamedSnapshot(VixHandle vmHandle, const char *name, VixHandle *snapshotHandle); typedef int VixRemoveSnapshotOptions; enum { VIX_SNAPSHOT_REMOVE_CHILDREN = 0x0001, }; VixHandle VixVM_RemoveSnapshot(VixHandle vmHandle, VixHandle snapshotHandle, VixRemoveSnapshotOptions options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_RevertToSnapshot(VixHandle vmHandle, VixHandle snapshotHandle, VixVMPowerOpOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); typedef int VixCreateSnapshotOptions; enum { VIX_SNAPSHOT_INCLUDE_MEMORY = 0x0002, }; VixHandle VixVM_CreateSnapshot(VixHandle vmHandle, const char *name, const char *description, VixCreateSnapshotOptions options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); /* * Shared Folders Functions */ /* * These are the flags describing each shared folder. */ typedef int VixMsgSharedFolderOptions; enum { VIX_SHAREDFOLDER_WRITE_ACCESS = 0x04, }; VixHandle VixVM_EnableSharedFolders(VixHandle vmHandle, Bool enabled, int options, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_GetNumSharedFolders(VixHandle vmHandle, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_GetSharedFolderState(VixHandle vmHandle, int index, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_SetSharedFolderState(VixHandle vmHandle, const char *shareName, const char *hostPathName, VixMsgSharedFolderOptions flags, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_AddSharedFolder(VixHandle vmHandle, const char *shareName, const char *hostPathName, VixMsgSharedFolderOptions flags, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_RemoveSharedFolder(VixHandle vmHandle, const char *shareName, int flags, VixEventProc *callbackProc, void *clientData); /* * Screen Capture */ #ifndef VIX_HIDE_FROM_JAVA enum { VIX_CAPTURESCREENFORMAT_PNG = 0x01, VIX_CAPTURESCREENFORMAT_PNG_NOCOMPRESS = 0x02, }; VixHandle VixVM_CaptureScreenImage(VixHandle vmHandle, int captureType, VixHandle additionalProperties, VixEventProc *callbackProc, void *clientdata); #endif // VIX_HIDE_FROM_JAVA /* * VM Cloning -- */ typedef int VixCloneType; enum { VIX_CLONETYPE_FULL = 0, VIX_CLONETYPE_LINKED = 1, }; VixHandle VixVM_Clone(VixHandle vmHandle, VixHandle snapshotHandle, VixCloneType cloneType, const char *destConfigPathName, int options, VixHandle propertyListHandle, VixEventProc *callbackProc, void *clientData); /* * Misc Functions */ VixHandle VixVM_UpgradeVirtualHardware(VixHandle vmHandle, int options, VixEventProc *callbackProc, void *clientData); enum { VIX_INSTALLTOOLS_MOUNT_TOOLS_INSTALLER = 0x00, VIX_INSTALLTOOLS_AUTO_UPGRADE = 0x01, VIX_INSTALLTOOLS_RETURN_IMMEDIATELY = 0x02 }; VixHandle VixVM_InstallTools(VixHandle vmHandle, int options, const char *commandLineArgs, VixEventProc *callbackProc, void *clientData); /* *----------------------------------------------------------------------------- * * VIX Job -- * *----------------------------------------------------------------------------- */ /* * Synchronization functions * (used to detect when an asynch operation completes). */ VixError VixJob_Wait(VixHandle jobHandle, VixPropertyID firstPropertyID, ...); VixError VixJob_CheckCompletion(VixHandle jobHandle, Bool *complete); /* * Accessor functions * (used to get results of a completed asynch operation). */ VixError VixJob_GetError(VixHandle jobHandle); int VixJob_GetNumProperties(VixHandle jobHandle, int resultPropertyID); VixError VixJob_GetNthProperties(VixHandle jobHandle, int index, int propertyID, ...); /* *----------------------------------------------------------------------------- * * VIX Snapshot -- * *----------------------------------------------------------------------------- */ VixError VixSnapshot_GetNumChildren(VixHandle parentSnapshotHandle, int *numChildSnapshots); VixError VixSnapshot_GetChild(VixHandle parentSnapshotHandle, int index, VixHandle *childSnapshotHandle); VixError VixSnapshot_GetParent(VixHandle snapshotHandle, VixHandle *parentSnapshotHandle); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* _VIX_H_ */ open-vm-tools-10.0.7-3227872/lib/include/productState.h0000644000000000000000000000732612660700526020707 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * productState.h -- * * ProductState is a runtime encapsulation of the identity of a product * and product dependent characteristics. */ #ifndef _PRODUCT_STATE_H_ #define _PRODUCT_STATE_H_ #include "vm_basic_types.h" /* * Public types. */ typedef enum { PRODUCT_GENERIC = 0, PRODUCT_WORKSTATION = 1 << 0, PRODUCT_ESX = 1 << 1, PRODUCT_PLAYER = 1 << 2, PRODUCT_TOOLS = 1 << 3, PRODUCT_VDM_CLIENT = 1 << 4, PRODUCT_CVP = 1 << 5, PRODUCT_FUSION = 1 << 6, PRODUCT_VIEW = 1 << 7, PRODUCT_VMRC = 1 << 8, PRODUCT_GANTRY = 1 << 9, /* etc */ } Product; typedef uint64 ProductMask; #define PRODUCTMASK_HOSTED (PRODUCT_WORKSTATION |\ PRODUCT_PLAYER |\ PRODUCT_CVP |\ PRODUCT_FUSION |\ PRODUCT_VMRC |\ PRODUCT_GANTRY) typedef uint64 ProductCaps; /* * Define as needed. * * #define PRODUCT_CAP_FOO (1 << 0) */ typedef enum { PRODUCTSTATE_FLAG_NONE = 0, PRODUCTSTATE_FLAG_PRODUCT = 1 << 0, PRODUCTSTATE_FLAG_NAME = 1 << 1, PRODUCTSTATE_FLAG_VERSION = 1 << 2, PRODUCTSTATE_FLAG_BUILDNUMBER = 1 << 3, PRODUCTSTATE_FLAG_CAPABILITIES = 1 << 4, PRODUCTSTATE_FLAG_LICENSENAME = 1 << 5, PRODUCTSTATE_FLAG_LICENSEVERSION = 1 << 6, PRODUCTSTATE_FLAG_BUNDLEIDENTIFIER = 1 << 7, } ProductStateSerializationFlags; /* * Public functions. * * PR 567850 * ProductState_Set should only be called once. Subsequent calls will be ignored. */ void ProductState_Set(Product product, const char *name, const char *version, unsigned int buildNumber, ProductCaps capabilities, const char *licenseName, const char *licenseVersion, const char *bundleIdentifier); Product ProductState_GetProduct(void); Bool ProductState_IsProduct(ProductMask product); Bool ProductState_AllowUnlicensedVMX(void); const char *ProductState_GetName(void); const char *ProductState_GetVersion(void); unsigned int ProductState_GetBuildNumber(void); ProductCaps ProductState_GetCapabilities(void); const char *ProductState_GetLicenseName(void); const char *ProductState_GetLicenseVersion(void); /* etc */ const char *ProductState_GetCompilationOption(void); const char *ProductState_GetFullVersion(void); const char *ProductState_GetBuildNumberString(void); const char *ProductState_GetRegistryPath(void); char *ProductState_GetRegistryPathForProduct(const char *productName); const char *ProductState_GetBundleIdentifier(void); void ProductState_GetVersionNumber(unsigned int *major, unsigned int *minor, unsigned int *patchLevel); char *ProductState_Serialize(ProductStateSerializationFlags flags); ProductStateSerializationFlags ProductState_Deserialize(const char *state); #endif /* _PRODUCT_STATE_H_ */ open-vm-tools-10.0.7-3227872/lib/include/util.h0000644000000000000000000004340412660700526017200 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * util.h -- * * misc util functions */ #ifndef UTIL_H #define UTIL_H #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include #include #ifndef VMKBOOT #include #endif #ifdef _WIN32 #ifdef USERLEVEL #include /* Needed for MBCS string functions */ #include /* for definition of HANDLE */ #endif #else #include #include #include "errno.h" #endif #include "vm_assert.h" #include "vm_basic_defs.h" #include "unicodeTypes.h" /* * Define the Util_ThreadID type, and assorted standard bits. */ #if defined(_WIN32) typedef DWORD Util_ThreadID; #elif defined(__linux__) || defined(__ANDROID__) typedef pid_t Util_ThreadID; #elif defined(__APPLE__) # include typedef mach_port_t Util_ThreadID; #elif defined(__sun__) # include typedef thread_t Util_ThreadID; #elif defined(__FreeBSD__) # include typedef pthread_t Util_ThreadID; #else # error "Need typedef for Util_ThreadID" #endif uint32 CRC_Compute(const uint8 *buf, int len); uint32 Util_Checksum32(const uint32 *buf, int len); uint32 Util_Checksum(const uint8 *buf, int len); uint32 Util_Checksumv(void *iov, int numEntries); uint32 Util_HashString(const char *str); char *Util_ExpandString(const char *fileName); void Util_ExitThread(int); NORETURN void Util_ExitProcessAbruptly(int); int Util_HasAdminPriv(void); #if defined _WIN32 && defined USERLEVEL int Util_TokenHasAdminPriv(HANDLE token); int Util_TokenHasInteractPriv(HANDLE token); #endif Bool Util_Data2Buffer(char *buf, size_t bufSize, const void *data0, size_t dataSize); char *Util_GetCanonicalPath(const char *path); #ifdef _WIN32 char *Util_CompatGetCanonicalPath(const char *path); char *Util_GetCanonicalPathForHash(const char *path); char *Util_CompatGetLowerCaseCanonicalPath(const char* path); #endif int Util_BumpNoFds(uint32 *cur, uint32 *wanted); Bool Util_CanonicalPathsIdentical(const char *path1, const char *path2); Bool Util_IsAbsolutePath(const char *path); unsigned Util_GetPrime(unsigned n0); Util_ThreadID Util_GetCurrentThreadId(void); char *Util_DeriveFileName(const char *source, const char *name, const char *ext); char *Util_CombineStrings(char **sources, int count); char **Util_SeparateStrings(char *source, int *count); typedef struct UtilSingleUseResource UtilSingleUseResource; UtilSingleUseResource *Util_SingleUseAcquire(const char *name); void Util_SingleUseRelease(UtilSingleUseResource *res); #ifndef _WIN32 Bool Util_IPv4AddrValid(const char *addr); Bool Util_IPv6AddrValid(const char *addr); Bool Util_IPAddrValid(const char *addr); #endif #if defined(__linux__) || defined(__FreeBSD__) || defined(sun) Bool Util_GetProcessName(pid_t pid, char *bufOut, size_t bufOutSize); #endif #if defined __linux__ && !defined VMX86_SERVER Bool Util_IsPhysicalSSD(const char* device); #endif // backtrace functions and utilities #define UTIL_BACKTRACE_LINE_LEN (511) typedef void (*Util_OutputFunc)(void *data, const char *fmt, ...); void Util_Backtrace(int bugNr); void Util_BacktraceFromPointer(uintptr_t *basePtr); void Util_BacktraceFromPointerWithFunc(uintptr_t *basePtr, Util_OutputFunc outFunc, void *outFuncData); void Util_BacktraceWithFunc(int bugNr, Util_OutputFunc outFunc, void *outFuncData); void Util_BacktraceToBuffer(uintptr_t *basePtr, uintptr_t *buffer, int len); // sleep functions void Util_Usleep(long usec); void Util_Sleep(unsigned int sec); int Util_CompareDotted(const char *s1, const char *s2); /* * This enum defines how Util_GetOpt should handle non-option arguments: * * UTIL_NONOPT_PERMUTE: Permute argv so that all non-options are at the end. * UTIL_NONOPT_STOP: Stop when first non-option argument is seen. (This is * the standard POSIX behavior.) * UTIL_NONOPT_ALL: Return each non-option argument as if it were * an option with character code 1. */ typedef enum { UTIL_NONOPT_PERMUTE, UTIL_NONOPT_STOP, UTIL_NONOPT_ALL } Util_NonOptMode; struct option; int Util_GetOpt(int argc, char * const *argv, const struct option *opts, Util_NonOptMode mode, Bool manualErrorHandling); #if defined(VMX86_STATS) Bool Util_QueryCStResidency(uint32 *numCpus, uint32 *numCStates, uint64 **transitns, uint64 **residency, uint64 **transTime, uint64 **residTime); #endif /* * In util_shared.h */ #define UTIL_FASTRAND_SEED_MAX (0x7fffffff) Bool Util_Throttle(uint32 count); uint32 Util_FastRand(uint32 seed); uint64 Util_CheckSum64(uint32 *data, unsigned numWords); // Not thread safe! void Util_OverrideHomeDir(const char *path); /* *----------------------------------------------------------------------------- * * Util_ValidateBytes -- * * Check that memory is filled with the specified value. * * Results: * NULL No error * !NULL First address that doesn't have the proper value * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void * Util_ValidateBytes(const void *ptr, // IN: ptr to check size_t size, // IN: size of ptr uint8 byteValue) // IN: memory must be filled with this { uint8 *p; uint8 *end; uint64 bigValue; ASSERT(ptr); if (size == 0) { return NULL; } p = (uint8 *) ptr; end = p + size; /* Compare bytes until a "nice" boundary is achieved. */ while ((uintptr_t) p % sizeof bigValue) { if (*p != byteValue) { return p; } p++; if (p == end) { return NULL; } } /* Compare using a "nice sized" chunk for a long as possible. */ memset(&bigValue, (int) byteValue, sizeof bigValue); while (p + sizeof bigValue <= end) { if (*((uint64 *) p) != bigValue) { /* That's not right... let the loop below report the exact address. */ break; } size -= sizeof bigValue; p += sizeof bigValue; } /* Handle any trailing bytes. */ while (p < end) { if (*p != byteValue) { return p; } p++; } return NULL; } /* *---------------------------------------------------------------------- * * Util_BufferIsEmpty -- * * Determine if the specified buffer of 'len' bytes starting at 'base' * is empty (i.e. full of zeroes). * * Results: * TRUE Yes * FALSE No * * Side effects: * None * *---------------------------------------------------------------------- */ static INLINE Bool Util_BufferIsEmpty(void const *base, // IN: size_t len) // IN: { return Util_ValidateBytes(base, len, '\0') == NULL; } Bool Util_MakeSureDirExistsAndAccessible(char const *path, unsigned int mode); #if _WIN32 # define DIRSEPS "\\" # define DIRSEPS_W L"\\" # define DIRSEPC '\\' # define DIRSEPC_W L'\\' # define VALID_DIRSEPS "\\/" # define VALID_DIRSEPS_W L"\\/" # define CUR_DIRS_W L"." # define CUR_DIRC_W L'.' #else # define DIRSEPS "/" # define DIRSEPC '/' # define VALID_DIRSEPS DIRSEPS #endif #define CURR_DIRS "." #define CURR_DIRC '.' /* *----------------------------------------------------------------------- * * Util_Safe[Malloc, Realloc, Calloc, Strdup] and * Util_Safe[Malloc, Realloc, Calloc, Strdup]Bug -- * * These functions work just like the standard C library functions * (except Util_SafeStrdup[,Bug]() accept NULL, see below), * but will not fail. Instead they Panic(), printing the file and * line number of the caller, if the underlying library function * fails. The Util_SafeFnBug functions print bugNumber in the * Panic() message. * * These functions should only be used when there is no way to * gracefully recover from the error condition. * * The internal versions of these functions expect a bug number * as the first argument. If that bug number is something other * than -1, the panic message will include the bug number. * * Since Util_SafeStrdup[,Bug]() do not need to return NULL * on error, they have been extended to accept the null pointer * (and return it). The competing view is that they should * panic on NULL. This is a convenience vs. strictness argument. * Convenience wins. -- edward * * Results: * The freshly allocated memory. * * Side effects: * Panic() if the library function fails. * *-------------------------------------------------------------------------- */ void *UtilSafeMalloc0(size_t size); void *UtilSafeMalloc1(size_t size, int bugNumber, const char *file, int lineno); void *UtilSafeRealloc0(void *ptr, size_t size); void *UtilSafeRealloc1(void *ptr, size_t size, int bugNumber, const char *file, int lineno); void *UtilSafeCalloc0(size_t nmemb, size_t size); void *UtilSafeCalloc1(size_t nmemb, size_t size, int bugNumber, const char *file, int lineno); char *UtilSafeStrdup0(const char *s); char *UtilSafeStrdup1(const char *s, int bugNumber, const char *file, int lineno); char *UtilSafeStrndup0(const char *s, size_t n); char *UtilSafeStrndup1(const char *s, size_t n, int bugNumber, const char *file, int lineno); /* * Debug builds carry extra arguments into the allocation functions for * better error reporting. Non-debug builds don't pay this extra overhead. */ #ifdef VMX86_DEBUG #define Util_SafeMalloc(_size) \ UtilSafeMalloc1((_size), -1, __FILE__, __LINE__) #define Util_SafeMallocBug(_bugNr, _size) \ UtilSafeMalloc1((_size),(_bugNr), __FILE__, __LINE__) #define Util_SafeRealloc(_ptr, _size) \ UtilSafeRealloc1((_ptr), (_size), -1, __FILE__, __LINE__) #define Util_SafeReallocBug(_bugNr, _ptr, _size) \ UtilSafeRealloc1((_ptr), (_size), (_bugNr), __FILE__, __LINE__) #define Util_SafeCalloc(_nmemb, _size) \ UtilSafeCalloc1((_nmemb), (_size), -1, __FILE__, __LINE__) #define Util_SafeCallocBug(_bugNr, _nmemb, _size) \ UtilSafeCalloc1((_nmemb), (_size), (_bugNr), __FILE__, __LINE__) #define Util_SafeStrndup(_str, _size) \ UtilSafeStrndup1((_str), (_size), -1, __FILE__, __LINE__) #define Util_SafeStrndupBug(_bugNr, _str, _size) \ UtilSafeStrndup1((_str), (_size), (_bugNr), __FILE__, __LINE__) #define Util_SafeStrdup(_str) \ UtilSafeStrdup1((_str), -1, __FILE__, __LINE__) #define Util_SafeStrdupBug(_bugNr, _str) \ UtilSafeStrdup1((_str), (_bugNr), __FILE__, __LINE__) #else /* VMX86_DEBUG */ #define Util_SafeMalloc(_size) \ UtilSafeMalloc0((_size)) #define Util_SafeMallocBug(_bugNr, _size) \ UtilSafeMalloc0((_size)) #define Util_SafeRealloc(_ptr, _size) \ UtilSafeRealloc0((_ptr), (_size)) #define Util_SafeReallocBug(_ptr, _size) \ UtilSafeRealloc0((_ptr), (_size)) #define Util_SafeCalloc(_nmemb, _size) \ UtilSafeCalloc0((_nmemb), (_size)) #define Util_SafeCallocBug(_bugNr, _nmemb, _size) \ UtilSafeCalloc0((_nmemb), (_size)) #define Util_SafeStrndup(_str, _size) \ UtilSafeStrndup0((_str), (_size)) #define Util_SafeStrndupBug(_bugNr, _str, _size) \ UtilSafeStrndup0((_str), (_size)) #define Util_SafeStrdup(_str) \ UtilSafeStrdup0((_str)) #define Util_SafeStrdupBug(_bugNr, _str) \ UtilSafeStrdup0((_str)) #endif /* VMX86_DEBUG */ void *Util_Memcpy(void *dest, const void *src, size_t count); /* *----------------------------------------------------------------------------- * * Util_Zero -- * * Zeros out bufSize bytes of buf. NULL is legal. * * Results: * None. * * Side effects: * See above. * *----------------------------------------------------------------------------- */ static INLINE void Util_Zero(void *buf, // OUT size_t bufSize) // IN { if (buf != NULL) { #if defined _WIN32 && defined USERLEVEL /* * Simple memset calls might be optimized out. See CERT advisory * MSC06-C. */ SecureZeroMemory(buf, bufSize); #else memset(buf, 0, bufSize); #if !defined _WIN32 /* * Memset calls before free might be optimized out. See PR1248269. */ __asm__ __volatile__("" : : "r"(&buf) : "memory"); #endif #endif } } /* *----------------------------------------------------------------------------- * * Util_ZeroString -- * * Zeros out a NULL-terminated string. NULL is legal. * * Results: * None. * * Side effects: * See above. * *----------------------------------------------------------------------------- */ static INLINE void Util_ZeroString(char *str) // IN/OUT/OPT { if (str != NULL) { Util_Zero(str, strlen(str)); } } #ifndef VMKBOOT /* *----------------------------------------------------------------------------- * * Util_ZeroFree -- * * Zeros out bufSize bytes of buf, and then frees it. NULL is * legal. * * Results: * None. * * Side effects: * buf is zeroed, and then free() is called on it. * *----------------------------------------------------------------------------- */ static INLINE void Util_ZeroFree(void *buf, // OUT/OPT size_t bufSize) // IN { if (buf != NULL) { Util_Zero(buf, bufSize); free(buf); } } /* *----------------------------------------------------------------------------- * * Util_ZeroFreeString -- * * Zeros out a NULL-terminated string, and then frees it. NULL is * legal. * * Results: * None. * * Side effects: * str is zeroed, and then free() is called on it. * *----------------------------------------------------------------------------- */ static INLINE void Util_ZeroFreeString(char *str) // IN/OUT/OPT { if (str != NULL) { Util_ZeroString(str); free(str); } } #ifdef _WIN32 /* *----------------------------------------------------------------------------- * * Util_ZeroFreeStringW -- * * Zeros out a NUL-terminated wide-character string, and then frees it. * NULL is legal. * * Results: * None. * * Side effects: * str is zeroed, and then free() is called on it. * *----------------------------------------------------------------------------- */ static INLINE void Util_ZeroFreeStringW(wchar_t *str) // IN/OUT/OPT { if (str != NULL) { Util_Zero(str, wcslen(str) * sizeof *str); free(str); } } #endif // _WIN32 /* *----------------------------------------------------------------------------- * * Util_FreeList -- * Util_FreeStringList -- * * Free a list (actually a vector) of allocated objects. * The list (vector) itself is also freed. * * The list either has a specified length or is * argv-style NULL terminated (if length is negative). * * The list can be NULL, in which case no operation is performed. * * Results: * None * * Side effects: * errno or Windows last error is preserved. * *----------------------------------------------------------------------------- */ static INLINE void Util_FreeList(void **list, // IN/OUT/OPT: the list to free ssize_t length) // IN: the length { if (list == NULL) { ASSERT(length <= 0); return; } if (length >= 0) { ssize_t i; for (i = 0; i < length; i++) { free(list[i]); DEBUG_ONLY(list[i] = NULL); } } else { void **s; for (s = list; *s != NULL; s++) { free(*s); DEBUG_ONLY(*s = NULL); } } free(list); } static INLINE void Util_FreeStringList(char **list, // IN/OUT/OPT: the list to free ssize_t length) // IN: the length { Util_FreeList((void **) list, length); } #endif /* *----------------------------------------------------------------------------- * * Util_Memcpy32 -- * * Special purpose version of memcpy that requires nbytes be a * multiple of 4. This assumption lets us have a very small, * inlineable implementation. * * Results: * dst * * Side effects: * See above. * *----------------------------------------------------------------------------- */ static INLINE void * Util_Memcpy32(void *dst, const void *src, size_t nbytes) { ASSERT((nbytes % 4) == 0); #if defined __GNUC__ && (defined(__i386__) || defined(__x86_64__)) do { int dummy0, dummy1, dummy2; __asm__ __volatile__( "cld \n\t" "rep ; movsl" "\n\t" : "=&c" (dummy0), "=&D" (dummy1), "=&S" (dummy2) : "0" (nbytes / 4), "1" ((long) dst), "2" ((long) src) : "memory", "cc" ); return dst; } while (0); #else return memcpy(dst, src, nbytes); #endif } #endif /* UTIL_H */ open-vm-tools-10.0.7-3227872/lib/include/msgList.h0000644000000000000000000000422012660700526017636 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * msgList.h -- * * Utilities to manipulate (stateless) lists of messages. */ #ifndef _MSGLIST_H_ #define _MSGLIST_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include #include #include "vm_basic_types.h" #include "msgid.h" #include "msgfmt.h" /* * Data structures, types, and constants */ typedef struct MsgList MsgList; struct MsgList { MsgList *next; char *id; char *format; MsgFmt_Arg *args; int numArgs; }; /* * Functions */ MsgList *MsgList_Create(const char *idFmt, ...) PRINTF_DECL(1, 2); MsgList *MsgList_VCreate(const char *idFmt, va_list args); MsgList *MsgList_CreateStr(const char *id); void MsgList_Append(MsgList **tail, const char *idFmt, ...) PRINTF_DECL(2, 3); void MsgList_VAppend(MsgList **tail, const char *idFmt, va_list args); void MsgList_AppendStr(MsgList **tail, const char *id); void MsgList_AppendMsgList(MsgList **tail, MsgList *messages); void MsgList_Log(const MsgList *messages); char *MsgList_ToString(const MsgList *messages); MsgList *MsgList_Copy(const MsgList *src); void MsgList_Free(MsgList *messages); const char *MsgList_GetMsgID(const MsgList *messages); Bool MsgList_Present(const MsgList *messages); #endif // ifndef _MSGLIST_H_ open-vm-tools-10.0.7-3227872/lib/include/hgfsBd.h0000644000000000000000000000403312660700526017413 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #ifndef _HGFS_BD_H_ # define _HGFS_BD_H_ /* * hgfsBd.h -- * * Backdoor calls used by hgfs clients. */ #include "rpcout.h" char *HgfsBd_GetBuf(void); char *HgfsBd_GetLargeBuf(void); void HgfsBd_PutBuf(char *); RpcOut *HgfsBd_GetChannel(void); Bool HgfsBd_CloseChannel(RpcOut *out); int HgfsBd_Dispatch(RpcOut *out, char *packetIn, size_t *packetSize, char const **packetOut); Bool HgfsBd_Enabled(RpcOut *out, char *requestPacket); Bool HgfsBd_OpenBackdoor(RpcOut **out); Bool HgfsBd_CloseBackdoor(RpcOut **out); #endif // _HGFS_BD_H_ open-vm-tools-10.0.7-3227872/lib/include/win32util.h0000644000000000000000000002165212660700526020064 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * Win32Util.h -- * * misc Windows utilities */ #ifndef WIN32UTIL_H_ #define WIN32UTIL_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_atomic.h" #include "unicodeTypes.h" #ifdef _WIN32 #include /* Type definitions */ typedef enum AutorunState { AUTORUN_UNDEFINED, AUTORUN_ON, AUTORUN_OFF } AutorunState; /* Defines */ #define VMX_SHUTDOWN_ORDER 0x100 // Application reserved last shutdown range. #define UI_SHUTDOWN_ORDER 0x300 // Application reserved first shutdown range. #define TOOLS_SHUTDOWN_ORDER 0x100 // Application reserved last shutdown range /* Function declarations */ char * W32Util_GetInstallPath(void); char * W32Util_GetInstallPath64(void); /* * The string returned is allocated on the heap and must be freed by the * calling routine. */ char *W32Util_GetAppDataFilePath(const char *fileName); char *W32Util_GetLocalAppDataFilePath(const char *fileName); char *W32Util_GetCommonAppDataFilePath(const char *fileName); char *W32Util_GetVmwareCommonAppDataFilePath(const char *fileName); char *W32Util_GetMyDocumentPath(void); char *W32Util_GetMyVideoPath(BOOL myDocumentsOnFail); char *W32Util_GetDefaultVMPath(const char *pref); char *W32Util_GetInstalledFilePath(const char *fileName); char *W32Util_GetInstalledFilePath64(const char *fileName); HKEY W32Util_OpenProductRegKey(REGSAM access); HKEY W32Util_OpenUserRegKey(REGSAM access); LPTOP_LEVEL_EXCEPTION_FILTER W32Util_SetUnhandledExceptionFilter(void); Bool W32Util_CreateProcessArgv(const char *lpApplicationName, const char **argv, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, const char *lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation); void W32Util_SplitCommandLine(char *commandLine, int maxArgs, char *progName, int *argc, char **argv); BOOL W32Util_ReadFileTimeout(HANDLE hFile, // handle of file to read LPVOID lpBuffer, // pointer to buffer that receives data DWORD nNumberOfBytesToRead, // number of bytes to read LPDWORD lpNumberOfBytesRead, // pointer to number of bytes read DWORD msTimeout); // timeout in milliseconds BOOL W32Util_WriteFileTimeout(HANDLE hFile, // handle to file to write to LPCVOID lpBuffer, // pointer to data to write to file DWORD nNumberOfBytesToWrite, // number of bytes to write LPDWORD lpNumberOfBytesWritten, // pointer to number of bytes written DWORD msTimeout); // timeout in milliseconds char *W32Util_RealPath(const char *path); BOOL W32Util_CheckForPrivilegeHeld(HANDLE token, LPCTSTR priv); typedef BOOL (*SidFilterFunction)(PSID psid, void *cbData); BOOL W32Util_GetEffectiveRightsForName(const char *user, const char *path, DWORD *rights); BOOL W32Util_GetEffectiveRightsForSid(PSID psid, const char *path, DWORD *rights); BOOL W32Util_ModifyRights(PSID psid, const char *path, DWORD rights, BOOL isAllow); void W32Util_FreeSids(PSID *sidList); BOOL W32Util_GetMatchingSids(const char *path, PSID **psidList, SidFilterFunction matchCb, void *cbData); LPSTR W32Util_WideStrToAsciiStr(LPCWSTR wideStr); LPWSTR W32Util_AsciiStrToWideStr(LPCSTR multiStr); LPSTR W32Util_WideStrToMultiByteStr(LPCWSTR wideStr, UINT codePage); LPWSTR W32Util_MultiByteStrToWideStr(LPCSTR multiStr, UINT codePage); BOOL W32Util_WinSockAddReference(void); BOOL W32Util_WinSockDereference(void); Bool W32Util_RegisterService(Bool bRegister, const char *name, const char *displayName, const char *description, const char *binaryPath, char **errString); Bool W32Util_DebugService(const char *dbgFile); Bool W32Util_RegisterEventLog(const char *serviceName, Bool registryVolatile, DWORD typesSupported, const char *eventMsgFile, const char *categoryMsgFile, DWORD categoryCount, const char *paramMsgFile); Bool W32Util_UnregisterEventLog(const char *serviceName); typedef enum SetSDPrivsAccounts { SDPRIV_GROUP_ADMIN = 0x1, SDPRIV_GROUP_VMWARE = 0x2, SDPRIV_USER_CURRENT = 0x4, } SetSDPrivsAccounts; Bool W32Util_SetSDPrivs(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD accessType, SetSDPrivsAccounts accounts, PACL *pAcl, char **errString); BOOL W32Util_SetSecurityDescriptorW(PSECURITY_DESCRIPTOR pSecurityDescriptor, const char *Owner, PACL *pAcl); BOOL W32Util_SetSecurityDescriptorSid(PSECURITY_DESCRIPTOR sd, PSID sid, PACL *pAcl); BOOL W32Util_GetThreadHandle(HANDLE *handle); Bool W32Util_AccessCheck(HANDLE token, PSECURITY_DESCRIPTOR pSecurityDescriptor, int desiredAccess); Bool W32Util_HasAccessToFile(const char *filename, ACCESS_MASK desiredAccess, HANDLE token); Bool W32Util_GetSecurityDescriptor(const char *path, PSECURITY_DESCRIPTOR *ppSecurityDescriptor); void W32Util_InitStdioConsole(void); void W32Util_ExitStdioConsole(void); Bool W32Util_CreateWellKnownSid(WELL_KNOWN_SID_TYPE wsdType, PSID domainSid, PSID *pSid); Bool W32Util_GetCurrentUserSid(PSID *pSid); Bool W32Util_GetLocalAdminGroupSid(PSID *pSid); Bool W32Util_GetVMwareGroupSid(PSID *pSid); Bool W32Util_MakeSafeDirectory(const char *path); Bool W32Util_IsDirectorySafe(const char *path); Bool W32Util_DoesVolumeSupportAcls(const char *path); Bool W32Util_GetRegistryAutorun(AutorunState* state); Bool W32Util_SetRegistryAutorun(const AutorunState state); Bool W32Util_AllowAdminCOM(void); char * W32Util_GetAppDataPath(void); char * W32Util_RobustGetLongPath(const char *path); typedef enum SecureObjectType { SecureObject_Process, SecureObject_Thread } SecureObjectType; PSECURITY_DESCRIPTOR W32Util_ConstructSecureObjectSD(HANDLE hToken, SecureObjectType type); Bool W32Util_ReplaceObjectSD(HANDLE hObject, const PSECURITY_DESCRIPTOR pSD); HMODULE W32Util_GetModuleByAddress(const void *addr); Bool W32Util_VerifyXPModeHostLicense(void); char * W32Util_GetPipeNameFromFilePath(const char *fileName); Bool W32Util_CheckGroupMembership(HANDLE hToken, BOOL respectUAC, char * *errString, BOOL *bMember); Bool W32Util_DismountVolumes(uint16 drive, uint64 offset, uint64 size, void **handle); Bool W32Util_CloseDismountHandle(void *handle); Bool W32Util_EnableSafePathSearching(void); CRITICAL_SECTION *W32Util_GetSingletonCriticalSection(Atomic_Ptr *csMemory); #endif // _WIN32 #endif // WIN32UTIL_H_ open-vm-tools-10.0.7-3227872/lib/include/vm_procps.h0000644000000000000000000000517512660700526020236 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * vm_procps.h -- * * Provides an interface to Linux's libproc.so. * * The upstream procps package is structured such that most Linux * distributions do not provide a libproc-dev package containing the * interface to libproc.so. Instead, we provide this header containing * just enough bits and pieces of the procps headers to satisfy our needs. */ #ifndef _VM_PROCPS_H_ #define _VM_PROCPS_H_ /* * The getstat() function below makes use of restricted pointers (added in C99) * and the 'jiff' type. */ #if !defined(restrict) && __STDC_VERSION__ < 199901 # if __GNUC__ > 2 || __GNUC_MINOR__ >= 92 # define restrict __restrict__ # else # warning No restrict keyword? # define restrict # endif #endif typedef unsigned long long jiff; /* * Global variables */ extern unsigned long long Hertz; extern unsigned long kb_main_buffers; extern unsigned long kb_main_cached; extern unsigned long kb_main_free; extern unsigned long kb_active; extern unsigned long kb_inactive; /* * Global functions */ extern void getstat(jiff *restrict cuse, jiff *restrict cice, jiff *restrict csys, jiff *restrict cide, jiff *restrict ciow, jiff *restrict cxxx, jiff *restrict cyyy, jiff *restrict czzz, unsigned long *restrict pin, unsigned long *restrict pout, unsigned long *restrict s_in, unsigned long *restrict sout, unsigned *restrict intr, unsigned *restrict ctxt, unsigned int *restrict running, unsigned int *restrict blocked, unsigned int *restrict btime, unsigned int *restrict processes); extern void meminfo(void); #endif // ifndef _VM_PROCPS_H_ open-vm-tools-10.0.7-3227872/lib/include/x86_basic_defs.h0000644000000000000000000002064412660700526021013 0ustar rootroot/********************************************************* * Copyright (C) 2006-2013 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * x86_basic_defs.h -- * * Basic macros describing the x86 architecture. */ #ifndef _X86_BASIC_DEFS_H_ #define _X86_BASIC_DEFS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #define X86_MAX_INSTR_LEN 15 /* Max byte length of an x86 instruction. */ #define NUM_IDT_VECTORS 256 /* * control registers */ #define CR0_PE 0x00000001 #define CR0_MP 0x00000002 #define CR0_EM 0x00000004 #define CR0_TS 0x00000008 #define CR0_ET 0x00000010 #define CR0_NE 0x00000020 #define CR0_WP 0x00010000 #define CR0_AM 0x00040000 #define CR0_NW 0x20000000 #define CR0_CD 0x40000000 #define CR0_PG 0x80000000 #define CR0_RESERVED CONST64U(0xffffffff1ffaffc0) #define CR3_PWT 0x00000008 #define CR3_PCD 0x00000010 #define CR3_PDB_SHIFT 12 #define CR3_PDB_MASK 0xfffff000 #define CR3_IGNORE 0xFFF #define PAE_CR3_IGNORE 0x1F #define CR3_PCID_MASK 0xFFF #define CR3_NO_FLUSH (1ULL << 63) #define CR4_VME 0x00000001 #define CR4_PVI 0x00000002 #define CR4_TSD 0x00000004 #define CR4_DE 0x00000008 #define CR4_PSE 0x00000010 #define CR4_PAE 0x00000020 #define CR4_MCE 0x00000040 #define CR4_PGE 0x00000080 #define CR4_PCE 0x00000100 #define CR4_OSFXSR 0x00000200 // CPU/OS supports SIMD insts #define CR4_OSXMMEXCPT 0x00000400 // #XF exception enable PIII only #define CR4_VMXE 0x00002000 #define CR4_SMXE 0x00004000 #define CR4_FSGSBASE 0x00010000 #define CR4_PCIDE 0x00020000 #define CR4_OSXSAVE 0x00040000 #define CR4_SMEP 0x00100000 #define CR4_SMAP 0x00200000 /* Removing a bit from CR4_RESERVED causes Task_Switch to leave the bit set. */ #define CR4_RESERVED CONST64U(0xffffffffffc89800) #define CR8_RESERVED CONST64U(0xfffffffffffffff0) /* * Debug registers. */ #define DR_COUNT 4 #define DR6_B0 0x00000001 #define DR6_B1 0x00000002 #define DR6_B2 0x00000004 #define DR6_B3 0x00000008 #define DR6_B0123 (DR6_B0 | DR6_B1 | DR6_B2 | DR6_B3) #define DR6_B(_n) (1 << (_n)) #define DR6_BD 0x00002000 #define DR6_BS 0x00004000 #define DR6_BT 0x00008000 #define DR6_RTM 0x00010000 #define DR6_ONES 0xfffe0ff0 #define DR6_DEFAULT (DR6_ONES | DR6_RTM) #define DR6_RESERVED_MASK 0xfffe1ff0 #define DR7_L_MASK(_n) (1 << ((_n) * 2)) #define DR7_G_MASK(_n) (1 << ((_n) * 2 + 1)) #define DR7_LG_MASK(_n) (3 << ((_n) * 2)) #define DR7_RW_MASK(_n) (3 << (16 + (_n) * 4)) #define DR7_LEN_MASK(_n) (3 << (18 + (_n) * 4)) #define DR7_BP_MASK(_n) (DR7_L_MASK(_n) |\ DR7_G_MASK(_n) |\ DR7_RW_MASK(_n) |\ DR7_LEN_MASK(_n)) #define DR7_L0 DR7_L_MASK(0) #define DR7_G0 DR7_G_MASK(0) #define DR7_L1 DR7_L_MASK(1) #define DR7_G1 DR7_G_MASK(1) #define DR7_L2 DR7_L_MASK(2) #define DR7_G2 DR7_G_MASK(2) #define DR7_L3 DR7_L_MASK(3) #define DR7_G3 DR7_G_MASK(3) #define DR7_ENABLED 0x000000ff #define DR7_LE 0x00000100 // Deprecated in modern hardware #define DR7_GE 0x00000200 // Deprecated in modern hardware #define DR7_GD 0x00002000 #define DR7_ONES 0x00000400 #define DR7_RTM 0x00000800 #define DR7_RESERVED CONST64U(0xffffffff0000d400) #define DR7_DEFUNCT (DR7_LE | DR7_GE) #define DR7_DEFAULT DR7_ONES #define DR7_LX_MASK (DR7_L0 | DR7_L1 | DR7_L2 | DR7_L3 | DR7_LE) #define DR7_GX_MASK (DR7_G0 | DR7_G1 | DR7_G2 | DR7_G3 | DR7_GE) #define DR7_LGX_MASK (DR7_LX_MASK | DR7_GX_MASK) #define DR7_RW(_r,_n) (((_r) >> (16+(_n)*4)) & 0x3) #define DR7_L(_r,_n) (((_r) >> ((_n)*2)) & 1) #define DR7_G(_r,_n) (((_r) >> (1 + (_n)*2)) & 1) #define DR7_LEN(_r,_n) (((_r) >> (18+(_n)*4)) & 0x3) #define DR7_RW_BITS(_n,_rw) ((_rw) << (16 + (_n) * 4)) #define DR7_LEN_BITS(_n,_len) ((_len) << (18 + (_n) * 4)) #define DR7_RW_INST 0x0 #define DR7_RW_WRITES 0x1 #define DR7_RW_IO 0x2 #define DR7_RW_ACCESS 0x3 #define DR7_LENGTH_1 0x0 #define DR7_LENGTH_2 0x1 #define DR7_LENGTH_8 0x2 #define DR7_LENGTH_4 0x3 #define DEBUG_STATUS_B0 (1<<0) #define DEBUG_STATUS_B1 (1<<1) #define DEBUG_STATUS_B2 (1<<2) #define DEBUG_STATUS_B3 (1<<3) #define DEBUG_STATUS_DB (1<<13) #define DEBUG_STATUS_BS (1<<14) #define DEBUG_STATUS_BT (1<<15) /* * exception error codes */ #define EXC_DE 0 #define EXC_DB 1 #define EXC_NMI 2 #define EXC_BP 3 #define EXC_OF 4 #define EXC_BR 5 #define EXC_UD 6 #define EXC_NM 7 #define EXC_DF 8 #define EXC_TS 10 #define EXC_NP 11 #define EXC_SS 12 #define EXC_GP 13 #define EXC_PF 14 #define EXC_MF 16 #define EXC_AC 17 #define EXC_MC 18 #define EXC_XF 19 /* SIMD exception. */ #define EXC_SX 30 /* Security exception (SVM only). */ /* * eflag/rflag definitions. */ #define EFLAGS_IOPL_SHIFT 12 typedef enum x86_FLAGS { EFLAGS_NONE = 0, EFLAGS_CF = (1 << 0), /* User */ EFLAGS_SET = (1 << 1), EFLAGS_PF = (1 << 2), /* User */ EFLAGS_AF = (1 << 4), /* User */ EFLAGS_ZF = (1 << 6), /* User */ EFLAGS_SF = (1 << 7), /* User */ EFLAGS_TF = (1 << 8), /* Priv */ EFLAGS_IF = (1 << 9), /* Priv */ EFLAGS_DF = (1 << 10), /* User */ EFLAGS_OF = (1 << 11), /* User */ EFLAGS_NT = (1 << 14), /* Priv */ EFLAGS_RF = (1 << 16), /* Priv */ EFLAGS_VM = (1 << 17), /* Priv */ EFLAGS_AC = (1 << 18), /* Priv */ EFLAGS_VIF = (1 << 19), /* Priv */ EFLAGS_VIP = (1 << 20), /* Priv */ EFLAGS_ID = (1 << 21), /* Priv */ EFLAGS_IOPL = 3 << EFLAGS_IOPL_SHIFT, EFLAGS_ARITH = (EFLAGS_CF | EFLAGS_PF | EFLAGS_AF | EFLAGS_ZF | EFLAGS_SF | EFLAGS_OF), EFLAGS_USER = (EFLAGS_CF | EFLAGS_PF | EFLAGS_AF | EFLAGS_ZF | EFLAGS_SF | EFLAGS_DF | EFLAGS_OF), EFLAGS_PRIV = (EFLAGS_TF | EFLAGS_IF | EFLAGS_IOPL | EFLAGS_NT | EFLAGS_RF | EFLAGS_VM | EFLAGS_AC | EFLAGS_VIF | EFLAGS_VIP | EFLAGS_ID), EFLAGS_ALL = (EFLAGS_CF | EFLAGS_PF | EFLAGS_AF | EFLAGS_ZF | EFLAGS_SF | EFLAGS_DF | EFLAGS_OF | EFLAGS_TF | EFLAGS_IF | EFLAGS_IOPL | EFLAGS_NT | EFLAGS_RF | EFLAGS_VM | EFLAGS_AC | EFLAGS_VIF | EFLAGS_VIP | EFLAGS_ID), EFLAGS_ALL_16 = EFLAGS_ALL & 0xffff, EFLAGS_REAL_32 = (EFLAGS_ALL & ~(EFLAGS_VIP | EFLAGS_VIF | EFLAGS_VM)), EFLAGS_V8086_32 = (EFLAGS_ALL & ~(EFLAGS_VIP | EFLAGS_VIF | EFLAGS_VM | EFLAGS_IOPL)), EFLAGS_REAL_16 = EFLAGS_REAL_32 & 0xffff, EFLAGS_V8086_16 = EFLAGS_V8086_32 & 0xffff, EFLAGS_CLEAR_ON_EXC = (EFLAGS_TF | EFLAGS_VM | EFLAGS_RF | EFLAGS_NT), EFLAGS__4 = 0x7fffffff /* ensure 4 byte encoding */ } x86_FLAGS; #endif // ifndef _VM_BASIC_DEFS_H_ open-vm-tools-10.0.7-3227872/lib/include/codeset.h0000644000000000000000000004212412660700526017647 0ustar rootroot/* ********************************************************** * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * **********************************************************/ /* * codeset.h -- * * UTF-16 handling macros. Based on utf16.h from ICU 1.8.1. * * ICU 1.8.1 license follows: * * ICU License - ICU 1.8.1 and later * * COPYRIGHT AND PERMISSION NOTICE * * Copyright (c) 1995-2006 International Business Machines Corporation * and others * * All rights reserved. * * 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, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, provided that the above * copyright notice(s) and this permission notice appear in all * copies of the Software and that both the above copyright * notice(s) and this permission notice appear in supporting * documentation. * * 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 OF THIRD PARTY RIGHTS. IN NO EVENT * SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE * BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR * CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * Except as contained in this notice, the name of a * copyright holder shall not be used in advertising or otherwise * to promote the sale, use or other dealings in this Software * without prior written authorization of the copyright holder. */ #ifndef __CODESET_H__ # define __CODESET_H__ #include "vm_basic_types.h" #include "vm_assert.h" #include "dynbuf.h" /* * These platforms use UTF-8 (or pretend to): * FreeBSD: really UTF-8 * ESX: UTF-8 by policy decree * Mac: really UTF-8 */ #if defined(__FreeBSD__) || \ defined(VMX86_SERVER) || \ defined(__APPLE__) || \ defined __ANDROID__ #define CURRENT_IS_UTF8 #endif /* * Guard these defines, borrowed from ICU's utf16.h, so that source files * can include both. */ #ifndef __UTF16_H__ /** * Is this code point a surrogate (U+d800..U+dfff)? * @param c 32-bit code point * @return TRUE or FALSE * @stable ICU 2.4 */ #define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800) /** * Does this code unit alone encode a code point (BMP, not a surrogate)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SINGLE(c) (!U_IS_SURROGATE(c)) /** * Is this code unit a lead surrogate (U+d800..U+dbff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_LEAD(c) (((c)&0xfffffc00)==0xd800) /** * Is this code unit a trail surrogate (U+dc00..U+dfff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00) /** * Is this code unit a surrogate (U+d800..U+dfff)? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SURROGATE(c) U_IS_SURROGATE(c) /** * Assuming c is a surrogate code point (U16_IS_SURROGATE(c)), * is it a lead surrogate? * @param c 16-bit code unit * @return TRUE or FALSE * @stable ICU 2.4 */ #define U16_IS_SURROGATE_LEAD(c) (((c)&0x400)==0) /** * Helper constant for U16_GET_SUPPLEMENTARY. * @internal */ #define U16_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000) /** * Get a supplementary code point value (U+10000..U+10ffff) * from its lead and trail surrogates. * The result is undefined if the input values are not * lead and trail surrogates. * * @param lead lead surrogate (U+d800..U+dbff) * @param trail trail surrogate (U+dc00..U+dfff) * @return supplementary code point (U+10000..U+10ffff) * @stable ICU 2.4 */ #define U16_GET_SUPPLEMENTARY(lead, trail) \ (((uint32)(lead)<<10UL)+(uint32)(trail)-U16_SURROGATE_OFFSET) /** * Get the lead surrogate (0xd800..0xdbff) for a * supplementary code point (0x10000..0x10ffff). * @param supplementary 32-bit code point (U+10000..U+10ffff) * @return lead surrogate (U+d800..U+dbff) for supplementary * @stable ICU 2.4 */ #define U16_LEAD(supplementary) ((utf16_t)(((supplementary)>>10)+0xd7c0)) /** * Get the trail surrogate (0xdc00..0xdfff) for a * supplementary code point (0x10000..0x10ffff). * @param supplementary 32-bit code point (U+10000..U+10ffff) * @return trail surrogate (U+dc00..U+dfff) for supplementary * @stable ICU 2.4 */ #define U16_TRAIL(supplementary) ((utf16_t)(((supplementary)&0x3ff)|0xdc00)) /** * How many 16-bit code units are used to encode this Unicode code point? (1 or 2) * The result is not defined if c is not a Unicode code point (U+0000..U+10ffff). * @param c 32-bit code point * @return 1 or 2 * @stable ICU 2.4 */ #define U16_LENGTH(c) ((uint32)(c)<=0xffff ? 1 : 2) /** * The maximum number of 16-bit code units per Unicode code point (U+0000..U+10ffff). * @return 2 * @stable ICU 2.4 */ #define U16_MAX_LENGTH 2 /** * Get a code point from a string at a code point boundary offset, * and advance the offset to the next code point boundary. * (Post-incrementing forward iteration.) * "Safe" macro, handles unpaired surrogates and checks for string boundaries. * * The offset may point to the lead surrogate unit * for a supplementary code point, in which case the macro will read * the following trail surrogate as well. * If the offset points to a trail surrogate or * to a single, unpaired lead surrogate, then that itself * will be returned as the code point. * * @param s const utf16_t * string * @param i string offset, must be i(start) && U16_IS_LEAD(__c2=(s)[(i)-1])) { \ --(i); \ (c)=U16_GET_SUPPLEMENTARY(__c2, (c)); \ } \ } \ } #endif // __UTF16_H__ /* * Use this instead of "UTF-16" to specify UTF-16 in native byte order. */ #define CODESET_NATIVE_UTF16 "UTF-16LE" /* * Flags for conversion functions */ #define CSGTG_NORMAL 0x0000 /* Without any information loss. */ #define CSGTG_TRANSLIT 0x0001 /* Transliterate unknown characters. */ #define CSGTG_IGNORE 0x0002 /* Skip over untranslatable characters. */ /* * XXX -- this function is a temporary fix. It should be removed once we fix * the 3rd party library pathname issue. */ char * CodeSet_GetAltPathName(const utf16_t *pathW); // IN Bool CodeSet_Init(const char *icuDataDir); // IN: ICU datafile directory in current page, // can be NULL. void CodeSet_DontUseIcu(void); Bool CodeSet_GenericToGenericDb(const char *codeIn, // IN const char *bufIn, // IN size_t sizeIn, // IN const char *codeOut, // IN unsigned int flags, // IN DynBuf *db); // IN/OUT Bool CodeSet_GenericToGeneric(const char *codeIn, // IN const char *bufIn, // IN size_t sizeIn, // IN const char *codeOut, // IN unsigned int flags, // IN char **bufOut, // IN/OUT size_t *sizeOut); // IN/OUT Bool CodeSet_Utf8ToCurrent(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT Bool CodeSet_CurrentToUtf8(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT Bool CodeSet_Utf16leToUtf8Db(const char *bufIn, // IN size_t sizeIn, // IN DynBuf *db); // IN Bool CodeSet_Utf16leToUtf8(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT Bool CodeSet_Utf8ToUtf16le(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT Bool CodeSet_CurrentToUtf16le(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT Bool CodeSet_Utf16leToCurrent(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT Bool CodeSet_Utf16beToCurrent(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT Bool CodeSetOld_Utf8Normalize(const char *bufIn, // IN size_t sizeIn, // IN Bool precomposed, // IN DynBuf *db); // OUT Bool CodeSet_Utf8FormDToUtf8FormC(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT Bool CodeSet_Utf8FormCToUtf8FormD(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT/OPT const char * CodeSet_GetCurrentCodeSet(void); Bool CodeSet_IsEncodingSupported(const char *name); // IN: Bool CodeSet_Validate(const char *buf, // IN: the string size_t size, // IN: length of string const char *code); // IN: encoding Bool CodeSet_UTF8ToUTF32(const char *utf8, // IN: char **utf32); // OUT: Bool CodeSet_UTF32ToUTF8(const char *utf32, // IN: char **utf8); // OUT: int CodeSet_LengthInCodePoints(const char *utf8); // IN: int CodeSet_CodePointOffsetToByteOffset(const char *utf8, // IN: int codePointOffset); // IN: int CodeSet_GetUtf8(const char *string, // IN: const char *end, // IN: uint32 *uchar); // OUT/OPT: /* *----------------------------------------------------------------------------- * * CodeSet_Utf8ToUtf16 -- * * A convenience wrapper that accepts a NUL-terminated UTF-8 string * and returns an allocated UTF-16 (LE) string. ASSERTs on failure. * * Results: * The allocted UTF-16 (LE) string, free with free(). * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE utf16_t * CodeSet_Utf8ToUtf16(const char *str) // IN: { utf16_t *strW; if (!CodeSet_Utf8ToUtf16le(str, strlen(str), (char **) &strW, NULL)) { NOT_IMPLEMENTED(); } return strW; } /* *----------------------------------------------------------------------------- * * CodeSet_Utf16ToUtf8 -- * * A convenience wrapper that accepts a NUL-terminated UTF-16 (LE) * string and returns an allocated UTF-8 string. ASSERTs on failure. * * Results: * The allocted UTF-8 string, free with free(). * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE char * CodeSet_Utf16ToUtf8(const utf16_t *strW) // IN: { char *str; size_t len; for (len = 0; strW[len]; len++) ; if (!CodeSet_Utf16leToUtf8((const char *) strW, len * sizeof strW[0], (char **) &str, NULL)) { NOT_IMPLEMENTED(); } return str; } /* *----------------------------------------------------------------------------- * * CodeSet_Utf8FindCodePointBoundary * * Determine if buf[offset] is a valid UTF-8 code point boundary * and find the previous boundary if it is not. The contents of * buf[offset] need not be defined, only data prior to this * location is examined. Useful for finding a suitable place to * put a NUL terminator. * * Results: * * Returns the offset of the byte immediately following the last * complete UTF-8 code point in buf that is entirely within the * range [0, offset-1]. Note that if the final UTF-8 code point * is complete, the input offset will be returned unchanged. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE size_t CodeSet_Utf8FindCodePointBoundary(const char *buf, // IN size_t offset) // IN { size_t origOffset = offset; signed char c; if (offset > 0) { /* * Back up 1 byte and then find the start of the UTF-8 code * point occupying that location. */ offset--; while (offset > 0 && (buf[offset] & 0xc0) == 0x80) { offset--; } /* * Maximum UTF-8 code point length is 4 */ ASSERT(origOffset - offset <= 4); c = buf[offset]; /* * The first byte of a UTF-8 code point needs to be one of * 0b0XXXXXXX, 0b110XXXXX, 0b1110XXXX, 0b11110XXX */ ASSERT(c >= 0 || (c >> 5) == -2 || (c >> 4) == -2 || (c >> 3) == -2); /* * offset now points to the start of a UTF-8 code point. If it * is a single byte or if the length, as encoded in the first * byte, matches the number of bytes we have backed up, then the * entire code point is present, so the original offset is a * valid code point starting offset. * * Length is encoded as * 2 bytes: 0b110XXXXX * 3 bytes: 0b1110XXXX * 4 bytes: 0b11110XXX * Thus the first byte is -2 when shifted right (signed) by * (7 - length). */ if (c >= 0 || (c >> (7 - origOffset + offset)) == -2) { return origOffset; } /* * Else we truncated a code point. Return its starting point. */ } return offset; } /* *----------------------------------------------------------------------------- * * CodeSet_Utf16FindCodePointBoundary * * Determine if buf[offset] is a valid UTF-16 code point boundary * and find the previous boundary if it is not. The contents of * buf[offset] need not be defined, only data prior to this * location is examined. Useful for finding a suitable place to * put a NUL terminator. * * Results: * * Returns the offset of the byte immediately following the last * complete UTF-16 code point in buf that is entirely within the * range [0, offset-1]. Note that if the final UTF-16 code point * is complete, the input offset will be returned unchanged. * * Side effects: * None * *----------------------------------------------------------------------------- */ static INLINE size_t CodeSet_Utf16FindCodePointBoundary(const char *buf, // IN size_t offset) // IN { size_t origOffset; const utf16_t *utf16Buf = (const utf16_t *)buf; origOffset = offset / 2; offset = origOffset - 1; if (origOffset > 0 && U16_IS_LEAD(utf16Buf[offset])) { return offset * 2; } return origOffset * 2; } #endif /* __CODESET_H__ */ open-vm-tools-10.0.7-3227872/lib/include/ghIntegrationCommon.h0000644000000000000000000000241512660700526022173 0ustar rootroot/********************************************************* * Copyright (C) 2008-2014 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * ghIntegrationCommon.h -- * * Common data structures and definitions used by Guest/Host Integration. */ #ifndef _GHINTEGRATIONCOMMON_H_ #define _GHINTEGRATIONCOMMON_H_ /* * Common data structures and definitions used by Guest/Host Integration. */ #define GHI_HGFS_SHARE_URL_UTF8 "x-vmware-share://" #define GHI_HGFS_SHARE_URL _T(GHI_HGFS_SHARE_URL_UTF8) #endif // ifndef _GHINTEGRATIONCOMMON_H_ open-vm-tools-10.0.7-3227872/lib/include/vmci_defs.h0000644000000000000000000006671412660700526020173 0ustar rootroot/********************************************************* * Copyright (C) 2005-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _VMCI_DEF_H_ #define _VMCI_DEF_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMMEXT #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #include "includeCheck.h" #include "vm_basic_types.h" #include "vm_basic_defs.h" #include "vm_atomic.h" #include "vm_assert.h" /* Register offsets. */ #define VMCI_STATUS_ADDR 0x00 #define VMCI_CONTROL_ADDR 0x04 #define VMCI_ICR_ADDR 0x08 #define VMCI_IMR_ADDR 0x0c #define VMCI_DATA_OUT_ADDR 0x10 #define VMCI_DATA_IN_ADDR 0x14 #define VMCI_CAPS_ADDR 0x18 #define VMCI_RESULT_LOW_ADDR 0x1c #define VMCI_RESULT_HIGH_ADDR 0x20 /* Max number of devices. */ #define VMCI_MAX_DEVICES 1 /* Status register bits. */ #define VMCI_STATUS_INT_ON 0x1 /* Control register bits. */ #define VMCI_CONTROL_RESET 0x1 #define VMCI_CONTROL_INT_ENABLE 0x2 #define VMCI_CONTROL_INT_DISABLE 0x4 /* Capabilities register bits. */ #define VMCI_CAPS_HYPERCALL 0x1 #define VMCI_CAPS_GUESTCALL 0x2 #define VMCI_CAPS_DATAGRAM 0x4 #define VMCI_CAPS_NOTIFICATIONS 0x8 /* Interrupt Cause register bits. */ #define VMCI_ICR_DATAGRAM 0x1 #define VMCI_ICR_NOTIFICATION 0x2 /* Interrupt Mask register bits. */ #define VMCI_IMR_DATAGRAM 0x1 #define VMCI_IMR_NOTIFICATION 0x2 /* Interrupt type. */ typedef enum VMCIIntrType { VMCI_INTR_TYPE_INTX = 0, VMCI_INTR_TYPE_MSI = 1, VMCI_INTR_TYPE_MSIX = 2 } VMCIIntrType; /* * Maximum MSI/MSI-X interrupt vectors in the device. */ #define VMCI_MAX_INTRS 2 /* * Supported interrupt vectors. There is one for each ICR value above, * but here they indicate the position in the vector array/message ID. */ #define VMCI_INTR_DATAGRAM 0 #define VMCI_INTR_NOTIFICATION 1 /* * A single VMCI device has an upper limit of 128 MiB on the amount of * memory that can be used for queue pairs. */ #define VMCI_MAX_GUEST_QP_MEMORY (128 * 1024 * 1024) /* * Queues with pre-mapped data pages must be small, so that we don't pin * too much kernel memory (especially on vmkernel). We limit a queuepair to * 32 KB, or 16 KB per queue for symmetrical pairs. * * XXX, we are raising this limit to 4MB to support high-throughput workloads * with vioi-filter. Once we switch to rings instead of queuepairs for the * page channel, we will drop this limit again. See PR 852983. */ #define VMCI_MAX_PINNED_QP_MEMORY (4 * 1024 * 1024) /* * We have a fixed set of resource IDs available in the VMX. * This allows us to have a very simple implementation since we statically * know how many will create datagram handles. If a new caller arrives and * we have run out of slots we can manually increment the maximum size of * available resource IDs. */ typedef uint32 VMCI_Resource; /* VMCI reserved hypervisor datagram resource IDs. */ #define VMCI_RESOURCES_QUERY 0 #define VMCI_GET_CONTEXT_ID 1 #define VMCI_SET_NOTIFY_BITMAP 2 #define VMCI_DOORBELL_LINK 3 #define VMCI_DOORBELL_UNLINK 4 #define VMCI_DOORBELL_NOTIFY 5 /* * VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP are * obsoleted by the removal of VM to VM communication. */ #define VMCI_DATAGRAM_REQUEST_MAP 6 #define VMCI_DATAGRAM_REMOVE_MAP 7 #define VMCI_EVENT_SUBSCRIBE 8 #define VMCI_EVENT_UNSUBSCRIBE 9 #define VMCI_QUEUEPAIR_ALLOC 10 #define VMCI_QUEUEPAIR_DETACH 11 /* * VMCI_VSOCK_VMX_LOOKUP was assigned to 12 for Fusion 3.0/3.1, * WS 7.0/7.1 and ESX 4.1 */ #define VMCI_HGFS_TRANSPORT 13 #define VMCI_UNITY_PBRPC_REGISTER 14 /* * This resource is used for VMCI socket control packets sent to the * hypervisor (CID 0) because RID 1 is already reserved. */ #define VSOCK_PACKET_HYPERVISOR_RID 15 #define VMCI_RESOURCE_MAX 16 /* * The core VMCI device functionality only requires the resource IDs of * VMCI_QUEUEPAIR_DETACH and below. */ #define VMCI_CORE_DEVICE_RESOURCE_MAX VMCI_QUEUEPAIR_DETACH /* * VMCI reserved host datagram resource IDs. * vsock control channel has resource id 1. */ #define VMCI_DVFILTER_DATA_PATH_DATAGRAM 2 /* VMCI Ids. */ typedef uint32 VMCIId; typedef struct VMCIIdRange { int8 action; // VMCI_FA_X, for use in filters. VMCIId begin; // Beginning of range VMCIId end; // End of range } VMCIIdRange; typedef struct VMCIHandle { VMCIId context; VMCIId resource; } VMCIHandle; static INLINE VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid, // IN: VMCIId rid) // IN: { VMCIHandle h; h.context = cid; h.resource = rid; return h; } /* *---------------------------------------------------------------------- * * VMCI_HANDLE_TO_UINT64 -- * * Helper for VMCI handle to uint64 conversion. * * Results: * The uint64 value. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE uint64 VMCI_HANDLE_TO_UINT64(VMCIHandle handle) // IN: { uint64 handle64; handle64 = handle.context; handle64 <<= 32; handle64 |= handle.resource; return handle64; } /* *---------------------------------------------------------------------- * * VMCI_UINT64_TO_HANDLE -- * * Helper for uint64 to VMCI handle conversion. * * Results: * The VMCI handle value. * * Side effects: * None. * *---------------------------------------------------------------------- */ static INLINE VMCIHandle VMCI_UINT64_TO_HANDLE(uint64 handle64) // IN: { VMCIId context = (VMCIId)(handle64 >> 32); VMCIId resource = (VMCIId)handle64; return VMCI_MAKE_HANDLE(context, resource); } #define VMCI_HANDLE_TO_CONTEXT_ID(_handle) ((_handle).context) #define VMCI_HANDLE_TO_RESOURCE_ID(_handle) ((_handle).resource) #define VMCI_HANDLE_EQUAL(_h1, _h2) ((_h1).context == (_h2).context && \ (_h1).resource == (_h2).resource) #define VMCI_INVALID_ID 0xFFFFFFFF static const VMCIHandle VMCI_INVALID_HANDLE = {VMCI_INVALID_ID, VMCI_INVALID_ID}; #define VMCI_HANDLE_INVALID(_handle) \ VMCI_HANDLE_EQUAL((_handle), VMCI_INVALID_HANDLE) /* * The below defines can be used to send anonymous requests. * This also indicates that no response is expected. */ #define VMCI_ANON_SRC_CONTEXT_ID VMCI_INVALID_ID #define VMCI_ANON_SRC_RESOURCE_ID VMCI_INVALID_ID #define VMCI_ANON_SRC_HANDLE VMCI_MAKE_HANDLE(VMCI_ANON_SRC_CONTEXT_ID, \ VMCI_ANON_SRC_RESOURCE_ID) /* The lowest 16 context ids are reserved for internal use. */ #define VMCI_RESERVED_CID_LIMIT 16 /* * Hypervisor context id, used for calling into hypervisor * supplied services from the VM. */ #define VMCI_HYPERVISOR_CONTEXT_ID 0 /* * Well-known context id, a logical context that contains a set of * well-known services. This context ID is now obsolete. */ #define VMCI_WELL_KNOWN_CONTEXT_ID 1 /* * Context ID used by host endpoints. */ #define VMCI_HOST_CONTEXT_ID 2 #define VMCI_CONTEXT_IS_VM(_cid) (VMCI_INVALID_ID != _cid && \ _cid > VMCI_HOST_CONTEXT_ID) /* * The VMCI_CONTEXT_RESOURCE_ID is used together with VMCI_MAKE_HANDLE to make * handles that refer to a specific context. */ #define VMCI_CONTEXT_RESOURCE_ID 0 /* *----------------------------------------------------------------------------- * * VMCI error codes. * *----------------------------------------------------------------------------- */ #define VMCI_SUCCESS_QUEUEPAIR_ATTACH 5 #define VMCI_SUCCESS_QUEUEPAIR_CREATE 4 #define VMCI_SUCCESS_LAST_DETACH 3 #define VMCI_SUCCESS_ACCESS_GRANTED 2 #define VMCI_SUCCESS_ENTRY_DEAD 1 #define VMCI_SUCCESS 0LL #define VMCI_ERROR_INVALID_RESOURCE (-1) #define VMCI_ERROR_INVALID_ARGS (-2) #define VMCI_ERROR_NO_MEM (-3) #define VMCI_ERROR_DATAGRAM_FAILED (-4) #define VMCI_ERROR_MORE_DATA (-5) #define VMCI_ERROR_NO_MORE_DATAGRAMS (-6) #define VMCI_ERROR_NO_ACCESS (-7) #define VMCI_ERROR_NO_HANDLE (-8) #define VMCI_ERROR_DUPLICATE_ENTRY (-9) #define VMCI_ERROR_DST_UNREACHABLE (-10) #define VMCI_ERROR_PAYLOAD_TOO_LARGE (-11) #define VMCI_ERROR_INVALID_PRIV (-12) #define VMCI_ERROR_GENERIC (-13) #define VMCI_ERROR_PAGE_ALREADY_SHARED (-14) #define VMCI_ERROR_CANNOT_SHARE_PAGE (-15) #define VMCI_ERROR_CANNOT_UNSHARE_PAGE (-16) #define VMCI_ERROR_NO_PROCESS (-17) #define VMCI_ERROR_NO_DATAGRAM (-18) #define VMCI_ERROR_NO_RESOURCES (-19) #define VMCI_ERROR_UNAVAILABLE (-20) #define VMCI_ERROR_NOT_FOUND (-21) #define VMCI_ERROR_ALREADY_EXISTS (-22) #define VMCI_ERROR_NOT_PAGE_ALIGNED (-23) #define VMCI_ERROR_INVALID_SIZE (-24) #define VMCI_ERROR_REGION_ALREADY_SHARED (-25) #define VMCI_ERROR_TIMEOUT (-26) #define VMCI_ERROR_DATAGRAM_INCOMPLETE (-27) #define VMCI_ERROR_INCORRECT_IRQL (-28) #define VMCI_ERROR_EVENT_UNKNOWN (-29) #define VMCI_ERROR_OBSOLETE (-30) #define VMCI_ERROR_QUEUEPAIR_MISMATCH (-31) #define VMCI_ERROR_QUEUEPAIR_NOTSET (-32) #define VMCI_ERROR_QUEUEPAIR_NOTOWNER (-33) #define VMCI_ERROR_QUEUEPAIR_NOTATTACHED (-34) #define VMCI_ERROR_QUEUEPAIR_NOSPACE (-35) #define VMCI_ERROR_QUEUEPAIR_NODATA (-36) #define VMCI_ERROR_BUSMEM_INVALIDATION (-37) #define VMCI_ERROR_MODULE_NOT_LOADED (-38) #define VMCI_ERROR_DEVICE_NOT_FOUND (-39) #define VMCI_ERROR_QUEUEPAIR_NOT_READY (-40) #define VMCI_ERROR_WOULD_BLOCK (-41) /* VMCI clients should return error code withing this range */ #define VMCI_ERROR_CLIENT_MIN (-500) #define VMCI_ERROR_CLIENT_MAX (-550) /* Internal error codes. */ #define VMCI_SHAREDMEM_ERROR_BAD_CONTEXT (-1000) #define VMCI_PATH_MAX 256 /* VMCI reserved events. */ typedef uint32 VMCI_Event; #define VMCI_EVENT_CTX_ID_UPDATE 0 // Only applicable to guest endpoints #define VMCI_EVENT_CTX_REMOVED 1 // Applicable to guest and host #define VMCI_EVENT_QP_RESUMED 2 // Only applicable to guest endpoints #define VMCI_EVENT_QP_PEER_ATTACH 3 // Applicable to guest, host and VMX #define VMCI_EVENT_QP_PEER_DETACH 4 // Applicable to guest, host and VMX #define VMCI_EVENT_MEM_ACCESS_ON 5 // Applicable to VMX and vmk. On vmk, // this event has the Context payload type. #define VMCI_EVENT_MEM_ACCESS_OFF 6 // Applicable to VMX and vmk. Same as // above for the payload type. #define VMCI_EVENT_GUEST_PAUSED 7 // Applicable to vmk. This event has the // Context payload type. #define VMCI_EVENT_GUEST_UNPAUSED 8 // Applicable to vmk. Same as above for // the payload type. #define VMCI_EVENT_MAX 9 /* * Of the above events, a few are reserved for use in the VMX, and * other endpoints (guest and host kernel) should not use them. For * the rest of the events, we allow both host and guest endpoints to * subscribe to them, to maintain the same API for host and guest * endpoints. */ #define VMCI_EVENT_VALID_VMX(_event) (_event == VMCI_EVENT_QP_PEER_ATTACH || \ _event == VMCI_EVENT_QP_PEER_DETACH || \ _event == VMCI_EVENT_MEM_ACCESS_ON || \ _event == VMCI_EVENT_MEM_ACCESS_OFF) #if defined(VMX86_SERVER) #define VMCI_EVENT_VALID(_event) (_event < VMCI_EVENT_MAX) #else // VMX86_SERVER #define VMCI_EVENT_VALID(_event) (_event < VMCI_EVENT_MAX && \ _event != VMCI_EVENT_MEM_ACCESS_ON && \ _event != VMCI_EVENT_MEM_ACCESS_OFF && \ _event != VMCI_EVENT_GUEST_PAUSED && \ _event != VMCI_EVENT_GUEST_UNPAUSED) #endif // VMX86_SERVER /* Reserved guest datagram resource ids. */ #define VMCI_EVENT_HANDLER 0 /* VMCI privileges. */ typedef enum VMCIResourcePrivilegeType { VMCI_PRIV_CH_PRIV, VMCI_PRIV_DESTROY_RESOURCE, VMCI_PRIV_ASSIGN_CLIENT, VMCI_PRIV_DG_CREATE, VMCI_PRIV_DG_SEND, VMCI_PRIV_NOTIFY, VMCI_NUM_PRIVILEGES, } VMCIResourcePrivilegeType; /* * VMCI coarse-grained privileges (per context or host * process/endpoint. An entity with the restricted flag is only * allowed to interact with the hypervisor and trusted entities. */ typedef uint32 VMCIPrivilegeFlags; #define VMCI_PRIVILEGE_FLAG_RESTRICTED 0x01 #define VMCI_PRIVILEGE_FLAG_TRUSTED 0x02 #define VMCI_PRIVILEGE_ALL_FLAGS (VMCI_PRIVILEGE_FLAG_RESTRICTED | \ VMCI_PRIVILEGE_FLAG_TRUSTED) #define VMCI_NO_PRIVILEGE_FLAGS 0x00 #define VMCI_DEFAULT_PROC_PRIVILEGE_FLAGS VMCI_NO_PRIVILEGE_FLAGS #define VMCI_LEAST_PRIVILEGE_FLAGS VMCI_PRIVILEGE_FLAG_RESTRICTED #define VMCI_MAX_PRIVILEGE_FLAGS VMCI_PRIVILEGE_FLAG_TRUSTED #define VMCI_PUBLIC_GROUP_NAME "vmci public group" /* 0 through VMCI_RESERVED_RESOURCE_ID_MAX are reserved. */ #define VMCI_RESERVED_RESOURCE_ID_MAX 1023 #define VMCI_DOMAIN_NAME_MAXLEN 32 #define VMCI_LGPFX "VMCI: " /* * VMCIQueueHeader * * A Queue cannot stand by itself as designed. Each Queue's header * contains a pointer into itself (the producerTail) and into its peer * (consumerHead). The reason for the separation is one of * accessibility: Each end-point can modify two things: where the next * location to enqueue is within its produceQ (producerTail); and * where the next dequeue location is in its consumeQ (consumerHead). * * An end-point cannot modify the pointers of its peer (guest to * guest; NOTE that in the host both queue headers are mapped r/w). * But, each end-point needs read access to both Queue header * structures in order to determine how much space is used (or left) * in the Queue. This is because for an end-point to know how full * its produceQ is, it needs to use the consumerHead that points into * the produceQ but -that- consumerHead is in the Queue header for * that end-points consumeQ. * * Thoroughly confused? Sorry. * * producerTail: the point to enqueue new entrants. When you approach * a line in a store, for example, you walk up to the tail. * * consumerHead: the point in the queue from which the next element is * dequeued. In other words, who is next in line is he who is at the * head of the line. * * Also, producerTail points to an empty byte in the Queue, whereas * consumerHead points to a valid byte of data (unless producerTail == * consumerHead in which case consumerHead does not point to a valid * byte of data). * * For a queue of buffer 'size' bytes, the tail and head pointers will be in * the range [0, size-1]. * * If produceQHeader->producerTail == consumeQHeader->consumerHead * then the produceQ is empty. */ typedef struct VMCIQueueHeader { /* All fields are 64bit and aligned. */ VMCIHandle handle; /* Identifier. */ Atomic_uint64 producerTail; /* Offset in this queue. */ Atomic_uint64 consumerHead; /* Offset in peer queue. */ } VMCIQueueHeader; /* * If one client of a QueuePair is a 32bit entity, we restrict the QueuePair * size to be less than 4GB, and use 32bit atomic operations on the head and * tail pointers. 64bit atomic read on a 32bit entity involves cmpxchg8b which * is an atomic read-modify-write. This will cause traces to fire when a 32bit * consumer tries to read the producer's tail pointer, for example, because the * consumer has read-only access to the producer's tail pointer. * * We provide the following macros to invoke 32bit or 64bit atomic operations * based on the architecture the code is being compiled on. */ /* Architecture independent maximum queue size. */ #define QP_MAX_QUEUE_SIZE_ARCH_ANY CONST64U(0xffffffff) #ifdef __x86_64__ # define QP_MAX_QUEUE_SIZE_ARCH CONST64U(0xffffffffffffffff) # define QPAtomic_ReadOffset(x) Atomic_Read64(x) # define QPAtomic_WriteOffset(x, y) Atomic_Write64(x, y) #else /* * Wrappers below are being used to call Atomic_Read32 because of the * 'type punned' compilation warning received when Atomic_Read32 is * called with a Atomic_uint64 pointer typecasted to Atomic_uint32 * pointer from QPAtomic_ReadOffset. Ditto with QPAtomic_WriteOffset. */ static INLINE uint32 TypeSafe_Atomic_Read32(void *var) // IN: { return Atomic_Read32((Atomic_uint32 *)(var)); } static INLINE void TypeSafe_Atomic_Write32(void *var, uint32 val) // IN: { Atomic_Write32((Atomic_uint32 *)(var), (uint32)(val)); } # define QP_MAX_QUEUE_SIZE_ARCH CONST64U(0xffffffff) # define QPAtomic_ReadOffset(x) TypeSafe_Atomic_Read32((void *)(x)) # define QPAtomic_WriteOffset(x, y) \ TypeSafe_Atomic_Write32((void *)(x), (uint32)(y)) #endif /* __x86_64__ */ /* *----------------------------------------------------------------------------- * * QPAddPointer -- * * Helper to add a given offset to a head or tail pointer. Wraps the value * of the pointer around the max size of the queue. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void QPAddPointer(Atomic_uint64 *var, // IN: size_t add, // IN: uint64 size) // IN: { uint64 newVal = QPAtomic_ReadOffset(var); if (newVal >= size - add) { newVal -= size; } newVal += add; QPAtomic_WriteOffset(var, newVal); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_ProducerTail() -- * * Helper routine to get the Producer Tail from the supplied queue. * * Results: * The contents of the queue's producer tail. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE uint64 VMCIQueueHeader_ProducerTail(const VMCIQueueHeader *qHeader) // IN: { VMCIQueueHeader *qh = (VMCIQueueHeader *)qHeader; return QPAtomic_ReadOffset(&qh->producerTail); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_ConsumerHead() -- * * Helper routine to get the Consumer Head from the supplied queue. * * Results: * The contents of the queue's consumer tail. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE uint64 VMCIQueueHeader_ConsumerHead(const VMCIQueueHeader *qHeader) // IN: { VMCIQueueHeader *qh = (VMCIQueueHeader *)qHeader; return QPAtomic_ReadOffset(&qh->consumerHead); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_AddProducerTail() -- * * Helper routine to increment the Producer Tail. Fundamentally, * QPAddPointer() is used to manipulate the tail itself. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void VMCIQueueHeader_AddProducerTail(VMCIQueueHeader *qHeader, // IN/OUT: size_t add, // IN: uint64 queueSize) // IN: { QPAddPointer(&qHeader->producerTail, add, queueSize); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_AddConsumerHead() -- * * Helper routine to increment the Consumer Head. Fundamentally, * QPAddPointer() is used to manipulate the head itself. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void VMCIQueueHeader_AddConsumerHead(VMCIQueueHeader *qHeader, // IN/OUT: size_t add, // IN: uint64 queueSize) // IN: { QPAddPointer(&qHeader->consumerHead, add, queueSize); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_CheckAlignment -- * * Checks if the given queue is aligned to page boundary. Returns TRUE if * the alignment is good. * * Results: * TRUE or FALSE. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE Bool VMCIQueueHeader_CheckAlignment(const VMCIQueueHeader *qHeader) // IN: { uintptr_t hdr, offset; hdr = (uintptr_t) qHeader; offset = hdr & (PAGE_SIZE -1); return offset == 0; } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_GetPointers -- * * Helper routine for getting the head and the tail pointer for a queue. * Both the VMCIQueues are needed to get both the pointers for one queue. * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void VMCIQueueHeader_GetPointers(const VMCIQueueHeader *produceQHeader, // IN: const VMCIQueueHeader *consumeQHeader, // IN: uint64 *producerTail, // OUT: uint64 *consumerHead) // OUT: { if (producerTail) { *producerTail = VMCIQueueHeader_ProducerTail(produceQHeader); } if (consumerHead) { *consumerHead = VMCIQueueHeader_ConsumerHead(consumeQHeader); } } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_ResetPointers -- * * Reset the tail pointer (of "this" queue) and the head pointer (of * "peer" queue). * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void VMCIQueueHeader_ResetPointers(VMCIQueueHeader *qHeader) // IN/OUT: { QPAtomic_WriteOffset(&qHeader->producerTail, CONST64U(0)); QPAtomic_WriteOffset(&qHeader->consumerHead, CONST64U(0)); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_Init -- * * Initializes a queue's state (head & tail pointers). * * Results: * None. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE void VMCIQueueHeader_Init(VMCIQueueHeader *qHeader, // IN/OUT: const VMCIHandle handle) // IN: { qHeader->handle = handle; VMCIQueueHeader_ResetPointers(qHeader); } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_FreeSpace -- * * Finds available free space in a produce queue to enqueue more * data or reports an error if queue pair corruption is detected. * * Results: * Free space size in bytes or an error code. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE int64 VMCIQueueHeader_FreeSpace(const VMCIQueueHeader *produceQHeader, // IN: const VMCIQueueHeader *consumeQHeader, // IN: const uint64 produceQSize) // IN: { uint64 tail; uint64 head; uint64 freeSpace; tail = VMCIQueueHeader_ProducerTail(produceQHeader); head = VMCIQueueHeader_ConsumerHead(consumeQHeader); if (tail >= produceQSize || head >= produceQSize) { return VMCI_ERROR_INVALID_SIZE; } /* * Deduct 1 to avoid tail becoming equal to head which causes ambiguity. If * head and tail are equal it means that the queue is empty. */ if (tail >= head) { freeSpace = produceQSize - (tail - head) - 1; } else { freeSpace = head - tail - 1; } return freeSpace; } /* *----------------------------------------------------------------------------- * * VMCIQueueHeader_BufReady -- * * VMCIQueueHeader_FreeSpace() does all the heavy lifting of * determing the number of free bytes in a Queue. This routine, * then subtracts that size from the full size of the Queue so * the caller knows how many bytes are ready to be dequeued. * * Results: * On success, available data size in bytes (up to MAX_INT64). * On failure, appropriate error code. * * Side effects: * None. * *----------------------------------------------------------------------------- */ static INLINE int64 VMCIQueueHeader_BufReady(const VMCIQueueHeader *consumeQHeader, // IN: const VMCIQueueHeader *produceQHeader, // IN: const uint64 consumeQSize) // IN: { int64 freeSpace; freeSpace = VMCIQueueHeader_FreeSpace(consumeQHeader, produceQHeader, consumeQSize); if (freeSpace < VMCI_SUCCESS) { return freeSpace; } else { return consumeQSize - freeSpace - 1; } } /* * Defines for the VMCI traffic filter: * - VMCI_FA_ defines the filter action values * - VMCI_FP_ defines the filter protocol values * - VMCI_FD_ defines the direction values (guest or host) * - VMCI_FT_ are the type values (allow or deny) */ #define VMCI_FA_INVALID -1 #define VMCI_FA_ALLOW 0 #define VMCI_FA_DENY (VMCI_FA_ALLOW + 1) #define VMCI_FA_MAX (VMCI_FA_DENY + 1) #define VMCI_FP_INVALID -1 #define VMCI_FP_HYPERVISOR 0 #define VMCI_FP_QUEUEPAIR (VMCI_FP_HYPERVISOR + 1) #define VMCI_FP_DOORBELL (VMCI_FP_QUEUEPAIR + 1) #define VMCI_FP_DATAGRAM (VMCI_FP_DOORBELL + 1) #define VMCI_FP_STREAMSOCK (VMCI_FP_DATAGRAM + 1) #define VMCI_FP_ANY (VMCI_FP_STREAMSOCK + 1) #define VMCI_FP_MAX (VMCI_FP_ANY + 1) #define VMCI_FD_INVALID -1 #define VMCI_FD_GUEST 0 #define VMCI_FD_HOST (VMCI_FD_GUEST + 1) #define VMCI_FD_ANY (VMCI_FD_HOST + 1) #define VMCI_FD_MAX (VMCI_FD_ANY + 1) /* * The filter list tracks VMCI Id ranges for a given filter. */ typedef struct { uint32 len; VMCIIdRange *list; } VMCIFilterList; /* * The filter info is used to communicate the filter configuration * from the VMX to the host kernel. */ typedef struct { VA64 list; // List of VMCIIdRange uint32 len; // Length of list uint8 dir; // VMCI_FD_X uint8 proto; // VMCI_FP_X } VMCIFilterInfo; /* * In the host kernel, the ingoing and outgoing filters are * separated. The VMCIProtoFilters type captures all filters in one * direction. The VMCIFilters type captures all filters. */ typedef VMCIFilterList VMCIProtoFilters[VMCI_FP_MAX]; typedef VMCIProtoFilters VMCIFilters[VMCI_FD_MAX]; #endif // _VMCI_DEF_H_ open-vm-tools-10.0.7-3227872/lib/include/community_source.h0000644000000000000000000000502512660700526021624 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * community_source.h -- * * Macros for excluding source code from community. */ #ifndef _COMMUNITY_SOURCE_H_ #define _COMMUNITY_SOURCE_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMKDRIVERS #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" /* * Convenience macro for COMMUNITY_SOURCE */ #undef EXCLUDE_COMMUNITY_SOURCE #ifdef COMMUNITY_SOURCE #define EXCLUDE_COMMUNITY_SOURCE(x) #else #define EXCLUDE_COMMUNITY_SOURCE(x) x #endif #undef COMMUNITY_SOURCE_AMD_SECRET #if !defined(COMMUNITY_SOURCE) || defined(AMD_SOURCE) /* * It's ok to include AMD_SECRET source code for non-Community Source, * or for drops directed at AMD. */ #define COMMUNITY_SOURCE_AMD_SECRET #endif #undef COMMUNITY_SOURCE_INTEL_SECRET #if !defined(COMMUNITY_SOURCE) || defined(INTEL_SOURCE) /* * It's ok to include INTEL_SECRET source code for non-Community Source, * or for drops directed at Intel. */ #define COMMUNITY_SOURCE_INTEL_SECRET #endif #endif open-vm-tools-10.0.7-3227872/lib/include/msgid.h0000644000000000000000000000533012660700526017322 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * msgid.h -- * * Message ID magic */ #ifndef _MSGID_H_ #define _MSGID_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #include "msgid_defs.h" #include "vm_basic_defs.h" #ifndef VMKERNEL #include #endif // the X hides MSG_MAGIC so it won't appear in the object file #define MSG_MAGICAL(s) \ (s != NULL && strncmp(s, MSG_MAGIC"X", MSG_MAGIC_LEN) == 0) // Start after MSG_MAGIC so it won't appear in the object file either. #define MSG_HAS_BUTTONID(s) \ (MSG_MAGICAL(s) && \ (strncmp(&(s)[MSG_MAGIC_LEN], MSG_BUTTON_ID, MSG_BUTTON_ID_LEN) == 0)) /* *----------------------------------------------------------------------------- * * Msg_HasMsgID -- * * Check that a string has a message ID. * The full "MSG_MAGIC(...)" prefix is required, not just MSG_MAGIC. * * Results: * True if string has a message ID. * * Side Effects: * None * *----------------------------------------------------------------------------- */ static INLINE Bool Msg_HasMsgID(const char *s) { return MSG_MAGICAL(s) && *(s += MSG_MAGIC_LEN) == '(' && strchr(s + 1, ')') != NULL; } /* *----------------------------------------------------------------------------- * * Msg_StripMSGID -- * * Returns the string that is inside the MSGID() or if it doesn't * have a MSGID just return the string. * * Results: * The unlocalized string. * * Side Effects: * None * *----------------------------------------------------------------------------- */ static INLINE const char * Msg_StripMSGID(const char *idString) // IN { const char *s = idString; if (MSG_MAGICAL(s) && *(s += MSG_MAGIC_LEN) == '(' && (s = strchr(s + 1, ')')) != NULL) { return s + 1; } return idString; } #endif // ifndef _MSGID_H_ open-vm-tools-10.0.7-3227872/lib/include/str.h0000644000000000000000000002207512660700526017034 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * str.h -- * * string wrapping functions */ #ifndef _STR_H_ #define _STR_H_ #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #if defined(__linux__) #include #elif defined(_WIN32) #include #elif __APPLE__ #include #endif #include "compat/compat_stdarg.h" // Provides stdarg.h plus va_copy #include "vm_basic_types.h" /* * These platforms use bsd_vsnprintf(). * This does not mean it has bsd_vsnwprintf(). */ #if (defined _WIN32 && !defined STR_NO_WIN32_LIBS) || \ (defined __linux__ && !defined __UCLIBC__) || \ defined __APPLE__ #define HAS_BSD_PRINTF 1 #endif /* * And these platforms/setups use bsd_vsnwprintf() */ #if (defined _WIN32 && !defined STR_NO_WIN32_LIBS) || \ (defined __GNUC__ && (__GNUC__ < 2 \ || (__GNUC__ == 2 \ && __GNUC_MINOR__ < 96))) #define HAS_BSD_WPRINTF 1 #endif /* * ASCII/UTF-8 versions * * NOTE: All size_t arguments and integer returns values are in bytes. * * NOTE: Str_Asprintf/Str_Vasprintf return NULL on failure, while * Str_SafeAsprintf/Str_SafeVasprintf VERIFY. * * NOTE: "%s" refers to strings of "char" units, while "%S" refers to * strings of "wchar_t" units, regardless of platform. */ #ifdef HAS_BSD_PRINTF int Str_Sprintf_C_Locale(char *buf, // OUT: size_t max, // IN: const char *fmt, // IN: ...) PRINTF_DECL(3, 4); // IN: #endif int Str_Sprintf(char *buf, // OUT: size_t max, // IN: const char *fmt, // IN: ...) PRINTF_DECL(3, 4); // IN: int Str_Snprintf(char *buf, // OUT: size_t len, // IN: const char *fmt, // IN: ...) PRINTF_DECL(3, 4); // IN: int Str_Vsnprintf(char *buf, // OUT: size_t len, // IN: const char *fmt, // IN: va_list args); // IN: size_t Str_Strlen(const char *src, // IN: size_t maxLen); // IN: char *Str_Strnstr(const char *src, // IN: const char *sub, // IN: size_t n); // IN: char *Str_Strcpy(char *dst, // OUT: const char *src, // IN: size_t maxLen); // IN: char *Str_Strcat(char *dst, // IN/OUT: const char *src, // IN: size_t maxLen); // IN: char *Str_Strncat(char *buf, // IN/OUT: size_t bufSize, // IN: const char *src, // IN: size_t n); // IN: char *Str_Asprintf(size_t *length, // OUT/OPT: const char *format, // IN: ...) PRINTF_DECL(2, 3); // IN: char *Str_Vasprintf(size_t *length, // OUT/OPT: const char *format, // IN: va_list arguments); // IN: char *Str_SafeAsprintf(size_t *length, // OUT/OPT: const char *format, // IN: ...) PRINTF_DECL(2, 3); // IN: char *Str_SafeVasprintf(size_t *length, // OUT/OPT: const char *format, // IN: va_list arguments); // IN: #if defined(_WIN32) || defined(__linux__) // { /* * wchar_t versions * * NOTE: All size_t arguments and integer return values are in * wchar_ts, not bytes. * * NOTE: Str_Aswprintf/Str_Vaswprintf return NULL on failure, while * Str_SafeAswprintf/Str_SafeVaswprintf VERIFY. * * NOTE: "%s" refers to strings of "char" units, while "%S" refers to * strings of "wchar_t" units, regardless of platform. */ int Str_Swprintf(wchar_t *buf, // OUT: size_t max, // IN: const wchar_t *fmt, // IN: ...); int Str_Snwprintf(wchar_t *buf, // OUT: size_t len, // IN: const wchar_t *fmt, // IN: ...); int Str_Vsnwprintf(wchar_t *buf, // OUT: size_t len, // IN: const wchar_t *fmt, // IN: va_list args); wchar_t *Str_Wcscpy(wchar_t *dst, // OUT: const wchar_t *src, // IN: size_t maxLen); // IN: wchar_t *Str_Wcscat(wchar_t *dst, // IN/OUT: const wchar_t *src, // IN: size_t maxLen); // IN: wchar_t *Str_Wcsncat(wchar_t *buf, // IN/OUT: size_t bufSize, // IN: const wchar_t *src, // IN: size_t n); // IN: wchar_t *Str_Aswprintf(size_t *length, // OUT/OPT: const wchar_t *format, // IN: ...); // IN: wchar_t *Str_Vaswprintf(size_t *length, // OUT/OPT: const wchar_t *format, // IN: va_list arguments); // IN: wchar_t *Str_SafeAswprintf(size_t *length, // OUT/OPT: const wchar_t *format, // IN: ...); // IN: wchar_t *Str_SafeVaswprintf(size_t *length, // OUT/OPT: const wchar_t *format, // IN: va_list arguments); // IN: unsigned char *Str_Mbscpy(char *buf, // OUT: const char *src, // IN: size_t maxSize); // IN: unsigned char *Str_Mbscat(char *buf, // IN/OUT: const char *src, // IN: size_t maxSize); // IN: /* * These are handly for Windows programmers. They are like * the _tcs functions, but with Str_Strcpy-style bounds checking. * * We don't have Str_Mbsncat() because it has some odd semantic * ambiguity (whether to truncate in the middle of a multibyte * sequence) that I want to stay away from. -- edward */ #ifdef _WIN32 #ifdef UNICODE #define Str_Tcscpy(s1, s2, n) Str_Wcscpy(s1, s2, n) #define Str_Tcscat(s1, s2, n) Str_Wcscat(s1, s2, n) #else #define Str_Tcscpy(s1, s2, n) Str_Mbscpy(s1, s2, n) #define Str_Tcscat(s1, s2, n) Str_Mbscat(s1, s2, n) #endif #endif #endif // } defined(_WIN32) || defined(__linux__) /* * Wrappers for standard string functions * * These are either for Windows-Posix compatibility, * or just gratuitous wrapping for consistency. */ #define Str_Strcmp(s1, s2) strcmp(s1, s2) #define Str_Strncmp(s1, s2, n) strncmp(s1, s2, n) #define Str_Strchr(s, c) strchr(s, c) #define Str_Strrchr(s, c) strrchr(s, c) #define Str_Strspn(s1, s2) strspn(s1, s2) #define Str_Strcspn(s1, s2) strcspn(s1, s2) #if defined(_WIN32) #define Str_Strcasecmp(s1, s2) _stricmp(s1, s2) #define Str_Strncasecmp(s1, s2, n) _strnicmp(s1, s2, n) #define Str_ToUpper(s) _strupr(s) #define Str_ToLower(s) _strlwr(s) #else #define Str_Strcasecmp(s1, s2) strcasecmp(s1, s2) #define Str_Strncasecmp(s1, s2, n) strncasecmp(s1, s2, n) char *Str_ToUpper(char *string); char *Str_ToLower(char *string); #endif #ifdef _WIN32 #define Str_Tcscmp(s1, s2) _tcscmp(s1, s2) #define Str_Tcsncmp(s1, s2, n) _tcsncmp(s1, s2, n) #define Str_Tcsicmp(s1, s2) _tcsicmp(s1, s2) #define Str_Tcsnicmp(s1, s2, n) _tcsnicmp(s1, s2, n) #define Str_Tcschr(s, c) _tcschr(s, c) #define Str_Tcsrchr(s, c) _tcsrchr(s, c) #define Str_Tcsspn(s1, s2) _tcsspn(s1, s2) #define Str_Tcscspn(s1, s2) _tcscspn(s1, s2) #define Str_Tcsupr(s) _tcsupr(s) #define Str_Tcslwr(s) _tcslwr(s) #endif #endif /* _STR_H_ */ open-vm-tools-10.0.7-3227872/lib/include/hgfsUri.h0000644000000000000000000000253212660700526017627 0ustar rootroot/********************************************************* * Copyright (C) 2009-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * hgfsUri.h * * Provides a library for guest applications to convert local pathames to * x-vmware-share:// style URIs */ #ifndef _HGFS_URI_H_ #define _HGFS_URI_H_ #include "vm_basic_types.h" #include "unicode.h" #if defined(_WIN32) char *HgfsUri_ConvertFromUtf16ToHgfsUri(wchar_t *pathNameUtf16, Bool hgfsOnly); #endif // _WIN32 #if defined __linux__ || defined __APPLE__ char *HgfsUri_ConvertFromPathToHgfsUri(const char *pathName, Bool hgfsOnly); #endif // POSIX #endif open-vm-tools-10.0.7-3227872/lib/include/vm_api.h0000644000000000000000000001207412660700526017475 0ustar rootroot/********************************************************* * Copyright (C) 2010-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * * vm_api.h -- * * Import/export macro definitions. */ #ifndef VM_API_H #define VM_API_H /* * API macros * * These macros can be used by libraries to export/import/hide symbols. * * The general approach is: * * 1) libfoo defines a macro, say EXPORT_FOO_API or STATIC_FOO_API, * in its Makefile/SCons file depending on the type of the library. * * 2) libfoo has the following code in a header file, e.g. foo/platform.h, * that is included by all headers that export/import/hide symbols: * * // In a file named platform.h * #include * * #ifdef STATIC_FOO_API * # define FOO_API VMW_LIB_STATIC * # define FOO_INLINE_API VMW_LIB_STATIC * #elif defined EXPORT_FOO_API * # define FOO_API VMW_LIB_DYNAMIC * # define FOO_INLINE_API VMW_LIB_DYNAMIC_INLINE * #else * # define FOO_API VMW_LIB_CLIENT * # define FOO_INLINE_API VMW_LIB_CLIENT_INLINE * #endif * * For example: * // In a file named FooTypes.h * #ifndef FOO_TYPES_H * #define FOO_TYPES_H * * #include * * class FOO_API FooObject { }; * FOO_API FooObject *GetFooObject(); * * class FOO_INLINE_API FooException { }; * FOO_INLINE_API int GetInt() { return 5; } * * #endif // FOO_TYPES_H * * DLL/DSO import/export macros. * * 3) Compiling a shared library - define EXPORT_FOO_API. * libfoo can now use FOO_API for all symbols it would like to export, * which resolves to VMW_LIB_DYNAMIC, while compiling libfoo as a dynamic * shared library. * On posix systems types that need to export RTTI information, including * exceptions, must have default visibility. However these types may not need * __declspec(dllexport) on Windows. Such classes should be marked with a * FOO_INLINE_API macro. * * 4) Linking against a shared library - no defines needed. * Whenever a client of libfoo includes its headers, these symbols will be * marked with VMW_LIB_CLIENT or VMW_LIB_CLIENT_INLINE, since EXPORT_FOO_API * and STATIC_FOO_API are not defined for the client. * * Static library macros. * * 3) Compiling a static library - define STATIC_FOO_API. * libfoo should hide all of its symbols so that they don't leak through to * another library, say libbar, which links libfoo statically. FOO_API and * FOO_INLINE_API would both resolve to VMW_LIB_STATIC while compiling libfoo * as a static library. * * 4) Linking against a static library - define STATIC_FOO_API. * Whenever a client of libfoo includes its headers, the libfoo symbols * should be hidden on posix systems, marked with VMW_LIB_STATIC. On Windows * defining STATIC_FOO_API is a must when linking against the libfoo static * library. If it's not defined then the libfoo symbols would get an * __declspec(dllimport) declaration. As a result the linker will try to * import them from the list of DLLs present in the link line instead of * linking them directly from the libfoo static library. * * NOTE: By default, symbols are hidden when compiling with MSC and exported * when compiling with GCC. Thus, it's best to compile with GCC's * -fvisibility=hidden and -fvisibility-inlines-hidden flags, so that only * symbols explicitly marked with VMW_LIB_DYNAMIC are exported. Also note that * these flags, as well as the attributes, are available in GCC 4 and later. * * @see http://gcc.gnu.org/wiki/Visibility */ #ifdef _MSC_VER # define VMW_LIB_STATIC # define VMW_LIB_CLIENT __declspec(dllimport) # define VMW_LIB_CLIENT_INLINE # define VMW_LIB_DYNAMIC __declspec(dllexport) # define VMW_LIB_DYNAMIC_INLINE #elif defined __GNUC__ && __GNUC__ >= 4 /* !_MSC_VER */ # define VMW_LIB_STATIC __attribute__ ((visibility ("hidden"))) # define VMW_LIB_CLIENT __attribute__ ((visibility ("default"))) # define VMW_LIB_CLIENT_INLINE __attribute__ ((visibility ("default"))) # define VMW_LIB_DYNAMIC __attribute__ ((visibility ("default"))) # define VMW_LIB_DYNAMIC_INLINE __attribute__ ((visibility ("default"))) #else # define VMW_LIB_STATIC # define VMW_LIB_CLIENT # define VMW_LIB_CLIENT_INLINE # define VMW_LIB_DYNAMIC # define VMW_LIB_DYNAMIC_INLINE #endif /* _MSC_VER */ #endif /* VM_API_H */ open-vm-tools-10.0.7-3227872/lib/include/miscSolaris.h0000644000000000000000000000237112660700526020511 0ustar rootroot/********************************************************* * Copyright (C) 2005-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* *---------------------------------------------------------------------- * * miscSolaris -- * * Implementation of new Linux functions for Solaris. * *---------------------------------------------------------------------- */ #ifndef _MISCSOLARIS_H_ #define _MISCSOLARIS_H_ #define INCLUDE_ALLOW_USERLEVEL int daemon(int nochdir, int noclose); #endif /* _MISCSOLARIS_H_ */ open-vm-tools-10.0.7-3227872/lib/include/unicodeICU.h0000644000000000000000000000562712660700526020217 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * unicodeICU.h -- * * Unicode operations that depend on the third-party ICU support * library. */ #ifndef _UNICODE_ICU_H_ #define _UNICODE_ICU_H_ #define INCLUDE_ALLOW_USERLEVEL #ifndef USE_ICU #error These interfaces require the ICU library (define USE_ICU). #endif #include "includeCheck.h" #include "unicodeBase.h" #ifdef __cplusplus extern "C" { #endif typedef enum { UNICODE_COMPARE_DEFAULT = 0, UNICODE_COMPARE_IGNORE_ACCENTS, UNICODE_COMPARE_IGNORE_CASE, UNICODE_COMPARE_IGNORE_PUNCTUATION } UnicodeCompareOption; /* * Different languages and cultures have unique rules for how strings * are compared and sorted. For example: * * Swedish: z < "o with umlaut" * German: "o with umlaut" < z * * When producing a result visible to the user (like a sorted list of * virtual machine names) string comparsion must obey the rules set by * the user's language and culture, collectively called the "locale". */ int Unicode_CompareWithLocale(const char *str1, const char *str2, const char *locale, UnicodeCompareOption compareOption); /* * Transforms the case of the string using the given locale's rules. * * Pass in a NULL locale to use the process's default locale. * * Changing the case of a string can change its length, so don't * assume the string is the same length after calling these functions. */ char *Unicode_ToLower(const char *str, const char *locale); char *Unicode_ToUpper(const char *str, const char *locale); #ifdef HAVE_ICU_38 char *Unicode_ToTitle(const char *str, const char *locale); #endif typedef enum { UNICODE_NORMAL_FORM_C, // "e with acute accent" -> U+00E9 UNICODE_NORMAL_FORM_D // "e with acute accent" -> U+0065 U+0302 } UnicodeNormalizationForm; /* * Normalizes Unicode characters composed of multiple parts into a * standard form. */ char *Unicode_Normalize(const char *str, UnicodeNormalizationForm form); #ifdef __cplusplus } #endif #endif // _UNICODE_ICU_H_ open-vm-tools-10.0.7-3227872/lib/include/msgid_defs.h0000644000000000000000000000354212660700526020326 0ustar rootroot/********************************************************* * Copyright (C) 2011-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * msgid_defs.h -- * * Message ID magic definitions */ #ifndef _MSGID_DEFS_H_ #define _MSGID_DEFS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" /* * Message ID macros * * Use as in * Msg_Append(MSGID(file.openFailed) "Failed to open file %s: %s.\n" * fileName, Msg_ErrString()) * Msg_Append(MSGID(mks.powerOnFailed) "Power on failed.\n") * or * Msg_Hint(TRUE, HINT_OK, * MSGID(mks.noDGA) "No full screen mode.\n"). * * Don't make MSG_MAGIC_LEN (sizeof MSG_MAGIC - 1), since * that may cause the string to be in the object file, even * when it's not used at run time. And we are trying * to avoid littering the output with the magic string. * * -- edward */ #define MSG_MAGIC "@&!*@*@" #define MSG_MAGIC_LEN 7 #define MSGID(id) MSG_MAGIC "(msg." #id ")" #define MSG_BUTTON_ID "(button." #define MSG_BUTTON_ID_LEN 8 #define BUTTONID(id) MSG_MAGIC MSG_BUTTON_ID #id ")" #endif // ifndef _MSGID_DEFS_H_ open-vm-tools-10.0.7-3227872/lib/include/x86vendor.h0000644000000000000000000000325412660700526020065 0ustar rootroot /********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ #ifndef _X86VENDOR_H_ #define _X86VENDOR_H_ /* * CPU vendors */ typedef enum { CPUID_VENDOR_UNKNOWN, CPUID_VENDOR_COMMON, CPUID_VENDOR_INTEL, CPUID_VENDOR_AMD, CPUID_VENDOR_CYRIX, CPUID_VENDOR_VIA, CPUID_NUM_VENDORS } CpuidVendor; #endif open-vm-tools-10.0.7-3227872/lib/include/safetime.h0000644000000000000000000001150112660700526020011 0ustar rootroot/********************************************************* * Copyright (C) 2004-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * safetime.h -- * * This header file defines wrappers so that we use the * 64-bit versions of the C time calls. This file is * temporary until we switch to a newer version of * Visual Studio that uses the 64-bit verisions by default. * * In Windows, the user is allowed to set the time past the * 32-bit overflow date (in 2038), which can cause crashes * and security problems. In Linux, the time can't be set * to overflow, so we do nothing. * * NB: We do not know if one can set the time past 2038 in * 64-bit versions of Linux, and, if so, what happens when * one does. This requires further investigation sometime * in the future. * * The stat types and functions must be defined manually, * since they contain time_ts, and we can't use the macro * trick, since the struct stat and the function stat have * the same 32 bit name (but different 64 bit names). * */ #ifndef _SAFETIME_H_ #define _SAFETIME_H_ #ifdef _WIN32 #undef FMTTIME #define FMTTIME FMT64"d" #if (_MSC_VER < 1400) #if (defined(_STAT_DEFINED) || defined(_INC_TIME) || defined(_INC_TYPES)) #error Use safetime.h instead of time.h, stat.h, and types.h #endif #define _STAT_DEFINED #include #include #include #define time_t __time64_t #define time(a) _time64(a) #define localtime(a) _localtime64((a)) #define _ctime(a) _ctime64((a)) #define ctime(a) _ctime64((a)) #define _ftime(a) _ftime64((a)) #define ftime(a) _ftime64((a)) #define _timeb __timeb64 #define _gmtime(a) _gmtime64((a)) #define gmtime(a) _gmtime64((a)) #define _mktime(a) _mktime64((a)) #define mktime(a) _mktime64((a)) #define _utime(a,b) _utime64((a),(b)) #define utime(a,b) _utime64((a),(b)) #define _utimbuf __utimbuf64 #define utimbuf __utimbuf64 #define _wctime(a) _wctime64((a),(b)) #define wctime(a) _wctime64((a),(b)) #define _futime(a,b) _futime64((a),(b)) #define futime(a,b) _futime64((a),(b)) #define _wutime(a,b) _wutime64((a),(b)) #define wutime(a,b) _wutime64((a),(b)) #include #ifdef _MSC_VER #pragma pack(push,8) #endif struct _stat { _dev_t st_dev; _ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; _dev_t st_rdev; __int64 st_size; __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; }; struct stat { _dev_t st_dev; _ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; _dev_t st_rdev; __int64 st_size; __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; }; struct __stat64 { _dev_t st_dev; _ino_t st_ino; unsigned short st_mode; short st_nlink; short st_uid; short st_gid; _dev_t st_rdev; __int64 st_size; __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; }; #ifdef _MSC_VER #pragma pack(pop) #endif #include #define stat(a,b) _stat64((a),(struct __stat64*)(b)) #define _stat(a,b) _stat64((a),(struct __stat64*)(b)) #define fstat(a,b) _fstat64((a),(struct __stat64*)(b)) #define _fstat(a,b) _fstat64((a),(struct __stat64*)(b)) #define wstat(a,b) _wstat64((a),(struct __stat64*)(b)) #define _wstat(a,b) _wstat64((a),(struct __stat64*)(b)) #else /* (_MSC_VER < 1400) */ /* * Starting with VC80, we can pick between 32-bit and 64-bit time_t * by defining or not defining _USE_32BIT_TIME_T. Don't define it. */ #include #include #include #include #include /* Make sure that the headers didn't revert to 32-bit. */ #ifdef _USE_32BIT_TIME_T #error Refusing to use 32-bit time_t in safetime.h #endif #endif /* (_MSC_VER < 1400) */ #else #include #include #include #include #endif #endif open-vm-tools-10.0.7-3227872/lib/include/random.h0000644000000000000000000000300012660700526017467 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * random.h -- * * Random bits generation. Please use CryptoRandom_GetBytes if * you require a FIPS-compliant source of random data. */ #ifndef __RANDOM_H__ # define __RANDOM_H__ #include "vm_basic_types.h" Bool Random_Crypto(size_t size, void *buffer); /* * High quality - research grade - random number generator. * * Despite its apparent complexity this RNG is extremely fast. */ typedef struct rqContext rqContext; rqContext *Random_QuickSeed(uint32 seed); uint32 Random_Quick(rqContext *context); /* * Simple multiplicative congruential RNG. */ int Random_Simple(int seed); #endif /* __RANDOM_H__ */ open-vm-tools-10.0.7-3227872/lib/include/vmSessionId.h0000644000000000000000000000210412660700526020456 0ustar rootroot/********************************************************* * Copyright (C) 2006-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _VM_SESSION_ID_H_ #define _VM_SESSION_ID_H_ #include "vm_basic_types.h" #ifdef __cplusplus extern "C" { #endif typedef uint64 VMSessionId; #ifdef __cplusplus } #endif #endif /* _VM_SESSION_ID_H_ */ open-vm-tools-10.0.7-3227872/lib/include/embed_version.h0000644000000000000000000000364012660700526021042 0ustar rootroot/********************************************************* * Copyright (C) 2007-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /* * embed_version.h -- * * Embeds a version string in an ELF binary that is readable by modinfo. */ #ifndef _EMBED_VERSION_H_ #define _EMBED_VERSION_H_ /* * Using section attributes, embed the specified version in the "modinfo" * section of the ELF binary. We don't do this on Windows, where the PE format * already has version information stuffed inside it, nor on Mac OS X, which * doesn't use ELF. * * We can't declare vm_version as static, otherwise it may get optimized out. * I've seen this when building with gcc 4.1, but not with 3.3. * * The argument to the macro should be the base name for the version number * macros to embed in the final binary, as described in vm_version.h (see * declaration of VM_VERSION_TO_STR). */ #if !defined(_WIN32) && !defined(__APPLE__) #define VM_EMBED_VERSION(ver) \ const char vm_version[] \ __attribute__((section(".modinfo"), unused)) = "version=" ver #else #define VM_EMBED_VERSION(ver) #endif #endif /* _EMBED_VERSION_H_ */ open-vm-tools-10.0.7-3227872/lib/include/guestStats.h0000644000000000000000000002617512660700526020377 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /** * @file guestStats.h * * Common declarations that aid in sending guest statistics to the vmx * and may be further to vmkernel. */ #ifndef _GUEST_STATS_H_ #define _GUEST_STATS_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" #include "vm_assert.h" #include "vm_basic_types.h" /* * Version 1: Legacy data * Version 2: Dead * Version 3: Dead * Version 4: Dead * Version 5: Legacy structure followed by one or more GuestStat * structures and data. */ #define GUESTMEMINFO_V1 1 #define GUESTMEMINFO_V2 2 #define GUESTMEMINFO_V3 3 #define GUESTMEMINFO_V4 4 #define GUESTMEMINFO_V5 5 /* * Flags for legacy GuestMemInfo * * This is deprecated. All new values are returned via a GuestStat list. */ #define MEMINFO_MEMTOTAL (1 << 0) #define MEMINFO_DEPRECATED1 (1 << 1) #define MEMINFO_DEPRECATED2 (1 << 2) #define MEMINFO_DEPRECATED3 (1 << 3) #define MEMINFO_DEPRECATED4 (1 << 4) #define MEMINFO_DEPRECATED5 (1 << 5) #define MEMINFO_DEPRECATED6 (1 << 6) #define MEMINFO_DEPRECATED7 (1 << 7) #define MEMINFO_DEPRECATED8 (1 << 8) #define MEMINFO_DEPRECATED9 (1 << 9) #define MEMINFO_HUGEPAGESTOTAL (1 << 10) #define MEMINFO_DEPRECATED10 (1 << 11) #define MEMINFO_DEPRECATED11 (1 << 12) /* * Legacy GuestMemInfo structure. * * It should stay the same to ensure binary compatibility. */ typedef #include "vmware_pack_begin.h" struct GuestMemInfo { uint32 version; ///< MemInfo structure version. uint32 flags; ///< Indicates which stats are valid. uint64 memTotal; ///< Total physical memory in Kb. uint64 deprecated1[9]; ///< No longer used. uint64 hugePagesTotal; ///< Total number of huge pages. uint64 deprecated2[2]; ///< No longer used. } #include "vmware_pack_end.h" GuestMemInfo; /* * A stat begins with a header. The header has a mask which says what data * follows. Each datum has a size field which says how much data follows so it * can be used or ignored. The order of the data that follows is that of the * bits, lowest order bit to highest. */ typedef enum { GUEST_DATUM_PRAGMA = 0x0001, // escape hatch (future expansion) GUEST_DATUM_NAMESPACE = 0x0002, // UTF8 string GUEST_DATUM_ID = 0x0004, // uint8 - uint64 GUEST_DATUM_VALUE_TYPE_ENUM = 0x0008, // uint8 - uint32 GUEST_DATUM_VALUE_TYPE_STRING = 0x0010, // UTF8 string GUEST_DATUM_VALUE_UNIT_ENUM = 0x0020, // uint8 - uint32 GUEST_DATUM_VALUE_UNIT_STRING = 0x0040, // UTF8 string GUEST_DATUM_VALUE = 0x0080, // value data } GuestDatum; typedef #include "vmware_pack_begin.h" struct GuestStatHeader { GuestDatum datumFlags; // Indicates how many and which data follow } #include "vmware_pack_end.h" GuestStatHeader; typedef #include "vmware_pack_begin.h" struct GuestDatumHeader { uint16 dataSize; // dataSize - May be zero char data[0]; // data - if dataSize is not zero. } #include "vmware_pack_end.h" GuestDatumHeader; /* * Units datum enum. * Note: The entirety (all bits) of the units must always be understood by a client. * * First we define some modifiers, then the enum itself * * bits 0-5 define base types (information, time, etc.) * bits 6-10 are modifiers, four of which are reserved (in the future, we could * define two of them as custom modifiers, for things like changing the radix from 2^10 * to 10^3 for storage, or for denoting rates are in 100ns units). */ #define GuestUnitsModifier_Rate 0x0040 #define GuestUnitsModifier_Reserved0 0x0080 #define GuestUnitsModifier_Reserved1 0x0100 #define GuestUnitsModifier_Reserved2 0x0200 #define GuestUnitsModifier_Reserved3 0x0400 /* * bits 11-15 are scale modifiers: * This includes common scales: (P)ositive powers, (N)egative powers, * and (C)ustom scales (bits, pages, etc.), which are always type specific. */ #define GuestUnitsScale_P0 0x0000 #define GuestUnitsScale_P1 0x0800 #define GuestUnitsScale_P2 0x1000 #define GuestUnitsScale_P3 0x1800 #define GuestUnitsScale_P4 0x2000 #define GuestUnitsScale_P5 0x2800 #define GuestUnitsScale_P6 0x3000 #define GuestUnitsScale_Reserved0 0x3800 #define GuestUnitsScale_N1 0x4000 #define GuestUnitsScale_N2 0x4800 #define GuestUnitsScale_N3 0x5000 #define GuestUnitsScale_N4 0x5800 #define GuestUnitsScale_N5 0x6000 #define GuestUnitsScale_N6 0x6800 #define GuestUnitsScale_Reserved1 0x7000 #define GuestUnitsScale_Reserved2 0x7800 #define GuestUnitsScale_C0 0x8000 #define GuestUnitsScale_C1 0x8800 #define GuestUnitsScale_C2 0x9000 #define GuestUnitsScale_C3 0x9800 // 0xA000-0xF800 are reserved. typedef enum { GuestUnitsInvalid = 0, // Must never be sent GuestUnitsNone = 1, // A valid value, but not any of the below units. GuestUnitsNumber = 2, // default radix is 1000 GuestUnitsInformation = 3, // default radix is 1024 GuestUnitsDuration = 4, // default radix is 1000 GuestUnitsCycles = 5, // default radix is 1000 GuestUnitsBytes = GuestUnitsInformation | GuestUnitsScale_P0, GuestUnitsKiB = GuestUnitsInformation | GuestUnitsScale_P1, GuestUnitsMiB = GuestUnitsInformation | GuestUnitsScale_P2, GuestUnitsPages = GuestUnitsInformation | GuestUnitsScale_C0, GuestUnitsHugePages = GuestUnitsInformation | GuestUnitsScale_C1, GuestUnitsBytesPerSecond = GuestUnitsBytes | GuestUnitsModifier_Rate, GuestUnitsKiBPerSecond = GuestUnitsKiB | GuestUnitsModifier_Rate, GuestUnitsMiBPerSecond = GuestUnitsMiB | GuestUnitsModifier_Rate, GuestUnitsPagesPerSecond = GuestUnitsPages | GuestUnitsModifier_Rate, GuestUnitsHugePagesPerSecond = GuestUnitsHugePages | GuestUnitsModifier_Rate, GuestUnitsAttoSeconds = GuestUnitsDuration | GuestUnitsScale_N6, GuestUnitsFemtoSeconds = GuestUnitsDuration | GuestUnitsScale_N5, GuestUnitsPicoSeconds = GuestUnitsDuration | GuestUnitsScale_N4, GuestUnitsNanoSeconds = GuestUnitsDuration | GuestUnitsScale_N3, GuestUnitsMicroSeconds = GuestUnitsDuration | GuestUnitsScale_N2, GuestUnitsMilliSeconds = GuestUnitsDuration | GuestUnitsScale_N1, GuestUnitsSeconds = GuestUnitsDuration | GuestUnitsScale_P0, GuestUnitsHz = GuestUnitsCycles | GuestUnitsScale_P0 | GuestUnitsModifier_Rate, GuestUnitsKiloHz = GuestUnitsCycles | GuestUnitsScale_P1 | GuestUnitsModifier_Rate, GuestUnitsMegaHz = GuestUnitsCycles | GuestUnitsScale_P2 | GuestUnitsModifier_Rate, GuestUnitsGigaHz = GuestUnitsCycles | GuestUnitsScale_P3 | GuestUnitsModifier_Rate, GuestUnitsTeraHz = GuestUnitsCycles | GuestUnitsScale_P4 | GuestUnitsModifier_Rate, GuestUnitsPercent = GuestUnitsNumber | GuestUnitsScale_C0, // integers: must be 0...100; FP: 0.0...1.0 GuestUnitsNumberPerSecond = GuestUnitsNumber | GuestUnitsModifier_Rate, } GuestValueUnits; /* * Data type datum enum. * Note: The entirety (all bits) of the type must always be understood by a client. * * Bits 0-5 are for types. * Bits 6-15 are reserved. In the future, one bit will denote arrays. */ #define GuestTypeModifier_Reserved0 0x0040 // More Reserved1-9 not shown. typedef enum { GuestTypeInvalid, // Must never be sent GuestTypeNil, // A stat that has no value GuestTypeInt8, // Little endian GuestTypeUint8, // Little endian GuestTypeInt16, // Little endian GuestTypeUint16, // Little endian GuestTypeInt32, // Little endian GuestTypeUint32, // Little endian GuestTypeInt64, // Little endian GuestTypeUint64, // Little endian GuestTypeFloat, // IEEE 754 GuestTypeDouble, // IEEE 754 GuestTypeString, // NUL terminated UTF8 GuestTypeBinary, // Binary blob } GuestValueType; /* * Defines the namespace used for guest tools buildin query. */ #define GUEST_TOOLS_NAMESPACE "_tools/v1" /* * Defined stat IDs for guest tools builtin query. * See vmx/vigorapi/GuestStats.java for documentation * * NOTE: These IDs are relative to GUEST_TOOLS_NAMESPACE * NOTE: DO NOT re-order or remove the IDs. IDs can only be added to the end, * unless you make the totally backward-compatibility breaking change * of bumping the namespace version. */ #define GUEST_STAT_TOOLS_IDS \ DEFINE_GUEST_STAT(GuestStatID_Invalid, 0, "__INVALID__") \ DEFINE_GUEST_STAT(GuestStatID_None, 1, "__NONE__") \ DEFINE_GUEST_STAT(GuestStatID_ContextSwapRate, 2, "guest.contextSwapRate") \ DEFINE_GUEST_STAT(GuestStatID_MemActiveFileCache, 3, "guest.mem.activeFileCache") \ DEFINE_GUEST_STAT(GuestStatID_MemFree, 4, "guest.mem.free") \ DEFINE_GUEST_STAT(GuestStatID_MemNeeded, 5, "guest.mem.needed") \ DEFINE_GUEST_STAT(GuestStatID_MemPhysUsable, 6, "guest.mem.physUsable") \ DEFINE_GUEST_STAT(GuestStatID_PageInRate, 7, "guest.page.inRate") \ DEFINE_GUEST_STAT(GuestStatID_PageOutRate, 8, "guest.page.outRate") \ DEFINE_GUEST_STAT(GuestStatID_SwapSpaceRemaining, 9, "guest.swap.spaceRemaining") \ DEFINE_GUEST_STAT(GuestStatID_PhysicalPageSize, 10, "guest.page.size") \ DEFINE_GUEST_STAT(GuestStatID_HugePageSize, 11, "guest.hugePage.size") \ DEFINE_GUEST_STAT(GuestStatID_Linux_HugePagesTotal, 12, "guest.hugePage.total") \ DEFINE_GUEST_STAT(GuestStatID_Max, 13, "__MAX__") /* * Define stats enumeration */ #undef DEFINE_GUEST_STAT #define DEFINE_GUEST_STAT(x,y,z) x, typedef enum GuestStatToolsID { GUEST_STAT_TOOLS_IDS } GuestStatToolsID; /* * Enforce ordering and compactness of the enumeration */ #undef DEFINE_GUEST_STAT #define DEFINE_GUEST_STAT(x,y,z) ASSERT_ON_COMPILE(x==y); MY_ASSERTS(GUEST_STAT_IDS_ARE_WELL_ORDERED, GUEST_STAT_TOOLS_IDS) #undef DEFINE_GUEST_STAT #endif // _GUEST_STATS_H_ open-vm-tools-10.0.7-3227872/lib/include/removable_device.h0000644000000000000000000000221712660700526021513 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _REMOVABLE_DEVICE_H_ #define _REMOVABLE_DEVICE_H_ #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" #define REMOVABLE_DEVICE_PRETTY_NAME_LENGTH 32 typedef struct { char name[REMOVABLE_DEVICE_PRETTY_NAME_LENGTH]; uint32 uid; Bool enabled; } RD_Info; #endif open-vm-tools-10.0.7-3227872/lib/include/sha1.h0000644000000000000000000000675712660700526017071 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * sha1.h -- * * SHA1 encryption */ #ifndef _SHA1_H_ #define _SHA1_H_ #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" /* for uint32 */ #include "vm_basic_types.h" #if defined __APPLE__ && defined USERLEVEL /* * Apple provides basic crypto functions in its system runtime that are * maintained for both speed and security. Use those instead. */ #include #define SHA1_HASH_LEN CC_SHA1_DIGEST_LENGTH #define SHA1_CTX CC_SHA1_CTX #define SHA1Init CC_SHA1_Init #define SHA1Update CC_SHA1_Update #define SHA1Final CC_SHA1_Final #else #ifndef VMKERNEL /* * Prevent linkage conflicts with the SHA1 APIs brought in from * OpenSSL. (Pro tip: If you're doing anything security-related, you * _must_ be using lib/crypto hash routines to preserve FIPS * compatibility.) */ #define SHA1Init VMW_SHA1Init #define SHA1Update VMW_SHA1Update #define SHA1Final VMW_SHA1Final #define SHA1RawBufferHash VMW_SHA1RawBufferHash #endif /* !VMKERNEL */ /* SHA-1 in C By Steve Reid 100% Public Domain Test Vectors (from FIPS PUB 180-1) "abc" A9993E36 4706816A BA3E2571 7850C26C 9CD0D89D "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq" 84983E44 1C3BD26E BAAE4AA1 F95129E5 E54670F1 A million repetitions of "a" 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ /* 12/15/98: JEB: Removed main and moved prototypes to sha1.h Made SHA1Transform a static function */ #define SHA1_HASH_LEN 20 typedef struct { uint32 state[5]; uint32 count[2]; unsigned char buffer[64]; } SHA1_CTX; void SHA1Init(SHA1_CTX* context); void SHA1Update(SHA1_CTX* context, const unsigned char *data, size_t len); void SHA1Final(unsigned char digest[SHA1_HASH_LEN], SHA1_CTX* context); void SHA1RawBufferHash(const void *data, uint32 size, uint32 result[5]); #endif // defined __APPLE__ && defined USERLEVEL #endif // ifndef _SHA1_H_ open-vm-tools-10.0.7-3227872/lib/include/xdrutil.h0000644000000000000000000001023412660700526017711 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ #ifndef _XDRUTIL_H_ #define _XDRUTIL_H_ /* * xdrutil.h -- * * Utility functions for code that uses XDR to encode/decode data. */ #include #include "vm_basic_types.h" #include "util.h" /* * Helper macros for iterating over an rpcgen-generated array. Given a struct S: * * struct S { * struct { * u_int f_len; * T *f_val; * } f; * }; * * Iterate over the array like this: * * S s; * u_int i; * * XDRUTIL_FOREACH(i, &s, f) { * T *t = XDRUTIL_GETITEM(&s, f, i); * } * * 'f' should be a string with the field name. */ #define XDRUTIL_COUNT(ptr, field) ((ptr)->field.field##_len) #define XDRUTIL_FOREACH(counter, ptr, field) \ for ((counter) = 0; (counter) < XDRUTIL_COUNT(ptr, field); (counter)++) #define XDRUTIL_GETITEM(ptr, field, idx) &((ptr)->field.field##_val[idx]) /* * Wrapper for XdrUtil_ArrayAppend that automatically populates the arguments * from a given XDR array. */ #ifdef __GNUC__ # define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ (typeof ((ptr)->field.field##_val)) \ XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ &(ptr)->field.field##_len, \ sizeof *(ptr)->field.field##_val, \ (cnt)) #else # define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ &(ptr)->field.field##_len, \ sizeof *(ptr)->field.field##_val, \ (cnt)) #endif /* * Macros for assigning to XDR optional strings, opaque fields, and * optional opaque fields. * * Usage: * // XDR * struct MyFoo { string *foo; }; * struct MyBar { opaque bar; }; * struct MyOptBar { opaque *bar; }; * * // C * char buf[] = { 0xca, 0xfe, 0xba, 0xbe, 0x80, 0x08 }; * * MyFoo foo; * XDRUTIL_STRING_OPT(&foo.foo, "Hello, world!"); * * MyBar bar; * XDRUTIL_OPAQUE(&bar.bar, buf, sizeof buf); * * MyOptBar obar; * XDRUTIL_OPAQUE_OPT(&obar.bar, buf, sizeof buf); */ #define XDRUTIL_STRING_OPT(ptr, src) do { \ (ptr) = Util_SafeMalloc(sizeof *(ptr)); \ *(ptr) = Util_SafeStrdup((src)); \ } while (0) #define XDRUTIL_OPAQUE(ptr, src, srcSize) do { \ struct { u_int len; char *val; } __opaque_temp = {(srcSize), NULL}; \ ASSERT_ON_COMPILE(sizeof(*(ptr)) == sizeof(__opaque_temp)); \ \ __opaque_temp.val = Util_SafeMalloc((srcSize)); \ memcpy(__opaque_temp.val, (src), (srcSize)); \ memcpy(ptr, &__opaque_temp, sizeof __opaque_temp); \ } while (0) #define XDRUTIL_OPAQUE_OPT(ptr, src, srcSize) do { \ *(ptr) = Util_SafeMalloc(sizeof (struct { u_len; void*; })); \ XDRUTIL_OPAQUE(*(ptr), (src), (srcSize)); \ } while(0) void * XdrUtil_ArrayAppend(void **array, u_int *arrayLen, size_t elemSz, u_int elemCnt); Bool XdrUtil_Deserialize(const void *data, size_t dataLen, void *xdrProc, void *dest); #endif /* _XDRUTIL_H_ */ open-vm-tools-10.0.7-3227872/lib/include/hgfsEscape.h0000644000000000000000000000362612660700526020275 0ustar rootroot/********************************************************* * Copyright (C) 2008-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * hgfsEscape.h -- * * Escape and unescape filenames that are not legal on a particular * platform. * */ #ifndef __HGFS_ESCAPE_H__ #define __HGFS_ESCAPE_H__ int HgfsEscape_GetSize(char const *bufIn, uint32 sizeIn); int HgfsEscape_Do(char const *bufIn, uint32 sizeIn, uint32 sizeBufOut, char *bufOut); uint32 HgfsEscape_Undo(char *bufIn, uint32 sizeIn); #endif // __HGFS_ESCAPE_H__ open-vm-tools-10.0.7-3227872/lib/include/backdoor_def.h0000644000000000000000000002573012660700526020627 0ustar rootroot/********************************************************* * Copyright (C) 1998-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * backdoor_def.h -- * * This contains backdoor defines that can be included from * an assembly language file. */ #ifndef _BACKDOOR_DEF_H_ #define _BACKDOOR_DEF_H_ #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" /* * If you want to add a new low-level backdoor call for a guest userland * application, please consider using the GuestRpc mechanism instead. --hpreg */ #define BDOOR_MAGIC 0x564D5868 /* Low-bandwidth backdoor port. --hpreg */ #define BDOOR_PORT 0x5658 #define BDOOR_CMD_GETMHZ 1 /* * BDOOR_CMD_APMFUNCTION is used by: * * o The FrobOS code, which instead should either program the virtual chipset * (like the new BIOS code does, matthias offered to implement that), or not * use any VM-specific code (which requires that we correctly implement * "power off on CLI HLT" for SMP VMs, boris offered to implement that) * * o The old BIOS code, which will soon be jettisoned * * --hpreg */ #define BDOOR_CMD_APMFUNCTION 2 /* CPL0 only. */ #define BDOOR_CMD_GETDISKGEO 3 #define BDOOR_CMD_GETPTRLOCATION 4 #define BDOOR_CMD_SETPTRLOCATION 5 #define BDOOR_CMD_GETSELLENGTH 6 #define BDOOR_CMD_GETNEXTPIECE 7 #define BDOOR_CMD_SETSELLENGTH 8 #define BDOOR_CMD_SETNEXTPIECE 9 #define BDOOR_CMD_GETVERSION 10 #define BDOOR_CMD_GETDEVICELISTELEMENT 11 #define BDOOR_CMD_TOGGLEDEVICE 12 #define BDOOR_CMD_GETGUIOPTIONS 13 #define BDOOR_CMD_SETGUIOPTIONS 14 #define BDOOR_CMD_GETSCREENSIZE 15 #define BDOOR_CMD_MONITOR_CONTROL 16 /* Disabled by default. */ #define BDOOR_CMD_GETHWVERSION 17 #define BDOOR_CMD_OSNOTFOUND 18 /* CPL0 only. */ #define BDOOR_CMD_GETUUID 19 #define BDOOR_CMD_GETMEMSIZE 20 #define BDOOR_CMD_HOSTCOPY 21 /* Devel only. */ //#define BDOOR_CMD_SERVICE_VM 22 /* Not in use. Never shipped. */ #define BDOOR_CMD_GETTIME 23 /* Deprecated -> GETTIMEFULL. */ #define BDOOR_CMD_STOPCATCHUP 24 #define BDOOR_CMD_PUTCHR 25 /* Disabled by default. */ #define BDOOR_CMD_ENABLE_MSG 26 /* Devel only. */ #define BDOOR_CMD_GOTO_TCL 27 /* Devel only. */ #define BDOOR_CMD_INITPCIOPROM 28 /* CPL 0 only. */ //#define BDOOR_CMD_INT13 29 /* Not in use. */ #define BDOOR_CMD_MESSAGE 30 #define BDOOR_CMD_SIDT 31 #define BDOOR_CMD_SGDT 32 #define BDOOR_CMD_SLDT_STR 33 #define BDOOR_CMD_ISACPIDISABLED 34 //#define BDOOR_CMD_TOE 35 /* Not in use. */ #define BDOOR_CMD_ISMOUSEABSOLUTE 36 #define BDOOR_CMD_PATCH_SMBIOS_STRUCTS 37 /* CPL 0 only. */ #define BDOOR_CMD_MAPMEM 38 /* Devel only */ #define BDOOR_CMD_ABSPOINTER_DATA 39 #define BDOOR_CMD_ABSPOINTER_STATUS 40 #define BDOOR_CMD_ABSPOINTER_COMMAND 41 //#define BDOOR_CMD_TIMER_SPONGE 42 /* Not in use. */ #define BDOOR_CMD_PATCH_ACPI_TABLES 43 /* CPL 0 only. */ //#define BDOOR_CMD_DEVEL_FAKEHARDWARE 44 /* Not in use. */ #define BDOOR_CMD_GETHZ 45 #define BDOOR_CMD_GETTIMEFULL 46 //#define BDOOR_CMD_STATELOGGER 47 /* Not in use. */ #define BDOOR_CMD_CHECKFORCEBIOSSETUP 48 /* CPL 0 only. */ #define BDOOR_CMD_LAZYTIMEREMULATION 49 /* CPL 0 only. */ #define BDOOR_CMD_BIOSBBS 50 /* CPL 0 only. */ //#define BDOOR_CMD_VASSERT 51 /* Not in use. */ #define BDOOR_CMD_ISGOSDARWIN 52 #define BDOOR_CMD_DEBUGEVENT 53 #define BDOOR_CMD_OSNOTMACOSXSERVER 54 /* CPL 0 only. */ #define BDOOR_CMD_GETTIMEFULL_WITH_LAG 55 #define BDOOR_CMD_ACPI_HOTPLUG_DEVICE 56 /* Devel only. */ #define BDOOR_CMD_ACPI_HOTPLUG_MEMORY 57 /* Devel only. */ #define BDOOR_CMD_ACPI_HOTPLUG_CBRET 58 /* Devel only. */ //#define BDOOR_CMD_GET_HOST_VIDEO_MODES 59 /* Not in use. */ #define BDOOR_CMD_ACPI_HOTPLUG_CPU 60 /* Devel only. */ //#define BDOOR_CMD_USB_HOTPLUG_MOUSE 61 /* Not in use. Never shipped. */ #define BDOOR_CMD_XPMODE 62 /* CPL 0 only. */ #define BDOOR_CMD_NESTING_CONTROL 63 #define BDOOR_CMD_FIRMWARE_INIT 64 /* CPL 0 only. */ #define BDOOR_CMD_FIRMWARE_ACPI_SERVICES 65 /* CPL 0 only. */ # define BDOOR_CMD_FAS_GET_TABLE_SIZE 0 # define BDOOR_CMD_FAS_GET_TABLE_DATA 1 # define BDOOR_CMD_FAS_GET_PLATFORM_NAME 2 # define BDOOR_CMD_FAS_GET_PCIE_OSC_MASK 3 # define BDOOR_CMD_FAS_GET_APIC_ROUTING 4 # define BDOOR_CMD_FAS_GET_TABLE_SKIP 5 # define BDOOR_CMD_FAS_GET_SLEEP_ENABLES 6 # define BDOOR_CMD_FAS_GET_HARD_RESET_ENABLE 7 #define BDOOR_CMD_SENDPSHAREHINTS 66 /* Not in use. Deprecated. */ #define BDOOR_CMD_ENABLE_USB_MOUSE 67 #define BDOOR_CMD_GET_VCPU_INFO 68 # define BDOOR_CMD_VCPU_SLC64 0 # define BDOOR_CMD_VCPU_SYNC_VTSCS 1 # define BDOOR_CMD_VCPU_HV_REPLAY_OK 2 # define BDOOR_CMD_VCPU_LEGACY_X2APIC_OK 3 # define BDOOR_CMD_VCPU_MMIO_HONORS_PAT 4 # define BDOOR_CMD_VCPU_RESERVED 31 #define BDOOR_CMD_EFI_SERIALCON_CONFIG 69 /* CPL 0 only. */ #define BDOOR_CMD_BUG328986 70 /* CPL 0 only. */ #define BDOOR_CMD_FIRMWARE_ERROR 71 /* CPL 0 only. */ # define BDOOR_CMD_FE_INSUFFICIENT_MEM 0 # define BDOOR_CMD_FE_EXCEPTION 1 #define BDOOR_CMD_VMK_INFO 72 #define BDOOR_CMD_EFI_BOOT_CONFIG 73 /* CPL 0 only. */ # define BDOOR_CMD_EBC_LEGACYBOOT_ENABLED 0 # define BDOOR_CMD_EBC_GET_ORDER 1 # define BDOOR_CMD_EBC_SHELL_ACTIVE 2 # define BDOOR_CMD_EBC_GET_NETWORK_BOOT_PROTOCOL 3 #define BDOOR_CMD_GET_HW_MODEL 74 /* CPL 0 only. */ #define BDOOR_CMD_GET_SVGA_CAPABILITIES 75 /* CPL 0 only. */ #define BDOOR_CMD_GET_FORCE_X2APIC 76 /* CPL 0 only */ #define BDOOR_CMD_SET_PCI_HOLE 77 /* CPL 0 only */ #define BDOOR_CMD_GET_PCI_HOLE 78 /* CPL 0 only */ #define BDOOR_CMD_GET_PCI_BAR 79 /* CPL 0 only */ #define BDOOR_CMD_SHOULD_GENERATE_SYSTEMID 80 /* CPL 0 only */ #define BDOOR_CMD_READ_DEBUG_FILE 81 /* Devel only. */ #define BDOOR_CMD_SCREENSHOT 82 /* Devel only. */ #define BDOOR_CMD_INJECT_KEY 83 /* Devel only. */ #define BDOOR_CMD_INJECT_MOUSE 84 /* Devel only. */ #define BDOOR_CMD_MKS_GUEST_STATS 85 /* CPL 0 only. */ # define BDOOR_CMD_MKSGS_RESET 0 # define BDOOR_CMD_MKSGS_ADD_PPN 1 # define BDOOR_CMD_MKSGS_REMOVE_PPN 2 #define BDOOR_CMD_ABSPOINTER_RESTRICT 86 #define BDOOR_CMD_GUESTINTEGRITY 87 # define BDOOR_CMD_GI_SETUP 0 # define BDOOR_CMD_GI_REMOVE 1 #define BDOOR_CMD_MKSSTATS_SNAPSHOT 88 /* Devel only. */ # define BDOOR_CMD_MKSSTATS_START 0 # define BDOOR_CMD_MKSSTATS_STOP 1 #define BDOOR_CMD_MAX 89 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, * you must adhere to the semantics expected by the oldest Tools who use that * command. Specifically, do not alter the way in which the command modifies * the registers. Otherwise backwards compatibility will suffer. */ /* Nesting control operations */ #define NESTING_CONTROL_RESTRICT_BACKDOOR 0 #define NESTING_CONTROL_OPEN_BACKDOOR 1 #define NESTING_CONTROL_QUERY 2 #define NESTING_CONTROL_MAX 2 /* EFI Boot Order options, nibble-sized. */ #define EFI_BOOT_ORDER_TYPE_EFI 0x0 #define EFI_BOOT_ORDER_TYPE_LEGACY 0x1 #define EFI_BOOT_ORDER_TYPE_NONE 0xf #define BDOOR_NETWORK_BOOT_PROTOCOL_NONE 0x0 #define BDOOR_NETWORK_BOOT_PROTOCOL_IPV4 0x1 #define BDOOR_NETWORK_BOOT_PROTOCOL_IPV6 0x2 /* High-bandwidth backdoor port. --hpreg */ #define BDOORHB_PORT 0x5659 #define BDOORHB_CMD_MESSAGE 0 #define BDOORHB_CMD_VASSERT 1 #define BDOORHB_CMD_MAX 2 /* * There is another backdoor which allows access to certain TSC-related * values using otherwise illegal PMC indices when the pseudo_perfctr * control flag is set. */ #define BDOOR_PMC_HW_TSC 0x10000 #define BDOOR_PMC_REAL_NS 0x10001 #define BDOOR_PMC_APPARENT_NS 0x10002 #define BDOOR_PMC_PSEUDO_TSC 0x10003 #define IS_BDOOR_PMC(index) (((index) | 3) == 0x10003) #define BDOOR_CMD(ecx) ((ecx) & 0xffff) /* Sub commands for BDOOR_CMD_VMK_INFO */ #define BDOOR_CMD_VMK_INFO_ENTRY 1 #ifdef VMM /* *---------------------------------------------------------------------- * * Backdoor_CmdRequiresFullyValidVCPU -- * * A few backdoor commands require the full VCPU to be valid * (including GDTR, IDTR, TR and LDTR). The rest get read/write * access to GPRs and read access to Segment registers (selectors). * * Result: * True iff VECX contains a command that require the full VCPU to * be valid. * *---------------------------------------------------------------------- */ static INLINE Bool Backdoor_CmdRequiresFullyValidVCPU(unsigned cmd) { return cmd == BDOOR_CMD_SIDT || cmd == BDOOR_CMD_SGDT || cmd == BDOOR_CMD_SLDT_STR; } #endif #endif open-vm-tools-10.0.7-3227872/lib/include/vm_basic_asm.h0000644000000000000000000007547112660700526020657 0ustar rootroot/********************************************************* * Copyright (C) 2003-2015 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation version 2.1 and no 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 Lesser GNU General Public * License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * *********************************************************/ /********************************************************* * The contents of this file are subject to the terms of the Common * Development and Distribution License (the "License") version 1.0 * and no later version. You may not use this file except in * compliance with the License. * * You can obtain a copy of the License at * http://www.opensource.org/licenses/cddl1.php * * See the License for the specific language governing permissions * and limitations under the License. * *********************************************************/ /* * vm_basic_asm.h * * Basic asm macros */ #ifndef _VM_BASIC_ASM_H_ #define _VM_BASIC_ASM_H_ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_VMMON #define INCLUDE_ALLOW_VMK_MODULE #define INCLUDE_ALLOW_VMKERNEL #define INCLUDE_ALLOW_DISTRIBUTE #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #include "vm_basic_types.h" #if defined VM_X86_64 #include "vm_basic_asm_x86_common.h" #include "vm_basic_asm_x86_64.h" #elif defined VM_X86_32 #include "vm_basic_asm_x86_common.h" #include "vm_basic_asm_x86.h" #elif defined VM_ARM_64 #include "arm64_basic_defs.h" #include "vm_basic_asm_arm64.h" #else #define MUL64_NO_ASM 1 #include "mul64.h" #endif /* * Locate most and least significant bit set functions. Use our own name * space to avoid namespace collisions. The new names follow a pattern, *